Popularity
1.5
Stable
Activity
0.0
Stable
18
2
1
Programming language: Go
License: MIT License
Tags:
Generation & Generics
Latest version: v0.1.0
typeregistry alternatives and similar packages
Based on the "Generation and Generics" category.
Alternatively, view typeregistry alternatives based on common mentions on social networks and blogs.
-
goderive
Derives and generates mundane golang functions that you do not want to maintain yourself -
GoWrap
GoWrap is a command line tool for generating decorators for Go interfaces -
goverter
Generate type-safe Go converters by simply defining an interface
Static code analysis for 29 languages.
Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.
Promo
www.sonarqube.org
Do you think we are missing an alternative of typeregistry or a related project?
Popular Comparisons
README
a library to create type dynamically
how to use
// 1. define struct
type Student struct {
Age int
Name string
}
// 2. add reflect type
key := AddType(new(Student))
// 3. create struct from registed key
student := Make(key)
custom registed key
var i interface{} = new(Student)
// use lowercase struct name as key
name := AddTypeWithKey(i, func(i interface{}) string {
tpe := reflect.TypeOf(i).Elem()
return strings.ToLower(tpe.Name())
})
student, ok := Create("student").(*Student)
benchmark
go.exe test -benchmem -run=^$ supperxin/typeregistry -bench ^BenchmarkMake$
goos: windows
goarch: amd64
pkg: supperxin/typeregistry
BenchmarkMake-8 8823256 138 ns/op 64 B/op 2 allocs/op
PASS
ok supperxin/typeregistry 1.551s
go.exe test -benchmem -run=^$ supperxin/typeregistry -bench ^BenchmarkCreateDirectly$
goos: windows
goarch: amd64
pkg: supperxin/typeregistry
BenchmarkCreateDirectly-8 1000000000 0.593 ns/op 0 B/op 0 allocs/op
PASS
ok supperxin/typeregistry 0.857s