Address simple linter issues

This commit is contained in:
Ian Davis
2022-11-24 16:32:27 +00:00
parent ca3b7c3bcf
commit 9f85d3dca7
15 changed files with 25 additions and 30 deletions
+4 -1
View File
@@ -24,6 +24,8 @@ import (
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/protocol"
"github.com/multiformats/go-multiaddr"
"golang.org/x/text/cases"
"golang.org/x/text/language"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-bitfield"
@@ -456,7 +458,8 @@ func exampleStruct(method string, t, parent reflect.Type) interface{} {
if f.Type == parent {
continue
}
if strings.Title(f.Name) == f.Name {
caser := cases.Title(language.English)
if caser.String(f.Name) == f.Name {
ns.Elem().Field(i).Set(reflect.ValueOf(ExampleValue(method, f.Type, t)))
}
}