@ -58,6 +58,7 @@ func TestAesEcbBase64(t *testing.T) {
_, err = EcbDecryptBase64(b64Key, val)
assert.NotNil(t, err)
src, err := EcbDecryptBase64(b64Key, dst)
assert.Nil(t, err)
b, err := base64.StdEncoding.DecodeString(src)
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()))
return nil
return err
func doc(route spec.Route) string {
@ -334,13 +334,13 @@ func TestTypeBlock(t *testing.T) {
return p.TypeBlock().Accept(visitor)
t.Run("normal", func(t *testing.T) {
v, err := parser.Accept(fn, `type(
_, err := parser.Accept(fn, `type(
// doc
Foo int
)`)
assert.Error(t, err)
v, err = parser.Accept(fn, `type (
v, err := parser.Accept(fn, `type (
Foo {
Bar int
@ -49,7 +49,7 @@ func ToMap(in interface{}) map[string]interface{} {
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 {
out := make([]string, 0)
v := reflect.ValueOf(in)