Closed dmitshur closed 8 years ago
This is not your fault (it is like this in the Go sources), but a positive list for the fallback is silly.
Could you check if this works:
// +build !amd64,!amd64p32 appengine gccgo
If it does, let's change this line to this instead.
This is not your fault (it is like this in the Go sources), but a positive list for the fallback is silly.
Agreed. I wanted to do that too.
I'll try what you suggested and confirm it works.
Ok, I've tested that, and it works for gc
(darwin, amd64) and gopherjs
(darwin, js) environments:
crc32 $ go test -v
=== RUN TestGolden
--- PASS: TestGolden (0.00s)
=== RUN ExampleMakeTable
--- PASS: ExampleMakeTable (0.00s)
PASS
ok github.com/klauspost/crc32 0.018s
crc32 $ gopherjs test -v
gopherjs: Source maps disabled. Use Node.js 4.x with source-map-support module for nice stack traces.
=== RUN TestGolden
--- PASS: TestGolden (0.02s)
PASS
ok github.com/klauspost/crc32 0.587s
The total set of build tags used across all files is quite complex, and I'm not completely confident that every single scenario is covered correctly.
But I'll update the PR. I've also cleaned up the style of build tags to be more idiomatic and consistent.
The total set of build tags used across all files is quite complex, and I'm not completely confident that every single scenario is covered correctly.
Thanks for testing. At least with this change, we "only" have to exclude the known optimized functions, and white-list all non-optimized platforms.
If you update the PR, I will merge it, and take the blame if it doesn't work :)
I've updated, PTAL.
No problem. Thanks for the contribution!
Fixes gopherjs/gopherjs#378. /cc @kaustavha
I've tested, and its
TestGolden
passes usinggopherjs
compiler after this change: