fix golint issues (#450)

master
Kevin Wan 4 years ago committed by GitHub
parent 0dda05fd57
commit 9b0625bb83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -58,6 +58,7 @@ func TestAesEcbBase64(t *testing.T) {
_, err = EcbDecryptBase64(b64Key, val) _, err = EcbDecryptBase64(b64Key, val)
assert.NotNil(t, err) assert.NotNil(t, err)
src, err := EcbDecryptBase64(b64Key, dst) src, err := EcbDecryptBase64(b64Key, dst)
assert.Nil(t, err)
b, err := base64.StdEncoding.DecodeString(src) b, err := base64.StdEncoding.DecodeString(src)
assert.Nil(t, err) assert.Nil(t, err)
assert.Equal(t, val, string(b)) assert.Equal(t, val, string(b))

@ -107,7 +107,7 @@ func createWith(dir string, api *spec.ApiSpec, route spec.Route, packetName stri
} }
_, err = fp.WriteString(formatSource(tmplBytes.String())) _, err = fp.WriteString(formatSource(tmplBytes.String()))
return nil return err
} }
func doc(route spec.Route) string { func doc(route spec.Route) string {

@ -334,13 +334,13 @@ func TestTypeBlock(t *testing.T) {
return p.TypeBlock().Accept(visitor) return p.TypeBlock().Accept(visitor)
} }
t.Run("normal", func(t *testing.T) { t.Run("normal", func(t *testing.T) {
v, err := parser.Accept(fn, `type( _, err := parser.Accept(fn, `type(
// doc // doc
Foo int Foo int
)`) )`)
assert.Error(t, err) assert.Error(t, err)
v, err = parser.Accept(fn, `type ( v, err := parser.Accept(fn, `type (
// doc // doc
Foo { Foo {
Bar int Bar int

@ -49,7 +49,7 @@ func ToMap(in interface{}) map[string]interface{} {
return out return out
} }
// deprecated: use RawFieldNames instead automaticly while model generating after goctl version v1.1.0 // deprecated: use RawFieldNames instead automatically while model generating after goctl version v1.1.0
func FieldNames(in interface{}) []string { func FieldNames(in interface{}) []string {
out := make([]string, 0) out := make([]string, 0)
v := reflect.ValueOf(in) v := reflect.ValueOf(in)

Loading…
Cancel
Save