Skip to content

Commit 6239da4

Browse files
author
Christian Boitel
committed
chore #482: apply go 1.19 format
1 parent 2654210 commit 6239da4

File tree

7 files changed

+23
-22
lines changed

7 files changed

+23
-22
lines changed

jsoninfo/marshal.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
)
88

99
// MarshalStrictStruct function:
10-
// * Marshals struct fields, ignoring MarshalJSON() and fields without 'json' tag.
11-
// * Correctly handles StrictStruct semantics.
10+
// - Marshals struct fields, ignoring MarshalJSON() and fields without 'json' tag.
11+
// - Correctly handles StrictStruct semantics.
1212
func MarshalStrictStruct(value StrictStruct) ([]byte, error) {
1313
encoder := NewObjectEncoder()
1414
if err := value.EncodeWith(encoder, value); err != nil {

jsoninfo/marshal_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@ type EmbeddedType1 struct {
6464
}
6565

6666
// Example describes expected outcome of:
67-
// 1.Marshal JSON
68-
// 2.Unmarshal value
69-
// 3.Marshal value
67+
//
68+
// 1.Marshal JSON
69+
// 2.Unmarshal value
70+
// 3.Marshal value
7071
type Example struct {
7172
NoMarshal bool
7273
NoUnmarshal bool

jsoninfo/unmarshal.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
)
88

99
// UnmarshalStrictStruct function:
10-
// * Unmarshals struct fields, ignoring UnmarshalJSON(...) and fields without 'json' tag.
11-
// * Correctly handles StrictStruct
10+
// - Unmarshals struct fields, ignoring UnmarshalJSON(...) and fields without 'json' tag.
11+
// - Correctly handles StrictStruct
1212
func UnmarshalStrictStruct(data []byte, value StrictStruct) error {
1313
decoder, err := NewObjectDecoder(data)
1414
if err != nil {

openapi3/errors.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ func (me MultiError) Error() string {
1818
return buff.String()
1919
}
2020

21-
//Is allows you to determine if a generic error is in fact a MultiError using `errors.Is()`
22-
//It will also return true if any of the contained errors match target
21+
// Is allows you to determine if a generic error is in fact a MultiError using `errors.Is()`
22+
// It will also return true if any of the contained errors match target
2323
func (me MultiError) Is(target error) bool {
2424
if _, ok := target.(MultiError); ok {
2525
return true
@@ -32,7 +32,7 @@ func (me MultiError) Is(target error) bool {
3232
return false
3333
}
3434

35-
//As allows you to use `errors.As()` to set target to the first error within the multi error that matches the target type
35+
// As allows you to use `errors.As()` to set target to the first error within the multi error that matches the target type
3636
func (me MultiError) As(target interface{}) bool {
3737
for _, e := range me {
3838
if errors.As(e, target) {

openapi3/internalize_refs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ func (doc *T) derefPaths(paths map[string]*PathItem, refNameResolver RefNameReso
322322
//
323323
// Example:
324324
//
325-
// doc.InternalizeRefs(context.Background(), nil)
325+
// doc.InternalizeRefs(context.Background(), nil)
326326
func (doc *T) InternalizeRefs(ctx context.Context, refNameResolver func(ref string) string) {
327327
if refNameResolver == nil {
328328
refNameResolver = DefaultRefNameResolver

openapi3/paths.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ func (paths Paths) Validate(ctx context.Context) error {
9898
//
9999
// For example:
100100
//
101-
// paths := openapi3.Paths {
102-
// "/person/{personName}": &openapi3.PathItem{},
103-
// }
104-
// pathItem := path.Find("/person/{name}")
101+
// paths := openapi3.Paths {
102+
// "/person/{personName}": &openapi3.PathItem{},
103+
// }
104+
// pathItem := path.Find("/person/{name}")
105105
//
106106
// would return the correct path item.
107107
func (paths Paths) Find(key string) *PathItem {

routers/legacy/pathpattern/node.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Package pathpattern implements path matching.
22
//
33
// Examples of supported patterns:
4-
// * "/"
5-
// * "/abc""
6-
// * "/abc/{variable}" (matches until next '/' or end-of-string)
7-
// * "/abc/{variable*}" (matches everything, including "/abc" if "/abc" has noot)
8-
// * "/abc/{ variable | prefix_(.*}_suffix }" (matches regular expressions)
4+
// - "/"
5+
// - "/abc""
6+
// - "/abc/{variable}" (matches until next '/' or end-of-string)
7+
// - "/abc/{variable*}" (matches everything, including "/abc" if "/abc" has noot)
8+
// - "/abc/{ variable | prefix_(.*}_suffix }" (matches regular expressions)
99
package pathpattern
1010

1111
import (
@@ -28,8 +28,8 @@ type Options struct {
2828
// PathFromHost converts a host pattern to a path pattern.
2929
//
3030
// Examples:
31-
// * PathFromHost("some-subdomain.domain.com", false) -> "com/./domain/./some-subdomain"
32-
// * PathFromHost("some-subdomain.domain.com", true) -> "com/./domain/./subdomain/-/some"
31+
// - PathFromHost("some-subdomain.domain.com", false) -> "com/./domain/./some-subdomain"
32+
// - PathFromHost("some-subdomain.domain.com", true) -> "com/./domain/./subdomain/-/some"
3333
func PathFromHost(host string, specialDashes bool) string {
3434
buf := make([]byte, 0, len(host))
3535
end := len(host)

0 commit comments

Comments
 (0)