No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
t0pep0 Merge pull request #9 from AlekSi/patch-1
Test with latest Go versions
Latest commit 455acac Oct 12, 2017
Permalink
Failed to load latest commit information.
ecutils simplify code && go vet Nov 21, 2016
example close #8 Nov 30, 2016
.coveralls.yml Create .coveralls.yml Nov 18, 2016
.travis.yml Test with latest Go versions Aug 9, 2017
License.md Update License.md Nov 22, 2016
README.md Fix slashes in comments Sep 22, 2017
efaceconv.go close #8 Nov 30, 2016
efaceconv_test.go test coverage Nov 21, 2016

README.md

TravisCI GoReportCard GoDoc Coverage Status

efaceconv

High performance conversion from interface{} to immutable types without additional allocations

This is tool for go generate and common lib (ecutils)

Usage:

//go:generate efaceconv
//ec::string:String
//ec:net/http:http.ResponseWriter:ResponseWritter

//ec:<import package name>:<type>:<custom name>

generated function:

func Eface2CustomName(arg interface{}) (*type, bool)

View ./example dir

=== RUN   TestEface2SByte
--- PASS: TestEface2SByte (0.00s)
=== RUN   TestEface2String
--- PASS: TestEface2String (0.00s)
=== RUN   TestEface2SInt
--- PASS: TestEface2SInt (0.00s)
BenchmarkEface2SByte-4          100000000               11.8 ns/op             0 B/op          0 allocs/op
--- BENCH: BenchmarkEface2SByte-4
        efaceconv_generated_test.go:33: &[] true
        efaceconv_generated_test.go:33: &[] true
        efaceconv_generated_test.go:33: &[] true
        efaceconv_generated_test.go:33: &[] true
        efaceconv_generated_test.go:33: &[] true
BenchmarkSByteClassic-4         30000000                50.4 ns/op            32 B/op          1 allocs/op
--- BENCH: BenchmarkSByteClassic-4
        efaceconv_generated_test.go:48: [] true
        efaceconv_generated_test.go:48: [] true
        efaceconv_generated_test.go:48: [] true
        efaceconv_generated_test.go:48: [] true
        efaceconv_generated_test.go:48: [] true
BenchmarkEface2String-4         100000000               11.1 ns/op             0 B/op          0 allocs/op
--- BENCH: BenchmarkEface2String-4
        efaceconv_generated_test.go:76: 0xc42003fee8 true
        efaceconv_generated_test.go:76: 0xc420043ea8 true
        efaceconv_generated_test.go:76: 0xc420043ea8 true
        efaceconv_generated_test.go:76: 0xc420043ea8 true
        efaceconv_generated_test.go:76: 0xc420043ea8 true
BenchmarkStringClassic-4        30000000                45.3 ns/op            16 B/op          1 allocs/op
--- BENCH: BenchmarkStringClassic-4
        efaceconv_generated_test.go:91:  true
        efaceconv_generated_test.go:91:  true
        efaceconv_generated_test.go:91:  true
        efaceconv_generated_test.go:91:  true
        efaceconv_generated_test.go:91:  true
BenchmarkEface2SInt-4           100000000               11.6 ns/op             0 B/op          0 allocs/op
--- BENCH: BenchmarkEface2SInt-4
        efaceconv_generated_test.go:119: &[] true
        efaceconv_generated_test.go:119: &[] true
        efaceconv_generated_test.go:119: &[] true
        efaceconv_generated_test.go:119: &[] true
        efaceconv_generated_test.go:119: &[] true
BenchmarkSIntClassic-4          30000000                50.5 ns/op            32 B/op          1 allocs/op
--- BENCH: BenchmarkSIntClassic-4
        efaceconv_generated_test.go:134: [] true
        efaceconv_generated_test.go:134: [] true
        efaceconv_generated_test.go:134: [] true
        efaceconv_generated_test.go:134: [] true
        efaceconv_generated_test.go:134: [] true
PASS
ok      github.com/t0pep0/efaceconv/example     8.050s