Skip to content

Commit

Permalink
Code cleanup (#8)
Browse files Browse the repository at this point in the history
*Code cleanup
  • Loading branch information
abice authored Feb 11, 2019
1 parent e705d73 commit 5bc13a7
Show file tree
Hide file tree
Showing 12 changed files with 258 additions and 241 deletions.
50 changes: 19 additions & 31 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
version: 2
jobs:
golang_1.9:
working_directory: /go/src/github.com/abice/gencheck
docker:
- image: circleci/golang:1.9
steps:

jobBase: &jobBase
working_directory: /go/src/github.com/abice/gencheck
steps:
- checkout
- run:
name: Install Go Deps
Expand All @@ -25,35 +23,25 @@ jobs:
make test
make cover
make coveralls
golang_1.10.1:
working_directory: /go/src/github.com/abice/gencheck
jobs:
golang_1.9:
<<: *jobBase
docker:
- image: circleci/golang:1.10.1
steps:
- checkout
- run:
name: Install Go Deps
command: |
curl https://glide.sh/get | sh
go get -v github.com/kevinburke/go-bindata/...
go get -v golang.org/x/tools/cmd/cover
go get -v github.com/mattn/goveralls
go get -v github.com/modocache/gover
glide install
- run:
name: Build
command: |
make reinstall
- run:
name: Test
command: |
make test
make cover
make coveralls
- image: circleci/golang:1.9
golang_1.10:
<<: *jobBase
docker:
- image: circleci/golang:1.10
golang_1.11:
<<: *jobBase
docker:
- image: circleci/golang:1.11

workflows:
version: 2
build_and_test:
jobs:
- golang_1.9
- golang_1.10.1
- golang_1.10
- golang_1.11
32 changes: 16 additions & 16 deletions benchmark_failfast.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
goos: darwin
goarch: amd64
pkg: github.com/abice/gencheck/internal/benchmark
BenchmarkCompareGencheck/UUID_Pass-8 2000000 845 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/UUID_Fail-8 1000000 1153 ns/op 208 B/op 6 allocs/op
BenchmarkCompareGencheck/Hex_Pass-8 2000000 594 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/Hex_Fail-8 2000000 945 ns/op 192 B/op 6 allocs/op
BenchmarkCompareGencheck/ContainsAny_Pass-8 30000000 47.8 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/ContainsAny_Fail-8 10000000 224 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestStrings_Pass-8 200000000 9.33 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/TestStrings_Fail-8 10000000 173 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestMap_Pass-8 200000000 8.77 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/TestMap_Fail-8 10000000 167 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestDive_Pass-8 100000000 23.2 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/TestDive_Fail-8 1000000 1081 ns/op 800 B/op 15 allocs/op
BenchmarkCompareGencheck/TestDive_Nil-8 10000000 166 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestAll_Pass-8 1000000 2371 ns/op 328 B/op 6 allocs/op
BenchmarkCompareGencheck/TestAll_Fail-8 10000000 175 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/UUID_Pass-8 2000000 739 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/UUID_Fail-8 1000000 1130 ns/op 208 B/op 6 allocs/op
BenchmarkCompareGencheck/Hex_Pass-8 3000000 538 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/Hex_Fail-8 2000000 882 ns/op 192 B/op 6 allocs/op
BenchmarkCompareGencheck/ContainsAny_Pass-8 30000000 44.6 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/ContainsAny_Fail-8 10000000 232 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestStrings_Pass-8 200000000 7.11 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/TestStrings_Fail-8 10000000 169 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestMap_Pass-8 200000000 8.45 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/TestMap_Fail-8 10000000 173 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestDive_Pass-8 100000000 23.8 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/TestDive_Fail-8 1000000 1271 ns/op 800 B/op 15 allocs/op
BenchmarkCompareGencheck/TestDive_Nil-8 10000000 193 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestAll_Pass-8 500000 2682 ns/op 328 B/op 6 allocs/op
BenchmarkCompareGencheck/TestAll_Fail-8 10000000 201 ns/op 128 B/op 4 allocs/op
PASS
ok github.com/abice/gencheck/internal/benchmark 31.191s
ok github.com/abice/gencheck/internal/benchmark 30.099s
```
32 changes: 16 additions & 16 deletions benchmark_nooptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
goos: darwin
goarch: amd64
pkg: github.com/abice/gencheck/internal/benchmark
BenchmarkCompareGencheck/UUID_Pass-8 2000000 826 ns/op 16 B/op 1 allocs/op
BenchmarkCompareGencheck/UUID_Fail-8 1000000 1096 ns/op 208 B/op 6 allocs/op
BenchmarkCompareGencheck/Hex_Pass-8 3000000 579 ns/op 16 B/op 1 allocs/op
BenchmarkCompareGencheck/Hex_Fail-8 2000000 881 ns/op 192 B/op 6 allocs/op
BenchmarkCompareGencheck/ContainsAny_Pass-8 20000000 74.4 ns/op 16 B/op 1 allocs/op
BenchmarkCompareGencheck/ContainsAny_Fail-8 10000000 199 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestStrings_Pass-8 20000000 67.0 ns/op 64 B/op 1 allocs/op
BenchmarkCompareGencheck/TestStrings_Fail-8 3000000 408 ns/op 416 B/op 10 allocs/op
BenchmarkCompareGencheck/TestMap_Pass-8 50000000 37.8 ns/op 16 B/op 1 allocs/op
BenchmarkCompareGencheck/TestMap_Fail-8 10000000 151 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestDive_Pass-8 20000000 80.0 ns/op 32 B/op 2 allocs/op
BenchmarkCompareGencheck/TestDive_Fail-8 1000000 1016 ns/op 800 B/op 15 allocs/op
BenchmarkCompareGencheck/TestDive_Nil-8 10000000 142 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestAll_Pass-8 500000 2424 ns/op 632 B/op 8 allocs/op
BenchmarkCompareGencheck/TestAll_Fail-8 300000 4669 ns/op 2929 B/op 56 allocs/op
BenchmarkCompareGencheck/UUID_Pass-8 2000000 818 ns/op 16 B/op 1 allocs/op
BenchmarkCompareGencheck/UUID_Fail-8 1000000 1230 ns/op 208 B/op 6 allocs/op
BenchmarkCompareGencheck/Hex_Pass-8 2000000 537 ns/op 16 B/op 1 allocs/op
BenchmarkCompareGencheck/Hex_Fail-8 2000000 862 ns/op 192 B/op 6 allocs/op
BenchmarkCompareGencheck/ContainsAny_Pass-8 20000000 94.0 ns/op 16 B/op 1 allocs/op
BenchmarkCompareGencheck/ContainsAny_Fail-8 5000000 265 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestStrings_Pass-8 20000000 88.3 ns/op 64 B/op 1 allocs/op
BenchmarkCompareGencheck/TestStrings_Fail-8 3000000 541 ns/op 416 B/op 10 allocs/op
BenchmarkCompareGencheck/TestMap_Pass-8 30000000 54.4 ns/op 16 B/op 1 allocs/op
BenchmarkCompareGencheck/TestMap_Fail-8 10000000 211 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestDive_Pass-8 20000000 114 ns/op 32 B/op 2 allocs/op
BenchmarkCompareGencheck/TestDive_Fail-8 1000000 1284 ns/op 800 B/op 15 allocs/op
BenchmarkCompareGencheck/TestDive_Nil-8 10000000 204 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestAll_Pass-8 500000 2927 ns/op 632 B/op 8 allocs/op
BenchmarkCompareGencheck/TestAll_Fail-8 300000 6046 ns/op 2929 B/op 56 allocs/op
PASS
ok github.com/abice/gencheck/internal/benchmark 25.966s
ok github.com/abice/gencheck/internal/benchmark 28.927s
```
32 changes: 16 additions & 16 deletions benchmark_noprealloc.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
goos: darwin
goarch: amd64
pkg: github.com/abice/gencheck/internal/benchmark
BenchmarkCompareGencheck/UUID_Pass-8 2000000 791 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/UUID_Fail-8 1000000 1110 ns/op 208 B/op 6 allocs/op
BenchmarkCompareGencheck/Hex_Pass-8 3000000 537 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/Hex_Fail-8 2000000 991 ns/op 192 B/op 6 allocs/op
BenchmarkCompareGencheck/ContainsAny_Pass-8 30000000 46.2 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/ContainsAny_Fail-8 10000000 218 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestStrings_Pass-8 200000000 8.83 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/TestStrings_Fail-8 3000000 529 ns/op 464 B/op 12 allocs/op
BenchmarkCompareGencheck/TestMap_Pass-8 200000000 8.54 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/TestMap_Fail-8 10000000 171 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestDive_Pass-8 100000000 23.7 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/TestDive_Fail-8 1000000 1067 ns/op 800 B/op 15 allocs/op
BenchmarkCompareGencheck/TestDive_Nil-8 10000000 155 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestAll_Pass-8 500000 2300 ns/op 328 B/op 6 allocs/op
BenchmarkCompareGencheck/TestAll_Fail-8 300000 5588 ns/op 3649 B/op 61 allocs/op
BenchmarkCompareGencheck/UUID_Pass-8 2000000 855 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/UUID_Fail-8 1000000 1161 ns/op 208 B/op 6 allocs/op
BenchmarkCompareGencheck/Hex_Pass-8 3000000 507 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/Hex_Fail-8 2000000 861 ns/op 192 B/op 6 allocs/op
BenchmarkCompareGencheck/ContainsAny_Pass-8 30000000 43.2 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/ContainsAny_Fail-8 10000000 236 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestStrings_Pass-8 200000000 7.11 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/TestStrings_Fail-8 2000000 594 ns/op 464 B/op 12 allocs/op
BenchmarkCompareGencheck/TestMap_Pass-8 200000000 8.49 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/TestMap_Fail-8 10000000 175 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestDive_Pass-8 50000000 24.0 ns/op 0 B/op 0 allocs/op
BenchmarkCompareGencheck/TestDive_Fail-8 1000000 1159 ns/op 800 B/op 15 allocs/op
BenchmarkCompareGencheck/TestDive_Nil-8 10000000 167 ns/op 128 B/op 4 allocs/op
BenchmarkCompareGencheck/TestAll_Pass-8 1000000 2300 ns/op 328 B/op 6 allocs/op
BenchmarkCompareGencheck/TestAll_Fail-8 300000 5777 ns/op 3649 B/op 61 allocs/op
PASS
ok github.com/abice/gencheck/internal/benchmark 29.810s
ok github.com/abice/gencheck/internal/benchmark 29.262s
```
28 changes: 14 additions & 14 deletions benchmark_playground.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
goos: darwin
goarch: amd64
pkg: github.com/abice/gencheck/internal/benchmark
BenchmarkComparePlayground/UUID_Pass-8 1000000 1081 ns/op 16 B/op 1 allocs/op
BenchmarkComparePlayground/UUID_Fail-8 1000000 1307 ns/op 224 B/op 5 allocs/op
BenchmarkComparePlayground/Hex_Pass-8 2000000 712 ns/op 0 B/op 0 allocs/op
BenchmarkComparePlayground/Hex_Fail-8 2000000 971 ns/op 208 B/op 4 allocs/op
BenchmarkComparePlayground/ContainsAny_Pass-8 10000000 206 ns/op 0 B/op 0 allocs/op
BenchmarkComparePlayground/ContainsAny_Fail-8 3000000 426 ns/op 224 B/op 4 allocs/op
BenchmarkComparePlayground/TestStrings_Pass-8 3000000 443 ns/op 16 B/op 1 allocs/op
BenchmarkComparePlayground/TestStrings_Fail-8 1000000 1209 ns/op 816 B/op 13 allocs/op
BenchmarkComparePlayground/UUID_Pass-8 2000000 880 ns/op 16 B/op 1 allocs/op
BenchmarkComparePlayground/UUID_Fail-8 1000000 1168 ns/op 224 B/op 5 allocs/op
BenchmarkComparePlayground/Hex_Pass-8 2000000 621 ns/op 0 B/op 0 allocs/op
BenchmarkComparePlayground/Hex_Fail-8 2000000 850 ns/op 208 B/op 4 allocs/op
BenchmarkComparePlayground/ContainsAny_Pass-8 10000000 170 ns/op 0 B/op 0 allocs/op
BenchmarkComparePlayground/ContainsAny_Fail-8 3000000 412 ns/op 224 B/op 4 allocs/op
BenchmarkComparePlayground/TestStrings_Pass-8 3000000 425 ns/op 16 B/op 1 allocs/op
BenchmarkComparePlayground/TestStrings_Fail-8 1000000 1240 ns/op 816 B/op 13 allocs/op
--- SKIP: BenchmarkComparePlayground/TestMap_Pass
--- SKIP: BenchmarkComparePlayground/TestMap_Fail
BenchmarkComparePlayground/TestDive_Pass-8 5000000 324 ns/op 32 B/op 2 allocs/op
BenchmarkComparePlayground/TestDive_Fail-8 3000000 568 ns/op 272 B/op 7 allocs/op
BenchmarkComparePlayground/TestDive_Nil-8 5000000 321 ns/op 208 B/op 4 allocs/op
BenchmarkComparePlayground/TestAll_Pass-8 500000 3886 ns/op 408 B/op 11 allocs/op
BenchmarkComparePlayground/TestAll_Fail-8 300000 5855 ns/op 4209 B/op 51 allocs/op
BenchmarkComparePlayground/TestDive_Pass-8 5000000 327 ns/op 32 B/op 2 allocs/op
BenchmarkComparePlayground/TestDive_Fail-8 3000000 591 ns/op 272 B/op 7 allocs/op
BenchmarkComparePlayground/TestDive_Nil-8 5000000 338 ns/op 208 B/op 4 allocs/op
BenchmarkComparePlayground/TestAll_Pass-8 500000 4019 ns/op 408 B/op 11 allocs/op
BenchmarkComparePlayground/TestAll_Fail-8 200000 6275 ns/op 4209 B/op 51 allocs/op
PASS
ok github.com/abice/gencheck/internal/benchmark 24.440s
ok github.com/abice/gencheck/internal/benchmark 24.609s
```
44 changes: 22 additions & 22 deletions generator/assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5bc13a7

Please sign in to comment.