Skip to content

Commit

Permalink
Merge pull request #39 from kotyara85/interface_support
Browse files Browse the repository at this point in the history
Add interface{} support
  • Loading branch information
phelmkamp committed Mar 25, 2022
2 parents 58d17e4 + a6c357a commit 7542e2a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@ module github.com/phelmkamp/metatag

go 1.13

require (
github.com/satori/go.uuid v1.2.0
golang.org/x/tools v0.0.0-20201118030313-598b068a9102 // indirect
)
require golang.org/x/tools v0.0.0-20201118030313-598b068a9102
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
Expand Down
8 changes: 5 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ func main() {
}
case *ast.MapType:
fldTgt.FldType = fmt.Sprintf("map[%s]%s", ft.Key.(*ast.Ident).Name, ft.Value.(*ast.Ident).Name)
case interface{}:
fldTgt.FldType = "interface{}"
default:
log.Printf("Unsupported field type: %v\n", ft)
continue
Expand All @@ -158,9 +160,9 @@ func main() {
if fldPkg != "" {
var importPath string
for _, p := range importPaths {
if p.Name == fldPkg {
importPath = p.PkgPath
}
if p.Name == fldPkg {
importPath = p.PkgPath
}
}
log.Printf("Adding import: \"%s\"\n", importPath)
tgt.MetaFile.Imports[importPath] = struct{}{}
Expand Down

0 comments on commit 7542e2a

Please sign in to comment.