Skip to content

Commit 94a8c18

Browse files
authored
chore: Fix comments/imports (#789)
* Format yaml * Format imports * Fix comments * Format yamls * Tidy * Renames * Generate * Revert generated
1 parent 9feb50e commit 94a8c18

8 files changed

Lines changed: 12 additions & 15 deletions

File tree

bind.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ package runtime
2121
// Binder implements Bind("") as a no-op.
2222
type Binder interface {
2323
Bind(src string) error
24-
}
24+
}

bindform_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ import (
66
"net/url"
77
"testing"
88

9-
"github.com/stretchr/testify/assert"
10-
119
"github.com/deepmap/oapi-codegen/pkg/types"
10+
"github.com/stretchr/testify/assert"
1211
)
1312

1413
func TestBindURLForm(t *testing.T) {

bindparam.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"github.com/deepmap/oapi-codegen/pkg/types"
2727
)
2828

29-
// This function binds a parameter as described in the Path Parameters
29+
// BindStyledParameter binds a parameter as described in the Path Parameters
3030
// section here to a Go object:
3131
// https://swagger.io/docs/specification/serialization/
3232
// It is a backward compatible function to clients generated with codegen
@@ -36,7 +36,7 @@ func BindStyledParameter(style string, explode bool, paramName string,
3636
return BindStyledParameterWithLocation(style, explode, paramName, ParamLocationUndefined, value, dest)
3737
}
3838

39-
// This function binds a parameter as described in the Path Parameters
39+
// BindStyledParameterWithLocation binds a parameter as described in the Path Parameters
4040
// section here to a Go object:
4141
// https://swagger.io/docs/specification/serialization/
4242
func BindStyledParameterWithLocation(style string, explode bool, paramName string,

bindparam_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ import (
2121
"testing"
2222
"time"
2323

24+
"github.com/deepmap/oapi-codegen/pkg/types"
2425
"github.com/stretchr/testify/assert"
2526
"github.com/stretchr/testify/require"
26-
27-
"github.com/deepmap/oapi-codegen/pkg/types"
2827
)
2928

3029
// MockBinder is just an independent version of Binder that has the Bind implemented

bindstring.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"github.com/deepmap/oapi-codegen/pkg/types"
2525
)
2626

27-
// This function takes a string, and attempts to assign it to the destination
27+
// BindStringToObject takes a string, and attempts to assign it to the destination
2828
// interface via whatever type conversion is necessary. We have to do this
2929
// via reflection instead of a much simpler type switch so that we can handle
3030
// type aliases. This function was the easy way out, the better way, since we

bindstring_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ import (
1919
"testing"
2020
"time"
2121

22-
"github.com/stretchr/testify/assert"
23-
2422
"github.com/deepmap/oapi-codegen/pkg/types"
23+
"github.com/stretchr/testify/assert"
2524
)
2625

2726
func TestBindStringToObject(t *testing.T) {

styleparam.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
)
2929

3030
// Parameter escaping works differently based on where a header is found
31+
3132
type ParamLocation int
3233

3334
const (
@@ -38,7 +39,7 @@ const (
3839
ParamLocationCookie
3940
)
4041

41-
// This function is used by older generated code, and must remain compatible
42+
// StyleParam is used by older generated code, and must remain compatible
4243
// with that code. It is not to be used in new templates. Please see the
4344
// function below, which can specialize its output based on the location of
4445
// the parameter.

styleparam_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ import (
1717
"testing"
1818
"time"
1919

20+
"github.com/deepmap/oapi-codegen/pkg/types"
2021
"github.com/google/uuid"
2122
"github.com/stretchr/testify/assert"
22-
23-
"github.com/deepmap/oapi-codegen/pkg/types"
2423
)
2524

2625
func TestStyleParam(t *testing.T) {
@@ -45,7 +44,7 @@ func TestStyleParam(t *testing.T) {
4544
timestamp := AliasedTime(ti)
4645

4746
type AliasedDate types.Date
48-
date := AliasedDate{time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC)}
47+
date := AliasedDate{Time: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC)}
4948

5049
type AliasedUUID types.UUID
5150
aUUID := AliasedUUID(uuid.MustParse("baa07328-452e-40bd-aa2e-fa823ec13605"))
@@ -670,7 +669,7 @@ func TestStyleParam(t *testing.T) {
670669
object3 := testObject3{
671670
TimeField: timeVal,
672671
DateField: dateVal,
673-
UUIDField: uuid.UUID(uuidVal),
672+
UUIDField: uuidVal,
674673
}
675674

676675
result, err = StyleParamWithLocation("simple", false, "id", ParamLocationQuery, object3)

0 commit comments

Comments
 (0)