From cb055ba5aa9422fe4188819726a13cc076bb7cd4 Mon Sep 17 00:00:00 2001 From: Victor Payno Date: Sun, 3 Sep 2023 16:32:48 -0700 Subject: [PATCH 1/9] ci(go): bump golang version to 1.21 --- .github/workflows/go.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 957b6b51..e82f8c5b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -53,13 +53,13 @@ jobs: name: Go Checks strategy: matrix: - go-version: ["1.19"] + go-version: ["1.21"] os: ["ubuntu-latest", "windows-latest", "macos-latest"] exclude: - os: "macos-latest" - go-version: "1.19" + go-version: "1.21" - os: "windows-latest" - go-version: "1.19" + go-version: "1.21" runs-on: "${{ matrix.os }}" needs: [stage1] if: needs.stage1.outputs.docs_changed == 'True' From 364abccca31241ea65c2e09035cdfc774232abcc Mon Sep 17 00:00:00 2001 From: Victor Payno Date: Wed, 6 Sep 2023 20:06:14 -0700 Subject: [PATCH 2/9] go/census: lint clean up --- go/census/benchstat-new.txt | 2 +- go/census/benchstat-old.txt | 2 + go/census/census-doc.md | 65 ++++- go/census/census_examples_test.go | 4 +- go/census/coverage-annotations.txt | 0 go/census/coverage.out | 4 +- go/census/run-tests-go.txt | 423 +++++++++++++++++++++++------ 7 files changed, 402 insertions(+), 98 deletions(-) create mode 100644 go/census/benchstat-old.txt create mode 100644 go/census/coverage-annotations.txt diff --git a/go/census/benchstat-new.txt b/go/census/benchstat-new.txt index 08e5fddd..2ede99d9 100644 --- a/go/census/benchstat-new.txt +++ b/go/census/benchstat-new.txt @@ -1,2 +1,2 @@ PASS -ok census 0.033s +ok census 0.002s diff --git a/go/census/benchstat-old.txt b/go/census/benchstat-old.txt new file mode 100644 index 00000000..08e5fddd --- /dev/null +++ b/go/census/benchstat-old.txt @@ -0,0 +1,2 @@ +PASS +ok census 0.033s diff --git a/go/census/census-doc.md b/go/census/census-doc.md index 95ee138a..ff7e5da2 100755 --- a/go/census/census-doc.md +++ b/go/census/census-doc.md @@ -6,7 +6,7 @@ import "census" ``` -Package census simulates a system used to collect census data\. +Package census simulates a system used to collect census data. ## Index @@ -23,7 +23,7 @@ Package census simulates a system used to collect census data\. func Count(residents []*Resident) int ``` -Count counts all residents that have provided the required information\. +Count counts all residents that have provided the required information.
Example

@@ -60,7 +60,7 @@ Count counts all residents that have provided the required information\. ## type [Resident]() -Resident represents a resident in this city\. +Resident represents a resident in this city. ```go type Resident struct { @@ -76,7 +76,7 @@ type Resident struct { func NewResident(name string, age int, address map[string]string) *Resident ``` -NewResident registers a new resident in this city\. +NewResident registers a new resident in this city.

Example

@@ -107,7 +107,35 @@ NewResident registers a new resident in this city\. func (r *Resident) Delete() ``` -Delete deletes a resident's information\. +Delete deletes a resident's information. + +

Example +

+ +```go +{ + name := "Matthew Sanabria" + age := 29 + address := map[string]string{"street": "Main St."} + + resident := NewResident(name, age, address) + + fmt.Printf("%#v\n", resident) + resident.Delete() + fmt.Printf("%#v\n", resident) + +} +``` + +#### Output + +``` +&census.Resident{Name:"Matthew Sanabria", Age:29, Address:map[string]string{"street":"Main St."}} +&census.Resident{Name:"", Age:0, Address:map[string]string(nil)} +``` + +

+
### func \(\*Resident\) [HasRequiredInfo]() @@ -115,7 +143,32 @@ Delete deletes a resident's information\. func (r *Resident) HasRequiredInfo() bool ``` -HasRequiredInfo determines if a given resident has all of the required information\. +HasRequiredInfo determines if a given resident has all of the required information. + +
Example +

+ +```go +{ + name := "Matthew Sanabria" + age := 0 + address := make(map[string]string) + + resident := NewResident(name, age, address) + + fmt.Println(resident.HasRequiredInfo()) + +} +``` + +#### Output + +``` +false +``` + +

+
diff --git a/go/census/census_examples_test.go b/go/census/census_examples_test.go index 7a241225..4be61ceb 100644 --- a/go/census/census_examples_test.go +++ b/go/census/census_examples_test.go @@ -14,7 +14,7 @@ func ExampleNewResident() { // &{Matthew Sanabria 29 map[street:Main St.]} } -func ExampleHasRequiredInfo() { +func ExampleResident_HasRequiredInfo() { name := "Matthew Sanabria" age := 0 address := make(map[string]string) @@ -26,7 +26,7 @@ func ExampleHasRequiredInfo() { // false } -func ExampleDelete() { +func ExampleResident_Delete() { name := "Matthew Sanabria" age := 29 address := map[string]string{"street": "Main St."} diff --git a/go/census/coverage-annotations.txt b/go/census/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/census/coverage.out b/go/census/coverage.out index 459ae312..b26aa438 100644 --- a/go/census/coverage.out +++ b/go/census/coverage.out @@ -1,12 +1,12 @@ mode: count census/census.go:12.77,20.2 1 7 census/census.go:23.43,30.18 3 18 -census/census.go:36.2,36.15 1 18 census/census.go:30.18,32.3 1 6 census/census.go:32.8,32.39 1 12 census/census.go:32.39,34.3 1 7 +census/census.go:36.2,36.15 1 18 census/census.go:40.29,44.2 1 4 census/census.go:47.39,50.37 2 4 -census/census.go:56.2,56.16 1 4 census/census.go:50.37,51.33 1 9 census/census.go:51.33,53.4 1 3 +census/census.go:56.2,56.16 1 4 diff --git a/go/census/run-tests-go.txt b/go/census/run-tests-go.txt index b20ad228..2bf96285 100644 --- a/go/census/run-tests-go.txt +++ b/go/census/run-tests-go.txt @@ -5,15 +5,242 @@ Go packages: census =============================================================================== -golint census +golangci-lint run --enable-all ./... +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +census_test.go:43: Function 'TestHasRequiredInfo' is too long (92 > 60) (funlen) +func TestHasRequiredInfo(t *testing.T) { +census_test.go:185: Function 'TestCount' is too long (72 > 60) (funlen) +func TestCount(t *testing.T) { +census_examples_test.go:8:10: string `Matthew Sanabria` has 4 occurrences, make it a constant (goconst) + name := "Matthew Sanabria" + ^ +census_test.go:32: File is not `gofumpt`-ed (gofumpt) + +census_test.go:130: File is not `gofumpt`-ed (gofumpt) + +census_test.go:174: File is not `gofumpt`-ed (gofumpt) + +census.go:24:13: var-declaration: should omit type bool from declaration of var result; it will be inferred from the right-hand side (revive) + var result bool = true + ^ +census_test.go:33:28: Using the variable on range scope `test` in function literal (scopelint) + resident := NewResident(test.resident.Name, test.resident.Age, test.resident.Address) + ^ +census_test.go:35:36: Using the variable on range scope `test` in function literal (scopelint) + if !reflect.DeepEqual(resident, test.resident) { + ^ +census_test.go:36:57: Using the variable on range scope `test` in function literal (scopelint) + t.Errorf("NewResident() = %#v, want %#v", resident, test.resident) + ^ +census_test.go:31: unnecessary leading newline (whitespace) + t.Run(test.name, func(t *testing.T) { + +census_test.go:129: unnecessary leading newline (whitespace) + t.Run(test.name, func(t *testing.T) { + +census_test.go:173: unnecessary leading newline (whitespace) + t.Run(test.name, func(t *testing.T) { + +census.go:12:77: block should not start with a whitespace (wsl) +func NewResident(name string, age int, address map[string]string) *Resident { + ^ +census.go:40:29: block should not start with a whitespace (wsl) +func (r *Resident) Delete() { + ^ +census.go:43:7: Name, Age, Address are missing in Resident (exhaustivestruct) + *r = Resident{} + ^ +census_test.go:16:15: Name, Age, Address are missing in Resident (exhaustivestruct) + resident: &Resident{}, + ^ +census_test.go:51:15: Name, Age, Address are missing in Resident (exhaustivestruct) + resident: &Resident{}, + ^ +census_test.go:118:15: Age is missing in Resident (exhaustivestruct) + resident: &Resident{ + ^ +census_examples_test.go:17:6: ExampleResident_HasRequiredInfo contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleResident_HasRequiredInfo() { + ^ +census_examples_test.go:29:6: ExampleResident_Delete contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleResident_Delete() { + ^ +census_test.go:9:1: Function TestNewResident missing the call to method parallel (paralleltest) +func TestNewResident(t *testing.T) { +^ +census_test.go:30:2: Range statement for test TestNewResident missing the call to method parallel in test Run (paralleltest) + for _, test := range tests { + ^ +census_test.go:128:2: Range statement for test TestHasRequiredInfo missing the call to method parallel in test Run (paralleltest) + for _, test := range tests { + ^ +census_test.go:139:1: Function TestDelete missing the call to method parallel (paralleltest) +func TestDelete(t *testing.T) { +^ +census_test.go:172:2: Range statement for test TestDelete missing the call to method parallel in test Run (paralleltest) + for _, test := range tests { + ^ +census_test.go:250:2: Range statement for test TestCount missing the call to method parallel in test Run (paralleltest) + for _, test := range tests { + ^ +census_examples_test.go:1:9: package should be `census_test` instead of `census` (testpackage) +package census + ^ +census_test.go:2:9: package should be `census_test` instead of `census` (testpackage) +package census + ^ + +real 0m1.544s +user 0m3.426s +sys 0m0.560s -real 0m0.179s -user 0m0.131s -sys 0m0.117s +=============================================================================== + +golint ./... + +real 0m0.027s +user 0m0.003s +sys 0m0.006s + +=============================================================================== + +revive -formatter=stylish ./... +census.go + (24, 13) https://revive.run/r#var-declaration should omit type bool from declaration of var result; it will be inferred from the right-hand side + + + ✖ 1 problem (0 errors) (1 warnings) + +real 0m0.099s +user 0m0.037s +sys 0m0.053s + +=============================================================================== + +ineffassign ./... + +real 0m0.109s +user 0m0.140s +sys 0m0.104s + +=============================================================================== + +go-consistent -v ./... + info: check "./." +internal error: package "fmt" without types was imported from "census [census.test]" + +real 0m0.108s +user 0m0.153s +sys 0m0.130s + +=============================================================================== + +staticcheck ./... + +real 0m1.273s +user 0m3.803s +sys 0m0.380s + +=============================================================================== + +gocritic check -enableAll ./... +panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt + +goroutine 1 [running]: +main.main() + /home/vpayno/go/pkg/mod/github.com/go-critic/go-critic@v0.6.7/cmd/gocritic/main.go:13 +0x52 + +real 0m0.064s +user 0m0.017s +sys 0m0.036s + +=============================================================================== + +go vet ./... + +real 0m0.102s +user 0m0.150s +sys 0m0.143s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out census +go fix ./... + +real 0m0.015s +user 0m0.004s +sys 0m0.014s + +=============================================================================== + +errcheck ./... + +real 0m0.470s +user 0m1.235s +sys 0m0.267s + +=============================================================================== + +gocyclo . +5 census TestDelete census_test.go:139:1 +4 census (*Resident).HasRequiredInfo census.go:23:1 +3 census TestCount census_test.go:185:1 +3 census TestHasRequiredInfo census_test.go:43:1 +3 census TestNewResident census_test.go:9:1 +3 census Count census.go:47:1 +1 census ExampleCount census_examples_test.go:44:1 +1 census ExampleResident_Delete census_examples_test.go:29:1 +1 census ExampleResident_HasRequiredInfo census_examples_test.go:17:1 +1 census ExampleNewResident census_examples_test.go:7:1 +1 census (*Resident).Delete census.go:40:1 +1 census NewResident census.go:12:1 + +real 0m0.022s +user 0m0.001s +sys 0m0.005s + +=============================================================================== + +misspell . + +real 0m0.033s +user 0m0.027s +sys 0m0.019s + +=============================================================================== + +gosec ./... +[gosec] 2023/09/03 17:20:25 Including rules: default +[gosec] 2023/09/03 17:20:25 Excluding rules: default +[gosec] 2023/09/03 17:20:25 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/census +[gosec] 2023/09/03 17:20:25 Checking package: census +[gosec] 2023/09/03 17:20:25 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/census/census.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 57 + Nosec : 0 + Issues : 0 + + +real 0m0.085s +user 0m0.066s +sys 0m0.039s + +=============================================================================== + +gotest -v -covermode=count -coverprofile coverage.out ./... === RUN TestNewResident === RUN TestNewResident/no_data_collected === RUN TestNewResident/all_data_collected @@ -56,19 +283,19 @@ go test -v -covermode=count -coverprofile coverage.out census --- PASS: TestCount/some_data_collected (0.00s) === RUN ExampleNewResident --- PASS: ExampleNewResident (0.00s) -=== RUN ExampleHasRequiredInfo ---- PASS: ExampleHasRequiredInfo (0.00s) -=== RUN ExampleDelete ---- PASS: ExampleDelete (0.00s) +=== RUN ExampleResident_HasRequiredInfo +--- PASS: ExampleResident_HasRequiredInfo (0.00s) +=== RUN ExampleResident_Delete +--- PASS: ExampleResident_Delete (0.00s) === RUN ExampleCount --- PASS: ExampleCount (0.00s) PASS coverage: 100.0% of statements -ok census 0.009s coverage: 100.0% of statements +ok census 0.002s coverage: 100.0% of statements -real 0m1.295s -user 0m1.978s -sys 0m0.938s +real 0m0.276s +user 0m0.676s +sys 0m0.279s =============================================================================== @@ -79,21 +306,29 @@ census/census.go:40: Delete 100.0% census/census.go:47: Count 100.0% total: (statements) 100.0% -real 0m0.144s -user 0m0.119s -sys 0m0.106s +real 0m0.019s +user 0m0.008s +sys 0m0.016s =============================================================================== go tool cover -html coverage.out -o coverage.html -real 0m0.127s -user 0m0.074s -sys 0m0.144s +real 0m0.022s +user 0m0.012s +sys 0m0.015s =============================================================================== -go test -v -race -covermode=atomic census +gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.069s +user 0m0.006s +sys 0m0.023s + +=============================================================================== + +gotest -v -race -covermode=atomic ./... === RUN TestNewResident === RUN TestNewResident/no_data_collected === RUN TestNewResident/all_data_collected @@ -109,7 +344,7 @@ go test -v -race -covermode=atomic census === RUN TestHasRequiredInfo/missing_street === RUN TestHasRequiredInfo/age_is_optional === RUN TestHasRequiredInfo/unknown_key_with_value_that_is_not_empty ---- PASS: TestHasRequiredInfo (0.02s) +--- PASS: TestHasRequiredInfo (0.00s) --- PASS: TestHasRequiredInfo/no_data_collected (0.00s) --- PASS: TestHasRequiredInfo/all_data_collected (0.00s) --- PASS: TestHasRequiredInfo/missing_name (0.00s) @@ -122,7 +357,7 @@ go test -v -race -covermode=atomic census === RUN TestDelete/no_data_collected === RUN TestDelete/all_data_collected === RUN TestDelete/some_data_collected ---- PASS: TestDelete (0.01s) +--- PASS: TestDelete (0.00s) --- PASS: TestDelete/no_data_collected (0.00s) --- PASS: TestDelete/all_data_collected (0.00s) --- PASS: TestDelete/some_data_collected (0.00s) @@ -136,92 +371,106 @@ go test -v -race -covermode=atomic census --- PASS: TestCount/some_data_collected (0.00s) === RUN ExampleNewResident --- PASS: ExampleNewResident (0.00s) -=== RUN ExampleHasRequiredInfo ---- PASS: ExampleHasRequiredInfo (0.00s) -=== RUN ExampleDelete ---- PASS: ExampleDelete (0.00s) +=== RUN ExampleResident_HasRequiredInfo +--- PASS: ExampleResident_HasRequiredInfo (0.00s) +=== RUN ExampleResident_Delete +--- PASS: ExampleResident_Delete (0.00s) === RUN ExampleCount --- PASS: ExampleCount (0.00s) PASS coverage: 100.0% of statements -ok census 0.175s coverage: 100.0% of statements +ok census 1.015s coverage: 100.0% of statements -real 0m1.539s -user 0m1.942s -sys 0m1.033s +real 0m6.179s +user 0m13.133s +sys 0m1.732s =============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -PASS -ok census 0.033s +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -real 0m0.898s -user 0m1.114s -sys 0m0.716s - -=============================================================================== - -go test -tags bonus +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt PASS -ok census 0.006s - -real 0m0.976s -user 0m1.252s -sys 0m0.733s +ok census 0.002s -=============================================================================== - -No old benchmarks to run benchstat against. +real 0m0.134s +user 0m0.192s +sys 0m0.138s =============================================================================== -go vet census -# census -./census_examples_test.go:17:1: ExampleHasRequiredInfo refers to unknown identifier: HasRequiredInfo -./census_examples_test.go:29:1: ExampleDelete refers to unknown identifier: Delete - -real 0m0.574s -user 0m0.775s -sys 0m0.617s - -=============================================================================== - -go fix census +gotest -v -tags bonus +=== RUN TestNewResident +=== RUN TestNewResident/no_data_collected +=== RUN TestNewResident/all_data_collected +--- PASS: TestNewResident (0.00s) + --- PASS: TestNewResident/no_data_collected (0.00s) + --- PASS: TestNewResident/all_data_collected (0.00s) +=== RUN TestHasRequiredInfo +=== RUN TestHasRequiredInfo/no_data_collected +=== RUN TestHasRequiredInfo/all_data_collected +=== RUN TestHasRequiredInfo/missing_name +=== RUN TestHasRequiredInfo/nil_map_as_address +=== RUN TestHasRequiredInfo/empty_map_as_address +=== RUN TestHasRequiredInfo/missing_street +=== RUN TestHasRequiredInfo/age_is_optional +=== RUN TestHasRequiredInfo/unknown_key_with_value_that_is_not_empty +--- PASS: TestHasRequiredInfo (0.00s) + --- PASS: TestHasRequiredInfo/no_data_collected (0.00s) + --- PASS: TestHasRequiredInfo/all_data_collected (0.00s) + --- PASS: TestHasRequiredInfo/missing_name (0.00s) + --- PASS: TestHasRequiredInfo/nil_map_as_address (0.00s) + --- PASS: TestHasRequiredInfo/empty_map_as_address (0.00s) + --- PASS: TestHasRequiredInfo/missing_street (0.00s) + --- PASS: TestHasRequiredInfo/age_is_optional (0.00s) + --- PASS: TestHasRequiredInfo/unknown_key_with_value_that_is_not_empty (0.00s) +=== RUN TestDelete +=== RUN TestDelete/no_data_collected +=== RUN TestDelete/all_data_collected +=== RUN TestDelete/some_data_collected +--- PASS: TestDelete (0.00s) + --- PASS: TestDelete/no_data_collected (0.00s) + --- PASS: TestDelete/all_data_collected (0.00s) + --- PASS: TestDelete/some_data_collected (0.00s) +=== RUN TestCount +=== RUN TestCount/no_data_collected +=== RUN TestCount/all_data_collected +=== RUN TestCount/some_data_collected +--- PASS: TestCount (0.00s) + --- PASS: TestCount/no_data_collected (0.00s) + --- PASS: TestCount/all_data_collected (0.00s) + --- PASS: TestCount/some_data_collected (0.00s) +=== RUN ExampleNewResident +--- PASS: ExampleNewResident (0.00s) +=== RUN ExampleResident_HasRequiredInfo +--- PASS: ExampleResident_HasRequiredInfo (0.00s) +=== RUN ExampleResident_Delete +--- PASS: ExampleResident_Delete (0.00s) +=== RUN ExampleCount +--- PASS: ExampleCount (0.00s) +PASS +ok census 0.002s -real 0m0.083s -user 0m0.041s -sys 0m0.075s +real 0m0.113s +user 0m0.159s +sys 0m0.117s =============================================================================== -gosec ./census -[gosec] 2022/07/28 07:57:45 Including rules: default -[gosec] 2022/07/28 07:57:45 Excluding rules: default -[gosec] 2022/07/28 07:57:45 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/census -[gosec] 2022/07/28 07:57:45 Checking package: census -[gosec] 2022/07/28 07:57:45 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/census/census.go -Results: - - -Summary: - Files: 1 - Lines: 57 - Nosec: 0 - Issues: 0 - +benchstat benchstat-old.txt benchstat-new.txt -real 0m0.471s -user 0m0.627s -sys 0m0.330s +real 0m0.018s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output census-doc.md -real 0m0.037s -user 0m0.031s -sys 0m0.018s +real 0m0.042s +user 0m0.011s +sys 0m0.009s =============================================================================== @@ -256,9 +505,9 @@ func (r *Resident) HasRequiredInfo() bool information. -real 0m0.302s -user 0m0.163s -sys 0m0.265s +real 0m0.033s +user 0m0.018s +sys 0m0.024s =============================================================================== From 9114a929d18edd601dc4088fb44c62f6f9c76937 Mon Sep 17 00:00:00 2001 From: Victor Payno Date: Wed, 6 Sep 2023 20:38:34 -0700 Subject: [PATCH 3/9] ci(docker-build): add more rust packages to image --- .github/docker/layer-15.00-exercism-rust.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/docker/layer-15.00-exercism-rust.sh b/.github/docker/layer-15.00-exercism-rust.sh index 963f9438..95dc9a68 100755 --- a/.github/docker/layer-15.00-exercism-rust.sh +++ b/.github/docker/layer-15.00-exercism-rust.sh @@ -44,7 +44,11 @@ main() { cargo-kcov cargo-llvm-cov cargo-tarpaulin + clippy-sarif grcov + sarif-fmt + spellcheck + strip-ansi-cli zellij ) From 57016bff13caae07be7260be82413ea998e7e32b Mon Sep 17 00:00:00 2001 From: Victor Payno Date: Wed, 6 Sep 2023 20:39:02 -0700 Subject: [PATCH 4/9] ci(docker-build): shellcheck lint update --- .github/docker/layer-15.00-exercism-rust.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/docker/layer-15.00-exercism-rust.sh b/.github/docker/layer-15.00-exercism-rust.sh index 95dc9a68..b6282d9b 100755 --- a/.github/docker/layer-15.00-exercism-rust.sh +++ b/.github/docker/layer-15.00-exercism-rust.sh @@ -69,6 +69,7 @@ main() { # ENV PATH="/root/.cargo/bin:${PATH}" printf "source %s\n" "${HOME}/.cargo/env" | tee -a "${HOME}/.bashrc" + # shellcheck disable=SC1091 source "${HOME}/.bashrc" echo Running: rustup default stable From b132cd4047d74db4bfe280e08a50d51feef2b220 Mon Sep 17 00:00:00 2001 From: Victor Payno Date: Wed, 6 Sep 2023 21:56:51 -0700 Subject: [PATCH 5/9] ci(docker-build): update rust layer --- .github/docker/layer-15.00-exercism-rust.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/docker/layer-15.00-exercism-rust.sh b/.github/docker/layer-15.00-exercism-rust.sh index b6282d9b..2331b63a 100755 --- a/.github/docker/layer-15.00-exercism-rust.sh +++ b/.github/docker/layer-15.00-exercism-rust.sh @@ -67,11 +67,17 @@ main() { time curl https://sh.rustup.rs -sSf | bash -s -- -y || exit printf "\n" - # ENV PATH="/root/.cargo/bin:${PATH}" - printf "source %s\n" "${HOME}/.cargo/env" | tee -a "${HOME}/.bashrc" + cat >>~/.bashrc <<-EOF + export PATH="${PATH}:${HOME}/.cargo/bin" + EOF + # shellcheck disable=SC1091 source "${HOME}/.bashrc" + echo Running: rustup install stable + time rustup install stable || exit + printf "\n" + echo Running: rustup default stable time rustup default stable || exit printf "\n" @@ -132,4 +138,4 @@ main() { layer_end "${0}" "$@" } -main "${@}" |& tee /root/layer-15.00-exercism-rust.log +time main "${@}" |& tee /root/layer-15.00-exercism-rust.log From caa26d3c01f06f2596fea4fa8800a18f12becede Mon Sep 17 00:00:00 2001 From: Victor Payno Date: Wed, 6 Sep 2023 21:59:38 -0700 Subject: [PATCH 6/9] ci(docker-build): add golang layer --- .github/docker/layer-16.00-exercism-go.sh | 234 ++++++++++++++++++++++ Dockerfile | 2 + 2 files changed, 236 insertions(+) create mode 100755 .github/docker/layer-16.00-exercism-go.sh diff --git a/.github/docker/layer-16.00-exercism-go.sh b/.github/docker/layer-16.00-exercism-go.sh new file mode 100755 index 00000000..7b7de779 --- /dev/null +++ b/.github/docker/layer-16.00-exercism-go.sh @@ -0,0 +1,234 @@ +#!/bin/bash +# +# .github/docker/layer-16.00-exercism-go.sh +# + +set -o pipefail + +# https://apt.llvm.org/ + +# this path from for the container +# shellcheck disable=SC1091 +. /.github/docker/include + +golang_show_dl_urls() { + curl -sS https://go.dev/dl/ | grep 'class="download"' | sed -r -e 's/^.*href="(.*)">.*$/https:\/\/go.dev\1/' | sort -V +} # golang_show_dl_urls() + +golang_show_dl_versions() { + golang_show_dl_urls | sed -r -e 's:^.*/go(.*)[.](zip|msi|tar.gz|pkg)$:\1:' | grep '[..]src$' | sed -r -e 's:[.]src::g' | grep -v -E '(beta|rc)' | sort -V +} # golang_show_dl_versions() + +golang_install_latest() { + local version + + version="$(golang_show_dl_versions | tail -n 1)" + + # was `go get golang.org/dl/gox.y.z` + echo Running: go install golang.org/dl/go"${version}"@latest + time go install golang.org/dl/go"${version}"@latest + printf "\n" + + echo Running: go"${version}" download + time go"${version}" download + printf "\n" + + echo Checking Installed Go Version + go version + printf "\n" +} # golang_install_latest() + +golang_first_install() { + local GOARCH + local GOVER + + if [[ ${HOSTTYPE} == x86_64 ]]; then + GOARCH="amd64" + elif [[ ${HOSTTYPE} == i686 ]]; then + GOARCH="i386" + elif [[ ${HOSTTYPE} == aarch64 ]]; then + GOARCH="arm64" + fi + + GOVER="$(golang_show_dl_versions | tail -n 1)" + + if go version >&/dev/null; then + printf "%s is already installed\n" "$(go version)" + printf "Use golang_install_latest to update go.\n" + return 1 + fi + + printf "Installing Go version %s...\n\n" "${GOVER}" + + echo mkdir -v ~/.golang + [[ -d ~/.golang ]] || mkdir -v ~/.golang + + echo curl -sS https://go.dev/dl/go"${GOVER}".linux-"${GOARCH}".tar.gz '|' tar -C ~/.golang/ -xzf - + time curl -sS https://dl.google.com/go/go"${GOVER}".linux-"${GOARCH}".tar.gz | tar -C ~/.golang/ -xzf - || return 1 + printf "\n" + + echo source "${HOME}"/.bashrc + # shellcheck disable=SC1091 + source "${HOME}"/.bashrc + + PATH_OLD="${PATH}" + PATH="${HOME}/.golang/go/bin:${PATH}" + + echo go version + go version + printf "\n" + + echo golang_install_latest + time golang_install_latest + printf "\n" + + PATH="${PATH_OLD}" +} # golang_first_install() + +main() { + layer_begin "${0}" "$@" + + declare -i retval=0 + + declare -a PACKAGES + PACKAGES=( + ) + + declare -a CRATES + CRATES=( + github.com/appliedgocode/goman@latest + github.com/client9/misspell/cmd/misspell@latest + github.com/fzipp/gocyclo/cmd/gocyclo@latest + github.com/get-woke/woke@latest + github.com/go-critic/go-critic/cmd/gocritic@latest + github.com/google/yamlfmt/cmd/yamlfmt@latest + github.com/gordonklaus/ineffassign@latest + github.com/goreleaser/goreleaser@latest + github.com/govim/govim/cmd/govim@latest + github.com/k1LoW/octocov@latest + github.com/mgechev/revive@latest + github.com/pelletier/go-toml/v2/cmd/jsontoml@latest + github.com/pelletier/go-toml/v2/cmd/tomljson@latest + github.com/pelletier/go-toml/v2/cmd/tomll@latest + github.com/quasilyte/go-consistent@latest + github.com/rakyll/gotest@latest + github.com/reviewdog/reviewdog/cmd/reviewdog@latest + github.com/rhysd/actionlint/cmd/actionlint@latest + github.com/securego/gosec/v2/cmd/gosec@latest + github.com/segmentio/golines@latest + golang.org/x/lint/golint@latest + golang.org/x/perf/cmd/benchstat@latest + golang.org/x/tools/cmd/cover@latest + golang.org/x/vuln/cmd/govulncheck@latest + honnef.co/go/tools/cmd/staticcheck@latest + mvdan.cc/gofumpt@latest + mvdan.cc/sh/v3/cmd/shfmt@latest + ) + + declare -a GO_X_TOOLS + GO_X_TOOLS=( + auth/authtest + auth/cookieauth + auth/gitauth + auth/netrcauth + benchcmp + bisect + bundle + callgraph + compilebench + digraph + eg + file2fuzz + fiximports + getgo + go-contrib-init + godex + godoc + goimports + gomvpkg + gonew + gorename + gotype + goyacc + guru + html2article + present + present2md + signature-fuzzer/fuzz-runner + signature-fuzzer/fuzz-driver + splitdwarf + ssadump + stress + stringer + toolstash + ) + + echo Running: apt install -y "${PACKAGES[@]}" + time apt install -y "${PACKAGES[@]}" || exit + printf "\n" + + cat >>"${HOME:-/root}/.bashrc" <<-EOF + # go setup + declare -x GOPATH + declare -x GOBIN + declare -x GOSRC + declare -x PATH + + GOPATH="/root/go" + GOBIN="/root/go/bin" + GOSRC="/root/go/src" + PATH="${PATH}:/root/.golang/go/bin:/root/go/bin" + + export GOPATH GOBIN GOSRC PATH + + if [[ ${HOSTTYPE} == x86_64 ]]; then + export GOARCH="amd64" + elif [[ ${HOSTTYPE} == i686 ]]; then + export GOARCH="i386" + elif [[ ${HOSTTYPE} == aarch64 ]]; then + export GOARCH="arm64" + fi + EOF + + echo Running: golang_first_install + time golang_first_install || exit + printf "\n" + + # shellcheck disable=SC1091 + source "${HOME}/.bashrc" + + # shellcheck disable=SC1091 + source "${HOME}/.bashrc" + printf "PATH=%s\n" "${PATH}" + printf "GOPATH=%s\n" "${GOPATH}" + printf "GOBIN=%s\n" "${GOBIN}" + printf "GOSRC=%s\n" "${GOSRC}" + printf "\n" + + echo Running: go version + go version || exit + printf "\n" + + for go_x_tool in "${GO_X_TOOLS[@]}"; do + echo Running: go install golang.org/x/tools/cmd/"${go_x_tool}"@latest + time go install golang.org/x/tools/cmd/"${go_x_tool}"@latest || ((retval++)) + printf "\n" + done + + for go_crate in "${CRATES[@]}"; do + echo Running: go install "${go_crate}" + time go install "${go_crate}" || ((retval++)) + printf "\n" + done + + echo Running: go install -tags extended github.com/gohugoio/hugo@latest + time go install -tags extended github.com/gohugoio/hugo@latest || ((retval++)) + printf "\n" + + layer_end "${0}" "$@" + + echo exit "${retval}" + exit "${retval}" +} + +time main "${@}" |& tee /root/layer-16.00-exercism-go.log diff --git a/Dockerfile b/Dockerfile index 48b6b239..3f68edd7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,8 @@ RUN .github/docker/layer-10.00-exercism-gcc_clang_llvm.sh ci-generic-debian RUN .github/docker/layer-15.00-exercism-rust.sh ci-generic-debian +RUN .github/docker/layer-16.00-exercism-go.sh ci-generic-debian + RUN .github/docker/layer-99.00-summary.sh ci-generic-debian # Copies your code file from your action repository to the filesystem path `/` of the container From 83652935843edd241f8d4b2764fd863e9c7fa3f2 Mon Sep 17 00:00:00 2001 From: Victor Payno Date: Wed, 6 Sep 2023 22:47:57 -0700 Subject: [PATCH 7/9] go: add wrapper scripts --- .github/citools/go/go-fixer-go_fix | 36 +++++++++++ .github/citools/go/go-lint-errcheck | 30 +++++++++ .github/citools/go/go-lint-go-consistent | 36 +++++++++++ .github/citools/go/go-lint-go_vet | 36 +++++++++++ .github/citools/go/go-lint-gocritic | 38 +++++++++++ .github/citools/go/go-lint-gocyclo | 38 +++++++++++ .github/citools/go/go-lint-golangci-lint | 38 +++++++++++ .github/citools/go/go-lint-gosec | 38 +++++++++++ .github/citools/go/go-lint-ineffassign | 38 +++++++++++ .github/citools/go/go-lint-misspell | 34 ++++++++++ .github/citools/go/go-lint-revive | 38 +++++++++++ .github/citools/go/go-lint-staticcheck | 38 +++++++++++ .github/citools/go/go-setup-config | 24 +++++++ .github/citools/go/go-setup-verify | 44 +++++++++++++ .github/citools/go/go-test-cover | 34 ++++++++++ .github/citools/go/go-test-cover-report | 55 ++++++++++++++++ .github/citools/includes/wrapper-library | 30 +++++++++ go/run-tests | 80 ++++++++---------------- 18 files changed, 651 insertions(+), 54 deletions(-) create mode 100755 .github/citools/go/go-fixer-go_fix create mode 100755 .github/citools/go/go-lint-errcheck create mode 100755 .github/citools/go/go-lint-go-consistent create mode 100755 .github/citools/go/go-lint-go_vet create mode 100755 .github/citools/go/go-lint-gocritic create mode 100755 .github/citools/go/go-lint-gocyclo create mode 100755 .github/citools/go/go-lint-golangci-lint create mode 100755 .github/citools/go/go-lint-gosec create mode 100755 .github/citools/go/go-lint-ineffassign create mode 100755 .github/citools/go/go-lint-misspell create mode 100755 .github/citools/go/go-lint-revive create mode 100755 .github/citools/go/go-lint-staticcheck create mode 100755 .github/citools/go/go-setup-config create mode 100755 .github/citools/go/go-setup-verify create mode 100755 .github/citools/go/go-test-cover create mode 100755 .github/citools/go/go-test-cover-report diff --git a/.github/citools/go/go-fixer-go_fix b/.github/citools/go/go-fixer-go_fix new file mode 100755 index 00000000..97798da4 --- /dev/null +++ b/.github/citools/go/go-fixer-go_fix @@ -0,0 +1,36 @@ +#!/bin/bash +# +# .github/citools/go/go-fixer-go_fix +# + +# shellcheck disable=SC1091 +source ../../.github/citools/includes/wrapper-library || exit + +declare -i retval=0 + +declare -a args +args=("${@}") +if [[ ${#args[@]} -eq 0 ]]; then + args=() +fi + +main() { + printf "\nRunning go fix\n\n" + + show_tool_versions_go + + print_ruler + + run_command go clean ./... + + print_ruler + + run_command go fix "${args[@]}" ./... + + print_ruler + + echo Exit code: "${retval}" + return "${retval}" +} + +time main "${@}" diff --git a/.github/citools/go/go-lint-errcheck b/.github/citools/go/go-lint-errcheck new file mode 100755 index 00000000..112e257f --- /dev/null +++ b/.github/citools/go/go-lint-errcheck @@ -0,0 +1,30 @@ +#!/bin/bash +# +# .github/citools/go/go-lint-errcheck +# + +# shellcheck disable=SC1091 +source ../../.github/citools/includes/wrapper-library || exit + +declare -i retval=0 + +main() { + printf "\nRunning Go errcheck\n\n" + + show_tool_versions_go + + print_ruler + + run_command go clean ./... + + print_ruler + + run_command errcheck "${@}" ./... + + print_ruler + + echo Exit code: "${retval}" + return "${retval}" +} + +time main "${@}" diff --git a/.github/citools/go/go-lint-go-consistent b/.github/citools/go/go-lint-go-consistent new file mode 100755 index 00000000..febf1ab2 --- /dev/null +++ b/.github/citools/go/go-lint-go-consistent @@ -0,0 +1,36 @@ +#!/bin/bash +# +# .github/citools/go/go-lint-go-consistent +# + +# shellcheck disable=SC1091 +source ../../.github/citools/includes/wrapper-library || exit + +declare -i retval=0 + +declare -a args +args=("${@}") +if [[ ${#args[@]} -eq 0 ]]; then + args=(-v) +fi + +main() { + printf "\nRunning Go go-consistent\n\n" + + show_tool_versions_go + + print_ruler + + run_command go clean ./... + + print_ruler + + run_command go-consistent "${args[@]}" ./... + + print_ruler + + echo Exit code: "${retval}" + return "${retval}" +} + +time main "${@}" diff --git a/.github/citools/go/go-lint-go_vet b/.github/citools/go/go-lint-go_vet new file mode 100755 index 00000000..1f5c74f0 --- /dev/null +++ b/.github/citools/go/go-lint-go_vet @@ -0,0 +1,36 @@ +#!/bin/bash +# +# .github/citools/go/go-lint-go_vet +# + +# shellcheck disable=SC1091 +source ../../.github/citools/includes/wrapper-library || exit + +declare -i retval=0 + +declare -a args +args=("${@}") +if [[ ${#args[@]} -eq 0 ]]; then + args=() +fi + +main() { + printf "\nRunning Go Vet\n\n" + + show_tool_versions_go + + print_ruler + + run_command go clean ./... + + print_ruler + + run_command go vet "${args[@]}" ./... + + print_ruler + + echo Exit code: "${retval}" + return "${retval}" +} + +time main "${@}" diff --git a/.github/citools/go/go-lint-gocritic b/.github/citools/go/go-lint-gocritic new file mode 100755 index 00000000..74743512 --- /dev/null +++ b/.github/citools/go/go-lint-gocritic @@ -0,0 +1,38 @@ +#!/bin/bash +# +# .github/citools/go/go-lint-gocritic +# + +# go install -v github.com/go-critic/go-critic/cmd/gocritic@latest + +# shellcheck disable=SC1091 +source ../../.github/citools/includes/wrapper-library || exit + +declare -i retval=0 + +declare -a args +args=("${@}") +if [[ ${#args[@]} -eq 0 ]]; then + args=(check -enableAll) +fi + +main() { + printf "\nRunning Go gocritic\n\n" + + show_tool_versions_go + + print_ruler + + run_command go clean ./... + + print_ruler + + run_command gocritic "${args[@]}" ./... + + print_ruler + + echo Exit code: "${retval}" + return "${retval}" +} + +time main "${@}" diff --git a/.github/citools/go/go-lint-gocyclo b/.github/citools/go/go-lint-gocyclo new file mode 100755 index 00000000..2443efe8 --- /dev/null +++ b/.github/citools/go/go-lint-gocyclo @@ -0,0 +1,38 @@ +#!/bin/bash +# +# .github/citools/go/go-lint-gocyclo +# + +# go install github.com/fzipp/gocyclo/cmd/gocyclo@latest + +# shellcheck disable=SC1091 +source ../../.github/citools/includes/wrapper-library || exit + +declare -i retval=0 + +declare -a args +args=("${@}") +if [[ ${#args[@]} -eq 0 ]]; then + args=() +fi + +main() { + printf "\nRunning Go gocyclo\n\n" + + show_tool_versions_go + + print_ruler + + run_command go clean ./... + + print_ruler + + run_command gocyclo "${args[@]}" . + + print_ruler + + echo Exit code: "${retval}" + return "${retval}" +} + +time main "${@}" diff --git a/.github/citools/go/go-lint-golangci-lint b/.github/citools/go/go-lint-golangci-lint new file mode 100755 index 00000000..451867f7 --- /dev/null +++ b/.github/citools/go/go-lint-golangci-lint @@ -0,0 +1,38 @@ +#!/bin/bash +# +# .github/citools/go/go-lint-golangci-lint +# + +# go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + +# shellcheck disable=SC1091 +source ../../.github/citools/includes/wrapper-library || exit + +declare -i retval=0 + +declare -a args +args=("${@}") +if [[ ${#args[@]} -eq 0 ]]; then + args=(run --enable-all) +fi + +main() { + printf "\nRunning GoLangCi-Lint\n\n" + + show_tool_versions_go + + print_ruler + + run_command go clean ./... + + print_ruler + + run_command golangci-lint "${args[@]}" ./... + + print_ruler + + echo Exit code: "${retval}" + return "${retval}" +} + +time main "${@}" diff --git a/.github/citools/go/go-lint-gosec b/.github/citools/go/go-lint-gosec new file mode 100755 index 00000000..3d5dcabd --- /dev/null +++ b/.github/citools/go/go-lint-gosec @@ -0,0 +1,38 @@ +#!/bin/bash +# +# .github/citools/go/go-lint-gosec +# + +# go install github.com/securego/gosec/cmd/gosec@latest + +# shellcheck disable=SC1091 +source ../../.github/citools/includes/wrapper-library || exit + +declare -i retval=0 + +declare -a args +args=("${@}") +if [[ ${#args[@]} -eq 0 ]]; then + args=() +fi + +main() { + printf "\nRunning Go GoSec\n\n" + + show_tool_versions_go + + print_ruler + + run_command go clean ./... + + print_ruler + + run_command gosec "${args[@]}" ./... + + print_ruler + + echo Exit code: "${retval}" + return "${retval}" +} + +time main "${@}" diff --git a/.github/citools/go/go-lint-ineffassign b/.github/citools/go/go-lint-ineffassign new file mode 100755 index 00000000..3288ddad --- /dev/null +++ b/.github/citools/go/go-lint-ineffassign @@ -0,0 +1,38 @@ +#!/bin/bash +# +# .github/citools/go/go-lint-ineffassign +# + +# go install github.com/gordonklaus/ineffassign@latest + +# shellcheck disable=SC1091 +source ../../.github/citools/includes/wrapper-library || exit + +declare -i retval=0 + +declare -a args +args=("${@}") +if [[ ${#args[@]} -eq 0 ]]; then + args=() +fi + +main() { + printf "\nRunning Go ineffassign\n\n" + + show_tool_versions_go + + print_ruler + + run_command go clean ./... + + print_ruler + + run_command ineffassign "${args[@]}" ./... + + print_ruler + + echo Exit code: "${retval}" + return "${retval}" +} + +time main "${@}" diff --git a/.github/citools/go/go-lint-misspell b/.github/citools/go/go-lint-misspell new file mode 100755 index 00000000..a7952864 --- /dev/null +++ b/.github/citools/go/go-lint-misspell @@ -0,0 +1,34 @@ +#!/bin/bash +# +# .github/citools/go/go-lint-misspell +# + +# go install github.com/client9/misspell/cmd/misspell@latest + +# shellcheck disable=SC1091 +source ../../.github/citools/includes/wrapper-library || exit + +declare -i retval=0 + +declare -a args +args=("${@}") +if [[ ${#args[@]} -eq 0 ]]; then + args=() +fi + +main() { + printf "\nRunning Go misspell\n\n" + + show_tool_versions_go + + print_ruler + + run_command misspell "${args[@]}" . + + print_ruler + + echo Exit code: "${retval}" + return "${retval}" +} + +time main "${@}" diff --git a/.github/citools/go/go-lint-revive b/.github/citools/go/go-lint-revive new file mode 100755 index 00000000..b105a8dc --- /dev/null +++ b/.github/citools/go/go-lint-revive @@ -0,0 +1,38 @@ +#!/bin/bash +# +# .github/citools/go/go-lint-revive +# + +# go install github.com/mgechev/revive@latest + +# shellcheck disable=SC1091 +source ../../.github/citools/includes/wrapper-library || exit + +declare -i retval=0 + +declare -a args +args=("${@}") +if [[ ${#args[@]} -eq 0 ]]; then + args=(-formatter=stylish) +fi + +main() { + printf "\nRunning Go Lint Revive\n\n" + + show_tool_versions_go + + print_ruler + + run_command go clean ./... + + print_ruler + + run_command revive "${args[@]}" ./... + + print_ruler + + echo Exit code: "${retval}" + return "${retval}" +} + +time main "${@}" diff --git a/.github/citools/go/go-lint-staticcheck b/.github/citools/go/go-lint-staticcheck new file mode 100755 index 00000000..706d1944 --- /dev/null +++ b/.github/citools/go/go-lint-staticcheck @@ -0,0 +1,38 @@ +#!/bin/bash +# +# .github/citools/go/go-lint-staticcheck +# + +# go install honnef.co/go/tools/cmd/staticcheck@latest + +# shellcheck disable=SC1091 +source ../../.github/citools/includes/wrapper-library || exit + +declare -i retval=0 + +declare -a args +args=("${@}") +if [[ ${#args[@]} -eq 0 ]]; then + args=(-checks=all) +fi + +main() { + printf "\nRunning Go StaticCheck\n\n" + + show_tool_versions_go + + print_ruler + + run_command go clean ./... + + print_ruler + + run_command staticcheck "${args[@]}" ./... + + print_ruler + + echo Exit code: "${retval}" + return "${retval}" +} + +time main "${@}" diff --git a/.github/citools/go/go-setup-config b/.github/citools/go/go-setup-config new file mode 100755 index 00000000..0dbb4c5e --- /dev/null +++ b/.github/citools/go/go-setup-config @@ -0,0 +1,24 @@ +#!/bin/bash +# +# .github/citools/go/go-setup-config +# + +# shellcheck disable=SC1091 +source ../../.github/citools/includes/wrapper-library || exit + +declare -i retval=0 + +main() { + printf "Setup Go Environment\n\n" + + print_ruler + + printf "%s\n" "/root/go/bin" | tee -a "${GITHUB_PATH}" + + print_ruler + + echo Exit code: "${retval}" + return "${retval}" +} + +time main "${@}" diff --git a/.github/citools/go/go-setup-verify b/.github/citools/go/go-setup-verify new file mode 100755 index 00000000..16578857 --- /dev/null +++ b/.github/citools/go/go-setup-verify @@ -0,0 +1,44 @@ +#!/bin/bash +# +# .github/citools/go/go-setup-verify +# + +# shellcheck disable=SC1091 +source ../../.github/citools/includes/wrapper-library || exit + +declare -i retval=0 + +declare -A go_cmds + +go_cmds=( + [go]=$( + command -v go >&/dev/null + echo "$?" + ) +) + +main() { + for key in "${!go_cmds[@]}"; do + if [[ ${go_cmds[${key}]} -ne 0 ]]; then + printf "ERROR: command [%s] not found.\n" "${key}" + ((retval++)) + fi + done + + if [[ ${retval} -ne 0 ]]; then + return "${retval}" + fi + + printf "Verifying Go Installation\n\n" + + print_ruler + + show_tool_versions_go + + print_ruler + + echo Exit code: "${retval}" + return "${retval}" +} + +time main "${@}" diff --git a/.github/citools/go/go-test-cover b/.github/citools/go/go-test-cover new file mode 100755 index 00000000..00ac07a2 --- /dev/null +++ b/.github/citools/go/go-test-cover @@ -0,0 +1,34 @@ +#!/bin/bash +# +# .github/citools/go/go-test-cover +# + +# shellcheck disable=SC1091 +source ../../.github/citools/includes/wrapper-library || exit + +declare -i retval=0 + +main() { + printf "\nRunning Go Test & Coverage\n\n" + + show_tool_versions_go + + print_ruler + + run_command go clean ./... + + print_ruler + + run_command gotest -v -covermode=count -coverprofile coverage.out ./... + + print_ruler + + run_command go tool cover -func=coverage.out + + print_ruler + + echo Exit code: "${retval}" + return "${retval}" +} + +time main "${@}" diff --git a/.github/citools/go/go-test-cover-report b/.github/citools/go/go-test-cover-report new file mode 100755 index 00000000..c92ea33e --- /dev/null +++ b/.github/citools/go/go-test-cover-report @@ -0,0 +1,55 @@ +#!/bin/bash +# +# .github/citools/go/go-test-cover-report +# + +# go install golang.org/x/tools/cmd/cover@latest +# go install github.com/rakyll/gotest@latest +# go install github.com/axw/gocov/gocov@latest + +# shellcheck disable=SC1091 +source ../../.github/citools/includes/wrapper-library || exit + +declare -i retval=0 + +cover_annotate() { + echo Running: gocov convert coverage.out '|' gocov annotate -ceiling=100 - '|' tee coverage-annotations.txt + time gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +} # cover_annotate() + +main() { + printf "\nRunning Go Test, Coverage & Reports\n\n" + + show_tool_versions_go + + print_ruler + + run_command go clean ./... + + print_ruler + + run_command gotest -v -covermode=count -coverprofile coverage.out ./... + + print_ruler + + run_command go tool cover -func=coverage.out + + print_ruler + + run_command go tool cover -html coverage.out -o coverage.html + + print_ruler + + run_command cover_annotate + + print_ruler + + run_command gotest -v -race -covermode=atomic ./... + + print_ruler + + echo Exit code: "${retval}" + return "${retval}" +} + +time main "${@}" diff --git a/.github/citools/includes/wrapper-library b/.github/citools/includes/wrapper-library index 98d02618..3b03d79f 100644 --- a/.github/citools/includes/wrapper-library +++ b/.github/citools/includes/wrapper-library @@ -76,3 +76,33 @@ show_tool_versions_rust() { # md_code_tag printf "\n" } # show_tool_versions_rust() + +show_tool_versions_go() { + # md_code_tag text + printf "Go version:\n" + printf "\n" + go version | paste /dev/null - + # md_code_tag + printf "\n" + + if [[ -z ${GITHUB_ACTIONS} ]]; then + return + fi + + # md_code_tag text + printf "Installed Go packages:\n" + printf "\n" + # shellcheck disable=SC2012 + ls ~/go/bin | paste /dev/null - + # md_code_tag + printf "\n" + + # md_code_tag text + printf "Environment variables:\n" + printf "\n" + printf "%s=%s\n" "PATH" "${PATH}" + printf "\n" + printf "%s=%s\n" "GOBIN" "${GOBIN}" "GOPATH" "${GOPATH}" + # md_code_tag + printf "\n" +} # show_tool_versions_go() diff --git a/go/run-tests b/go/run-tests index 9c64749b..a998bae1 100755 --- a/go/run-tests +++ b/go/run-tests @@ -23,116 +23,88 @@ main() { # go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest - echo golangci-lint run --enable-all ./... - time golangci-lint run --enable-all ./... - - print_ruler - - # go install golang.org/x/lint/golint@latest - - echo golint ./... - time golint ./... + echo Running: ../../.github/citools/go/go-lint-golangci-lint + time ../../.github/citools/go/go-lint-golangci-lint print_ruler # go install github.com/mgechev/revive@latest - echo revive -formatter=stylish ./... - time revive -formatter=stylish ./... + echo Running: ../../.github/citools/go/go-lint-revive + time ../../.github/citools/go/go-lint-revive print_ruler # go install github.com/gordonklaus/ineffassign@latest - echo ineffassign ./... - time ineffassign ./... + echo Running: ../../.github/citools/go/go-lint-ineffassign + time .github/citools/go/go-lint-ineffassign print_ruler # go install github.com/quasilyte/go-consistent@latest - echo go-consistent -v ./... - time go-consistent -v ./... + echo Running: ../../.github/citools/go/go-lint-go-consistent + time ../../.github/citools/go/go-lint-go-consistent print_ruler # go install honnef.co/go/tools/cmd/staticcheck@latest - echo staticcheck ./... - time staticcheck ./... + echo Running: ../../.github/citools/go/go-lint-staticcheck + time ../../.github/citools/go/go-lint-staticcheck print_ruler # go install github.com/go-critic/go-critic/cmd/gocritic@latest - echo gocritic check -enableAll ./... - time gocritic check -enableAll ./... + echo Running: ../../.github/citools/go/go-lint-gocritic + time ../../.github/citools/go/go-lint-gocritic print_ruler - echo go vet ./... - time go vet ./... + echo Running: ../../.github/citools/go/go-lint-go_vet + time ../../.github/citools/go/go-lint-go_vet print_ruler - echo go fix ./... - time go fix ./... + echo Running: ../../.github/citools/go/go-fixer-go_fix + time ../../.github/citools/go/go-fixer-go_fix print_ruler - echo errcheck ./... - time errcheck ./... + echo Running: ../../.github/citools/go/go-lint-errcheck + time ../../.github/citools/go/go-lint-errcheck print_ruler # go install github.com/fzipp/gocyclo/cmd/gocyclo@latest - echo gocyclo . - time gocyclo . + echo Running: ../../.github/citools/go/go-lint-gocyclo + time ../../.github/citools/go/go-lint-gocyclo print_ruler # go install github.com/client9/misspell/cmd/misspell@latest - echo misspell . - time misspell . + echo Running: ../../.github/citools/go/go-lint-misspell + time ../../.github/citools/go/go-lint-misspell print_ruler # go install github.com/securego/gosec/cmd/gosec@latest - echo gosec ./... - time gosec ./... + echo Running: ../../.github/citools/go/go-lint-gosec + time ../../.github/citools/go/go-lint-gosec print_ruler # go install golang.org/x/tools/cmd/cover@latest # go install github.com/rakyll/gotest@latest - - echo gotest -v -covermode=count -coverprofile coverage.out ./... - time gotest -v -covermode=count -coverprofile coverage.out ./... - - print_ruler - - echo go tool cover -func=coverage.out - time go tool cover -func=coverage.out - - print_ruler - - echo go tool cover -html coverage.out -o coverage.html - time go tool cover -html coverage.out -o coverage.html - - print_ruler - # go install github.com/axw/gocov/gocov@latest - echo gocov convert coverage.out '|' gocov annotate -ceiling=100 - '|' tee coverage-annotations.txt - time gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt - - print_ruler - - echo gotest -v -race -covermode=atomic ./... - time gotest -v -race -covermode=atomic ./... + echo Running: ../../.github/citools/go/go-test-cover-report + time ../../.github/citools/go/go-test-cover-report print_ruler From 919aceb3b7fc74fb779e9cc85241ae21dae68e92 Mon Sep 17 00:00:00 2001 From: Victor Payno Date: Thu, 7 Sep 2023 00:34:37 -0700 Subject: [PATCH 8/9] go: update run-tests output --- go/acronym/acronym-doc.md | 4 +- go/acronym/acronym-doc.txt | 4 +- go/acronym/benchstat-new.txt | 7 +- go/acronym/benchstat-old.txt | 4 +- go/acronym/coverage-annotations.txt | 39 + go/acronym/coverage.out | 4 +- go/acronym/run-tests-go.txt | 838 +- go/airport-robot/benchstat-new.txt | 2 +- go/airport-robot/benchstat-old.txt | 2 + go/airport-robot/run-tests-go.txt | 680 +- go/all-your-base/allyourbase-doc.md | 12 +- go/all-your-base/allyourbase-doc.txt | 4 +- go/all-your-base/benchstat-new.txt | 2 +- go/all-your-base/benchstat-old.txt | 2 +- go/all-your-base/coverage-annotations.txt | 65 + go/all-your-base/coverage.out | 34 +- go/all-your-base/run-tests-go.txt | 920 +- go/allergies/benchstat-new.txt | 6 +- go/allergies/benchstat-old.txt | 8 +- go/allergies/coverage.html | 2 +- go/allergies/coverage.out | 2 +- go/allergies/run-tests-go.txt | 684 +- go/anagram/anagram-doc.md | 4 +- go/anagram/benchstat-new.txt | 7 +- go/anagram/benchstat-old.txt | 4 +- go/anagram/coverage-annotations.txt | 0 go/anagram/coverage.out | 2 +- go/anagram/run-tests-go.txt | 786 +- go/animal-magic/benchstat-new.txt | 2 +- go/animal-magic/benchstat-old.txt | 2 + go/animal-magic/coverage.out | 2 +- go/animal-magic/run-tests-go.txt | 811 +- go/annalyns-infiltration/benchstat-new.txt | 2 +- go/annalyns-infiltration/benchstat-old.txt | 2 + .../coverage-annotations.txt | 0 go/annalyns-infiltration/coverage.out | 4 +- go/annalyns-infiltration/run-tests-go.txt | 818 +- go/armstrong-numbers/armstrong-doc.md | 4 +- go/armstrong-numbers/benchstat-new.txt | 7 +- go/armstrong-numbers/benchstat-old.txt | 12 +- go/armstrong-numbers/coverage-annotations.txt | 23 + go/armstrong-numbers/coverage.out | 6 +- go/armstrong-numbers/run-tests-go.txt | 801 +- go/atbash-cipher/atbash-doc.md | 4 +- go/atbash-cipher/benchstat-new.txt | 7 +- go/atbash-cipher/benchstat-old.txt | 7 + go/atbash-cipher/coverage-annotations.txt | 29 + go/atbash-cipher/coverage.out | 14 +- go/atbash-cipher/run-tests-go.txt | 825 +- go/beer-song/benchstat-new.txt | 6 +- go/beer-song/benchstat-old.txt | 13 +- go/beer-song/run-tests-go.txt | 681 +- go/bird-watcher/benchstat-new.txt | 2 + go/bird-watcher/birdwatcher-doc.md | 6 +- go/bird-watcher/coverage-annotations.txt | 0 go/bird-watcher/coverage.html | 152 + go/bird-watcher/coverage.out | 4 +- go/bird-watcher/run-tests-go.txt | 759 +- go/blackjack/benchstat-new.txt | 2 + go/blackjack/blackjack-doc.md | 4 +- go/blackjack/coverage-annotations.txt | 0 go/blackjack/coverage.html | 179 + go/blackjack/coverage.out | 12 +- go/blackjack/run-tests-go.txt | 851 +- go/bob/benchstat-new.txt | 7 +- go/bob/benchstat-old.txt | 4 +- go/bob/bob-doc.md | 4 +- go/bob/coverage-annotations.txt | 65 + go/bob/coverage.out | 24 +- go/bob/run-tests-go.txt | 889 +- go/booking-up-for-beauty/benchstat-old.txt | 2 + go/booking-up-for-beauty/run-tests-go.txt | 715 +- go/bottle-song/benchstat-new.txt | 2 +- go/bottle-song/benchstat-old.txt | 2 + go/bottle-song/run-tests-go.txt | 718 +- go/card-tricks/benchstat-new.txt | 2 + go/card-tricks/cards-doc.md | 10 +- go/card-tricks/coverage-annotations.txt | 0 go/card-tricks/coverage.html | 169 + go/card-tricks/coverage.out | 8 +- go/card-tricks/run-tests-go.txt | 830 +- go/cars-assemble/benchstat-new.txt | 2 + go/cars-assemble/coverage-annotations.txt | 0 go/cars-assemble/coverage.html | 136 + go/cars-assemble/run-tests-go.txt | 787 +- go/census/benchstat-old.txt | 2 +- go/census/run-tests-go.txt | 615 +- go/chessboard/benchstat-new.txt | 2 +- go/chessboard/benchstat-old.txt | 2 +- go/chessboard/coverage.out | 8 +- go/chessboard/run-tests-go.txt | 834 +- go/clock/benchstat-new.txt | 13 +- go/clock/benchstat-old.txt | 8 +- go/clock/clock-doc.md | 12 +- go/clock/coverage-annotations.txt | 0 go/clock/coverage.out | 6 +- go/clock/run-tests-go.txt | 1065 +- go/collatz-conjecture/benchstat-new.txt | 7 +- go/collatz-conjecture/benchstat-old.txt | 7 + .../collatzconjecture-doc.md | 4 +- .../coverage-annotations.txt | 0 go/collatz-conjecture/coverage.out | 6 +- go/collatz-conjecture/run-tests-go.txt | 772 +- go/crypto-square/benchstat-new.txt | 7 +- go/crypto-square/benchstat-old.txt | 7 + go/crypto-square/coverage-annotations.txt | 272 +- go/crypto-square/coverage.out | 36 +- go/crypto-square/run-tests-go.txt | 1172 +- go/custom-set/benchstat-new.txt | 12 +- go/custom-set/benchstat-old.txt | 14 + go/custom-set/coverage.html | 6 +- go/custom-set/coverage.out | 38 +- go/custom-set/run-tests-go.txt | 900 +- go/darts/benchstat-new.txt | 7 +- go/darts/benchstat-old.txt | 4 +- go/darts/coverage-annotations.txt | 0 go/darts/darts-doc.md | 4 +- go/darts/run-tests-go.txt | 790 +- go/difference-of-squares/benchstat-new.txt | 78 +- go/difference-of-squares/benchstat-old.txt | 26 +- .../coverage-annotations.txt | 0 go/difference-of-squares/coverage.html | 178 + go/difference-of-squares/coverage.out | 8 +- go/difference-of-squares/diffsquares-doc.md | 8 +- go/difference-of-squares/diffsquares-doc.txt | 4 +- go/difference-of-squares/run-tests-go.txt | 1090 +- go/election-day/benchstat-new.txt | 2 +- go/election-day/benchstat-old.txt | 2 + go/election-day/coverage-annotations.txt | 9 + go/election-day/coverage.out | 2 +- go/election-day/electionday-doc.md | 6 +- go/election-day/run-tests-go.txt | 831 +- go/elons-toys/benchstat-new.txt | 2 +- go/elons-toys/benchstat-old.txt | 2 +- go/elons-toys/run-tests-go.txt | 689 +- go/etl/benchstat-new.txt | 7 +- go/etl/benchstat-old.txt | 7 + go/etl/coverage-annotations.txt | 0 go/etl/coverage.out | 2 +- go/etl/etl-doc.md | 8 +- go/etl/run-tests-go.txt | 746 +- go/expenses/benchstat-new.txt | 2 + go/expenses/coverage-annotations.txt | 0 go/expenses/coverage.html | 195 + go/expenses/coverage.out | 10 +- go/expenses/expenses-doc.md | 8 +- go/expenses/run-tests-go.txt | 786 +- go/flatten-array/benchstat-new.txt | 7 +- go/flatten-array/benchstat-old.txt | 4 +- go/flatten-array/coverage-annotations.txt | 0 go/flatten-array/flatten-doc.md | 4 +- go/flatten-array/run-tests-go.txt | 798 +- go/gigasecond/benchstat-new.txt | 7 +- go/gigasecond/benchstat-old.txt | 4 +- go/gigasecond/coverage-annotations.txt | 0 go/gigasecond/gigasecond-doc.md | 4 +- go/gigasecond/run-tests-go.txt | 781 +- go/grains/benchstat-new.txt | 10 +- go/grains/benchstat-old.txt | 6 +- go/grains/coverage-annotations.txt | 0 go/grains/coverage.out | 4 +- go/grains/grains-doc.md | 6 +- go/grains/grains-doc.txt | 5 +- go/grains/run-tests-go.txt | 857 +- go/gross-store/benchstat-new.txt | 2 + go/gross-store/coverage-annotations.txt | 0 go/gross-store/coverage.html | 201 + go/gross-store/coverage.out | 6 +- go/gross-store/gross-doc.md | 10 +- go/gross-store/run-tests-go.txt | 819 +- go/hamming/benchstat-new.txt | 7 +- go/hamming/benchstat-old.txt | 7 + go/hamming/coverage-annotations.txt | 0 go/hamming/coverage.out | 10 +- go/hamming/hamming-doc.md | 2 +- go/hamming/run-tests-go.txt | 784 +- go/hello-world/benchstat-new.txt | 8 + go/hello-world/coverage-annotations.txt | 0 go/hello-world/coverage.html | 118 + go/hello-world/greeting-doc.md | 2 +- go/hello-world/run-tests-go.txt | 694 +- go/house/benchstat-new.txt | 8 +- go/house/benchstat-old.txt | 10 + go/house/coverage.out | 8 +- go/house/run-tests-go.txt | 830 +- go/interest-is-interesting/benchstat-new.txt | 2 +- go/interest-is-interesting/benchstat-old.txt | 2 + .../coverage-annotations.txt | 0 go/interest-is-interesting/coverage.out | 4 +- go/interest-is-interesting/interest-doc.md | 6 +- go/interest-is-interesting/run-tests-go.txt | 828 +- go/isbn-verifier/benchstat-new.txt | 7 +- go/isbn-verifier/benchstat-old.txt | 4 +- go/isbn-verifier/coverage-annotations.txt | 55 + go/isbn-verifier/coverage.out | 16 +- go/isbn-verifier/isbn-doc.md | 4 +- go/isbn-verifier/run-tests-go.txt | 873 +- go/isogram/benchstat-new.txt | 7 +- go/isogram/benchstat-old.txt | 7 + go/isogram/coverage-annotations.txt | 33 + go/isogram/coverage.out | 10 +- go/isogram/isogram-doc.md | 4 +- go/isogram/isogram-doc.txt | 4 +- go/isogram/run-tests-go.txt | 811 +- go/largest-series-product/benchstat-new.txt | 7 +- go/largest-series-product/benchstat-old.txt | 7 + .../coverage-annotations.txt | 71 + go/largest-series-product/coverage.html | 16 +- go/largest-series-product/coverage.out | 44 +- go/largest-series-product/lsproduct-doc.md | 4 +- go/largest-series-product/run-tests-go.txt | 892 +- go/lasagna-master/benchstat-new.txt | 2 + go/lasagna-master/coverage-annotations.txt | 9 + go/lasagna-master/coverage.html | 175 + go/lasagna-master/coverage.out | 8 +- go/lasagna-master/lasagna-doc.md | 8 +- go/lasagna-master/run-tests-go.txt | 785 +- go/lasagna/benchstat-new.txt | 2 + go/lasagna/coverage-annotations.txt | 0 go/lasagna/coverage.html | 131 + go/lasagna/lasagna-doc.md | 8 +- go/lasagna/run-tests-go.txt | 759 +- go/leap/benchstat-new.txt | 4 +- go/leap/benchstat-old.txt | 4 +- go/leap/coverage.out | 6 +- go/leap/run-tests-go.txt | 713 +- go/ledger/benchstat-new.txt | 6 +- go/ledger/benchstat-old.txt | 8 + go/ledger/coverage.out | 50 +- go/ledger/run-tests-go.txt | 785 +- go/list-ops/benchstat-old.txt | 2 +- go/list-ops/run-tests-go.txt | 629 +- go/logs-logs-logs/benchstat-new.txt | 2 +- go/logs-logs-logs/benchstat-old.txt | 2 + go/logs-logs-logs/coverage-annotations.txt | 0 go/logs-logs-logs/coverage.out | 4 +- go/logs-logs-logs/logs-doc.md | 6 +- go/logs-logs-logs/run-tests-go.txt | 758 +- go/luhn/benchstat-new.txt | 7 +- go/luhn/benchstat-old.txt | 4 +- go/luhn/coverage-annotations.txt | 72 + go/luhn/coverage.out | 14 +- go/luhn/luhn-doc.md | 4 +- go/luhn/run-tests-go.txt | 912 +- go/markdown/benchstat-new.txt | 7 +- go/markdown/benchstat-old.txt | 4 +- go/markdown/coverage.html | 11 + go/markdown/coverage.out | 24 +- go/markdown/run-tests-go.txt | 850 +- go/meetup/benchstat-new.txt | 7 +- go/meetup/benchstat-old.txt | 7 + go/meetup/coverage-annotations.txt | 0 go/meetup/coverage.html | 28 +- go/meetup/coverage.out | 6 +- go/meetup/meetup-doc.md | 20 +- go/meetup/meetup-doc.txt | 12 +- go/meetup/run-tests-go.txt | 971 +- go/meteorology/benchstat-new.txt | 2 + go/meteorology/coverage-annotations.txt | 0 go/meteorology/coverage.html | 187 + go/meteorology/meteorology-doc.md | 24 +- go/meteorology/run-tests-go.txt | 807 +- go/need-for-speed/benchstat-new.txt | 2 + go/need-for-speed/coverage-annotations.txt | 17 + go/need-for-speed/coverage.html | 171 + go/need-for-speed/coverage.out | 6 +- go/need-for-speed/run-tests-go.txt | 803 +- go/need-for-speed/speed-doc.md | 6 +- go/nth-prime/benchstat-new.txt | 7 +- go/nth-prime/benchstat-old.txt | 4 +- go/nth-prime/coverage-annotations.txt | 0 go/nth-prime/coverage.html | 8 +- go/nth-prime/coverage.out | 22 +- go/nth-prime/prime-doc.md | 4 +- go/nth-prime/run-tests-go.txt | 821 +- go/nucleotide-count/benchstat-new.txt | 2 +- go/nucleotide-count/benchstat-old.txt | 2 +- go/nucleotide-count/coverage-annotations.txt | 29 + go/nucleotide-count/coverage.out | 10 +- go/nucleotide-count/dna-doc.md | 12 +- go/nucleotide-count/dna-doc.txt | 10 +- go/nucleotide-count/run-tests-go.txt | 795 +- go/pangram/benchstat-new.txt | 7 +- go/pangram/benchstat-old.txt | 4 +- go/pangram/coverage-annotations.txt | 37 + go/pangram/coverage.out | 8 +- go/pangram/pangram-doc.md | 4 +- go/pangram/run-tests-go.txt | 817 +- .../benchstat-new.txt | 22 +- .../benchstat-old.txt | 12 + .../coverage-annotations.txt | 0 go/parallel-letter-frequency/coverage.html | 2 +- go/parallel-letter-frequency/coverage.out | 8 +- go/parallel-letter-frequency/letter-doc.md | 6 +- go/parallel-letter-frequency/run-tests-go.txt | 970 +- go/parsing-log-files/benchstat-new.txt | 2 +- go/parsing-log-files/benchstat-old.txt | 2 + go/parsing-log-files/coverage-annotations.txt | 79 + go/parsing-log-files/coverage.out | 14 +- go/parsing-log-files/parsinglogfiles-doc.md | 10 +- go/parsing-log-files/run-tests-go.txt | 908 +- go/party-robot/benchstat-new.txt | 2 +- go/party-robot/benchstat-old.txt | 2 + go/party-robot/coverage-annotations.txt | 0 go/party-robot/partyrobot-doc.md | 6 +- go/party-robot/run-tests-go.txt | 741 +- go/pascals-triangle/benchstat-new.txt | 8 +- go/pascals-triangle/benchstat-old.txt | 10 + go/pascals-triangle/coverage.out | 14 +- go/pascals-triangle/run-tests-go.txt | 747 +- go/perfect-numbers/benchstat-new.txt | 4 +- go/perfect-numbers/benchstat-old.txt | 11 + go/perfect-numbers/coverage.out | 12 +- go/perfect-numbers/run-tests-go.txt | 726 +- go/phone-number/benchstat-new.txt | 13 +- go/phone-number/benchstat-old.txt | 8 +- go/phone-number/coverage-annotations.txt | 141 + go/phone-number/coverage.out | 42 +- go/phone-number/phonenumber-doc.md | 28 +- go/phone-number/phonenumber-doc.txt | 4 +- go/phone-number/run-tests-go.txt | 1173 +- go/prime-factors/benchstat-new.txt | 7 +- go/prime-factors/benchstat-old.txt | 7 + go/prime-factors/coverage-annotations.txt | 0 go/prime-factors/coverage.out | 4 +- go/prime-factors/prime-doc.md | 4 +- go/prime-factors/run-tests-go.txt | 798 +- go/protein-translation/benchstat-new.txt | 10 +- go/protein-translation/benchstat-old.txt | 8 + .../coverage-annotations.txt | 30 + go/protein-translation/coverage.out | 6 +- go/protein-translation/protein-doc.md | 10 +- go/protein-translation/run-tests-go.txt | 878 +- go/proverb/benchstat-new.txt | 7 +- go/proverb/benchstat-old.txt | 4 +- go/proverb/coverage-annotations.txt | 0 go/proverb/coverage.out | 4 +- go/proverb/proverb-doc.md | 4 +- go/proverb/run-tests-go.txt | 795 +- go/pythagorean-triplet/coverage.out | 14 +- go/pythagorean-triplet/run-tests-go.txt | 724 +- go/raindrops/benchstat-new.txt | 8 + go/raindrops/coverage-annotations.txt | 0 go/raindrops/coverage.html | 151 + go/raindrops/coverage.out | 8 +- go/raindrops/raindrops-doc.md | 4 +- go/raindrops/raindrops-doc.txt | 4 +- go/raindrops/run-tests-go.txt | 810 +- go/resistor-color-duo/benchstat-new.txt | 4 +- go/resistor-color-duo/benchstat-old.txt | 8 + go/resistor-color-duo/run-tests-go.txt | 713 +- go/resistor-color-trio/benchstat-new.txt | 4 +- go/resistor-color-trio/benchstat-old.txt | 4 +- go/resistor-color-trio/run-tests-go.txt | 750 +- go/resistor-color/benchstat-new.txt | 6 +- go/resistor-color/benchstat-old.txt | 10 + go/resistor-color/run-tests-go.txt | 730 +- go/reverse-string/benchstat-new.txt | 7 +- go/reverse-string/benchstat-old.txt | 7 + go/reverse-string/coverage-annotations.txt | 0 go/reverse-string/coverage.html | 2 +- go/reverse-string/coverage.out | 2 +- go/reverse-string/reverse-doc.md | 4 +- go/reverse-string/run-tests-go.txt | 815 +- go/rna-transcription/benchstat-new.txt | 7 +- go/rna-transcription/benchstat-old.txt | 7 + go/rna-transcription/coverage-annotations.txt | 6 + go/rna-transcription/coverage.html | 4 +- go/rna-transcription/coverage.out | 10 +- go/rna-transcription/run-tests-go.txt | 844 +- go/rna-transcription/strand-doc.md | 20 +- go/roman-numerals/benchstat-new.txt | 7 +- go/roman-numerals/benchstat-old.txt | 4 +- go/roman-numerals/coverage-annotations.txt | 120 + go/roman-numerals/coverage.html | 22 +- go/roman-numerals/coverage.out | 26 +- go/roman-numerals/romannumerals-doc.md | 4 +- go/roman-numerals/run-tests-go.txt | 1140 +- go/rotational-cipher/benchstat-new.txt | 7 +- go/rotational-cipher/benchstat-old.txt | 4 +- go/rotational-cipher/coverage-annotations.txt | 0 go/rotational-cipher/coverage.html | 12 + go/rotational-cipher/coverage.out | 8 +- go/rotational-cipher/rotationalcipher-doc.md | 4 +- go/rotational-cipher/run-tests-go.txt | 780 +- go/scrabble-score/benchstat-new.txt | 7 +- go/scrabble-score/benchstat-old.txt | 7 + go/scrabble-score/coverage-annotations.txt | 0 go/scrabble-score/coverage.out | 4 +- go/scrabble-score/run-tests-go.txt | 778 +- go/scrabble-score/scrabble-doc.md | 4 +- go/series/benchstat-new.txt | 2 +- go/series/benchstat-old.txt | 2 + go/series/coverage-annotations.txt | 44 + go/series/coverage.out | 10 +- go/series/run-tests-go.txt | 774 +- go/series/series-doc.md | 6 +- go/sieve/benchstat-new.txt | 7 +- go/sieve/benchstat-old.txt | 4 +- go/sieve/coverage-annotations.txt | 0 go/sieve/coverage.html | 4 +- go/sieve/coverage.out | 10 +- go/sieve/run-tests-go.txt | 781 +- go/sieve/sieve-doc.md | 4 +- go/simple-cipher/benchstat-new.txt | 28 +- go/simple-cipher/benchstat-old.txt | 14 + go/simple-cipher/coverage.out | 44 +- go/simple-cipher/run-tests-go.txt | 1193 +- go/simple-linked-list/benchstat-new.txt | 16 +- go/simple-linked-list/benchstat-old.txt | 18 + go/simple-linked-list/coverage.out | 26 +- go/simple-linked-list/run-tests-go.txt | 909 +- go/sorting-room/benchstat-new.txt | 2 + go/sorting-room/coverage-annotations.txt | 0 go/sorting-room/coverage.html | 192 + go/sorting-room/coverage.out | 4 +- go/sorting-room/run-tests-go.txt | 809 +- go/sorting-room/sorting-doc.md | 18 +- go/space-age/benchstat-new.txt | 7 +- go/space-age/benchstat-old.txt | 4 +- go/space-age/coverage-annotations.txt | 0 go/space-age/coverage.out | 2 +- go/space-age/run-tests-go.txt | 815 +- go/space-age/space-doc.md | 4 +- go/strain/benchstat-new.txt | 10 +- go/strain/benchstat-old.txt | 8 + go/strain/coverage-annotations.txt | 34 + go/strain/coverage.out | 16 +- go/strain/run-tests-go.txt | 876 +- go/strain/strain-doc.md | 16 +- go/sublist/benchstat-new.txt | 4 +- go/sublist/benchstat-old.txt | 4 +- go/sublist/run-tests-go.txt | 731 +- go/sum-of-multiples/benchstat-new.txt | 6 +- go/sum-of-multiples/benchstat-old.txt | 8 + go/sum-of-multiples/coverage.out | 16 +- go/sum-of-multiples/run-tests-go.txt | 781 +- go/the-farm/benchstat-old.txt | 2 +- go/the-farm/run-tests-go.txt | 699 +- go/tournament/benchstat-new.txt | 149395 +++++++++++++- go/tournament/benchstat-old.txt | 12610 +- go/tournament/coverage-annotations.txt | 0 go/tournament/coverage.html | 4 +- go/tournament/coverage.out | 32 +- go/tournament/run-tests-go.txt | 150221 ++++++++++++++- go/tournament/tournament-doc.md | 6 +- go/triangle/benchstat-new.txt | 7 +- go/triangle/benchstat-old.txt | 4 +- go/triangle/coverage-annotations.txt | 13 + go/triangle/coverage.out | 16 +- go/triangle/run-tests-go.txt | 780 +- go/triangle/triangle-doc.md | 8 +- go/triangle/triangle-doc.txt | 3 +- go/twelve-days/benchstat-new.txt | 8 +- go/twelve-days/benchstat-old.txt | 10 + go/twelve-days/coverage.out | 8 +- go/twelve-days/run-tests-go.txt | 849 +- go/two-fer/benchstat-new.txt | 7 +- go/two-fer/benchstat-old.txt | 7 + go/two-fer/coverage-annotations.txt | 0 go/two-fer/coverage.out | 2 +- go/two-fer/run-tests-go.txt | 728 +- go/two-fer/twofer-doc.md | 2 +- go/vehicle-purchase/benchstat-new.txt | 2 +- go/vehicle-purchase/benchstat-old.txt | 2 + go/vehicle-purchase/coverage-annotations.txt | 0 go/vehicle-purchase/coverage.out | 6 +- go/vehicle-purchase/purchase-doc.md | 6 +- go/vehicle-purchase/run-tests-go.txt | 776 +- go/weather-forecast/benchstat-new.txt | 2 +- go/weather-forecast/benchstat-old.txt | 2 + go/weather-forecast/coverage-annotations.txt | 0 go/weather-forecast/run-tests-go.txt | 755 +- go/weather-forecast/weather-doc.md | 8 +- go/weather-forecast/weather-doc.txt | 4 +- go/welcome-to-tech-palace/benchstat-new.txt | 2 +- go/welcome-to-tech-palace/benchstat-old.txt | 2 + .../coverage-annotations.txt | 0 go/welcome-to-tech-palace/run-tests-go.txt | 747 +- go/welcome-to-tech-palace/techpalace-doc.md | 6 +- go/word-count/benchstat-new.txt | 7 +- go/word-count/benchstat-old.txt | 4 +- go/word-count/coverage-annotations.txt | 60 + go/word-count/coverage.out | 12 +- go/word-count/run-tests-go.txt | 863 +- go/word-count/wordcount-doc.md | 6 +- go/wordy/benchstat-new.txt | 7 +- go/wordy/benchstat-old.txt | 4 +- go/wordy/coverage-annotations.txt | 96 + go/wordy/coverage.out | 16 +- go/wordy/run-tests-go.txt | 944 +- go/wordy/wordy-doc.md | 4 +- 492 files changed, 370753 insertions(+), 22294 deletions(-) create mode 100644 go/acronym/coverage-annotations.txt create mode 100644 go/airport-robot/benchstat-old.txt create mode 100644 go/all-your-base/coverage-annotations.txt create mode 100644 go/anagram/coverage-annotations.txt create mode 100644 go/animal-magic/benchstat-old.txt create mode 100644 go/annalyns-infiltration/benchstat-old.txt create mode 100644 go/annalyns-infiltration/coverage-annotations.txt create mode 100644 go/armstrong-numbers/coverage-annotations.txt create mode 100644 go/atbash-cipher/benchstat-old.txt create mode 100644 go/atbash-cipher/coverage-annotations.txt create mode 100644 go/bird-watcher/benchstat-new.txt create mode 100644 go/bird-watcher/coverage-annotations.txt create mode 100644 go/bird-watcher/coverage.html create mode 100644 go/blackjack/benchstat-new.txt create mode 100644 go/blackjack/coverage-annotations.txt create mode 100644 go/blackjack/coverage.html create mode 100644 go/bob/coverage-annotations.txt create mode 100644 go/booking-up-for-beauty/benchstat-old.txt create mode 100644 go/bottle-song/benchstat-old.txt create mode 100644 go/card-tricks/benchstat-new.txt create mode 100644 go/card-tricks/coverage-annotations.txt create mode 100644 go/card-tricks/coverage.html create mode 100644 go/cars-assemble/benchstat-new.txt create mode 100644 go/cars-assemble/coverage-annotations.txt create mode 100644 go/cars-assemble/coverage.html create mode 100644 go/clock/coverage-annotations.txt create mode 100644 go/collatz-conjecture/benchstat-old.txt create mode 100644 go/collatz-conjecture/coverage-annotations.txt create mode 100644 go/crypto-square/benchstat-old.txt create mode 100644 go/custom-set/benchstat-old.txt create mode 100644 go/darts/coverage-annotations.txt create mode 100644 go/difference-of-squares/coverage-annotations.txt create mode 100644 go/difference-of-squares/coverage.html create mode 100644 go/election-day/benchstat-old.txt create mode 100644 go/election-day/coverage-annotations.txt create mode 100644 go/etl/benchstat-old.txt create mode 100644 go/etl/coverage-annotations.txt create mode 100644 go/expenses/benchstat-new.txt create mode 100644 go/expenses/coverage-annotations.txt create mode 100644 go/expenses/coverage.html create mode 100644 go/flatten-array/coverage-annotations.txt create mode 100644 go/gigasecond/coverage-annotations.txt create mode 100644 go/grains/coverage-annotations.txt create mode 100644 go/gross-store/benchstat-new.txt create mode 100644 go/gross-store/coverage-annotations.txt create mode 100644 go/gross-store/coverage.html create mode 100644 go/hamming/benchstat-old.txt create mode 100644 go/hamming/coverage-annotations.txt create mode 100644 go/hello-world/benchstat-new.txt create mode 100644 go/hello-world/coverage-annotations.txt create mode 100644 go/hello-world/coverage.html create mode 100644 go/house/benchstat-old.txt create mode 100644 go/interest-is-interesting/benchstat-old.txt create mode 100644 go/interest-is-interesting/coverage-annotations.txt create mode 100644 go/isbn-verifier/coverage-annotations.txt create mode 100644 go/isogram/benchstat-old.txt create mode 100644 go/isogram/coverage-annotations.txt create mode 100644 go/largest-series-product/benchstat-old.txt create mode 100644 go/largest-series-product/coverage-annotations.txt create mode 100644 go/lasagna-master/benchstat-new.txt create mode 100644 go/lasagna-master/coverage-annotations.txt create mode 100644 go/lasagna-master/coverage.html create mode 100644 go/lasagna/benchstat-new.txt create mode 100644 go/lasagna/coverage-annotations.txt create mode 100644 go/lasagna/coverage.html create mode 100644 go/ledger/benchstat-old.txt create mode 100644 go/logs-logs-logs/benchstat-old.txt create mode 100644 go/logs-logs-logs/coverage-annotations.txt create mode 100644 go/luhn/coverage-annotations.txt create mode 100644 go/meetup/benchstat-old.txt create mode 100644 go/meetup/coverage-annotations.txt create mode 100644 go/meteorology/benchstat-new.txt create mode 100644 go/meteorology/coverage-annotations.txt create mode 100644 go/meteorology/coverage.html create mode 100644 go/need-for-speed/benchstat-new.txt create mode 100644 go/need-for-speed/coverage-annotations.txt create mode 100644 go/need-for-speed/coverage.html create mode 100644 go/nth-prime/coverage-annotations.txt create mode 100644 go/nucleotide-count/coverage-annotations.txt create mode 100644 go/pangram/coverage-annotations.txt create mode 100644 go/parallel-letter-frequency/benchstat-old.txt create mode 100644 go/parallel-letter-frequency/coverage-annotations.txt create mode 100644 go/parsing-log-files/benchstat-old.txt create mode 100644 go/parsing-log-files/coverage-annotations.txt create mode 100644 go/party-robot/benchstat-old.txt create mode 100644 go/party-robot/coverage-annotations.txt create mode 100644 go/pascals-triangle/benchstat-old.txt create mode 100644 go/perfect-numbers/benchstat-old.txt create mode 100644 go/phone-number/coverage-annotations.txt create mode 100644 go/prime-factors/benchstat-old.txt create mode 100644 go/prime-factors/coverage-annotations.txt create mode 100644 go/protein-translation/benchstat-old.txt create mode 100644 go/protein-translation/coverage-annotations.txt create mode 100644 go/proverb/coverage-annotations.txt create mode 100644 go/raindrops/benchstat-new.txt create mode 100644 go/raindrops/coverage-annotations.txt create mode 100644 go/raindrops/coverage.html create mode 100644 go/resistor-color-duo/benchstat-old.txt create mode 100644 go/resistor-color/benchstat-old.txt create mode 100644 go/reverse-string/benchstat-old.txt create mode 100644 go/reverse-string/coverage-annotations.txt create mode 100644 go/rna-transcription/benchstat-old.txt create mode 100644 go/rna-transcription/coverage-annotations.txt create mode 100644 go/roman-numerals/coverage-annotations.txt create mode 100644 go/rotational-cipher/coverage-annotations.txt create mode 100644 go/scrabble-score/benchstat-old.txt create mode 100644 go/scrabble-score/coverage-annotations.txt create mode 100644 go/series/benchstat-old.txt create mode 100644 go/series/coverage-annotations.txt create mode 100644 go/sieve/coverage-annotations.txt create mode 100644 go/simple-cipher/benchstat-old.txt create mode 100644 go/simple-linked-list/benchstat-old.txt create mode 100644 go/sorting-room/benchstat-new.txt create mode 100644 go/sorting-room/coverage-annotations.txt create mode 100644 go/sorting-room/coverage.html create mode 100644 go/space-age/coverage-annotations.txt create mode 100644 go/strain/benchstat-old.txt create mode 100644 go/strain/coverage-annotations.txt create mode 100644 go/sum-of-multiples/benchstat-old.txt create mode 100644 go/tournament/coverage-annotations.txt create mode 100644 go/triangle/coverage-annotations.txt create mode 100644 go/twelve-days/benchstat-old.txt create mode 100644 go/two-fer/benchstat-old.txt create mode 100644 go/two-fer/coverage-annotations.txt create mode 100644 go/vehicle-purchase/benchstat-old.txt create mode 100644 go/vehicle-purchase/coverage-annotations.txt create mode 100644 go/weather-forecast/benchstat-old.txt create mode 100644 go/weather-forecast/coverage-annotations.txt create mode 100644 go/welcome-to-tech-palace/benchstat-old.txt create mode 100644 go/welcome-to-tech-palace/coverage-annotations.txt create mode 100644 go/word-count/coverage-annotations.txt create mode 100644 go/wordy/coverage-annotations.txt diff --git a/go/acronym/acronym-doc.md b/go/acronym/acronym-doc.md index 28a021da..35793639 100755 --- a/go/acronym/acronym-doc.md +++ b/go/acronym/acronym-doc.md @@ -6,7 +6,7 @@ import "acronym" ``` -Package acronym converts a phrase to its acronym\. The 1st iteration is better than the second one\. +Package acronym converts a phrase to its acronym. The 1st iteration is better than the second one. ## Index @@ -19,7 +19,7 @@ Package acronym converts a phrase to its acronym\. The 1st iteration is better t func Abbreviate(s string) string ``` -Abbreviate returns an acronym from the supplied string\. +Abbreviate returns an acronym from the supplied string.
Example

diff --git a/go/acronym/acronym-doc.txt b/go/acronym/acronym-doc.txt index 60bb59ab..8ef49a35 100644 --- a/go/acronym/acronym-doc.txt +++ b/go/acronym/acronym-doc.txt @@ -1,7 +1,7 @@ package acronym // import "acronym" -Package acronym converts a phrase to its acronym. The 1st iteration is -better than the second one. +Package acronym converts a phrase to its acronym. The 1st iteration is better +than the second one. FUNCTIONS diff --git a/go/acronym/benchstat-new.txt b/go/acronym/benchstat-new.txt index fb52eff3..cf40fe5a 100644 --- a/go/acronym/benchstat-new.txt +++ b/go/acronym/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: acronym -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkAcronym-4 5791 305661 ns/op 30838 B/op 426 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkAcronym +BenchmarkAcronym-8 20481 57491 ns/op 31138 B/op 426 allocs/op PASS -ok acronym 1.839s +ok acronym 1.718s diff --git a/go/acronym/benchstat-old.txt b/go/acronym/benchstat-old.txt index 25e52aef..fb52eff3 100644 --- a/go/acronym/benchstat-old.txt +++ b/go/acronym/benchstat-old.txt @@ -2,6 +2,6 @@ goos: linux goarch: amd64 pkg: acronym cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkAcronym-4 6241 173929 ns/op 30896 B/op 426 allocs/op +BenchmarkAcronym-4 5791 305661 ns/op 30838 B/op 426 allocs/op PASS -ok acronym 2.051s +ok acronym 1.839s diff --git a/go/acronym/coverage-annotations.txt b/go/acronym/coverage-annotations.txt new file mode 100644 index 00000000..2b90e065 --- /dev/null +++ b/go/acronym/coverage-annotations.txt @@ -0,0 +1,39 @@ + +11 func Abbreviate(s string) string { +12 var a string +13 +14 // Since we can't use cases or language, we have to do some pre-processing. +15 reStr := `(["'_;:.]|[[:digit:]])` +16 +17 re, e := regexp.Compile(reStr) +18 if e != nil { +19 // the raw re string is static but you can still make mistakes, better +20 // to panic during tests than quietly "working" incorrectly. +21 MISS panic(e) +22 } +23 +24 a = re.ReplaceAllString(s, "") +25 +26 // Get the title converted string. +27 // Using deprecated function, the test harness doesn't run `go mod tidy` or +28 // it also lacks Internet access. +29 a = strings.ToLower(a) +30 a = strings.Title(a) +31 +32 // Thought about looping through the string to find uppercase letters, +33 // decided on just using regexp to remove everything else instead. +34 // I've tried using the strings IsSomething functions befoer and they're a mess. +35 reStr = `([[:lower:]]|[[:blank:]]|[[:punct:]])` +36 +37 re, e = regexp.Compile(reStr) +38 if e != nil { +39 // the raw re string is static but you can still make mistakes, better +40 // to panic during tests than quietly "working" incorrectly. +41 MISS panic(e) +42 } +43 +44 a = re.ReplaceAllString(a, "") +45 +46 return a +47 } + diff --git a/go/acronym/coverage.out b/go/acronym/coverage.out index 350363f5..68c608f3 100644 --- a/go/acronym/coverage.out +++ b/go/acronym/coverage.out @@ -1,6 +1,6 @@ mode: count acronym/acronym.go:11.34,18.14 4 10 -acronym/acronym.go:24.2,38.14 6 10 -acronym/acronym.go:44.2,46.10 2 10 acronym/acronym.go:18.14,21.11 1 0 +acronym/acronym.go:24.2,38.14 6 10 acronym/acronym.go:38.14,41.11 1 0 +acronym/acronym.go:44.2,46.10 2 10 diff --git a/go/acronym/run-tests-go.txt b/go/acronym/run-tests-go.txt index a90e36ea..7567059c 100644 --- a/go/acronym/run-tests-go.txt +++ b/go/acronym/run-tests-go.txt @@ -5,15 +5,578 @@ Go packages: acronym =============================================================================== -golint acronym +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.016s +sys 0m0.018s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +acronym.go:34:56: `befoer` is a misspelling of `before` (misspell) + // I've tried using the strings IsSomething functions befoer and they're a mess. + ^ +acronym_test.go:10:25: Using the variable on range scope `tc` in function literal (scopelint) + actual := Abbreviate(tc.input) + ^ +acronym_test.go:11:17: Using the variable on range scope `tc` in function literal (scopelint) + if actual != tc.expected { + ^ +acronym_test.go:12:47: Using the variable on range scope `tc` in function literal (scopelint) + t.Errorf("Abbreviate(%q) = %q, want: %q", tc.input, actual, tc.expected) + ^ +acronym_test.go:22:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:12:5: testCases is a global variable (gochecknoglobals) +var testCases = []acronymTest{ + ^ +acronym_test.go:7:1: Function TestAcronym missing the call to method parallel (paralleltest) +func TestAcronym(t *testing.T) { +^ +acronym_test.go:8:2: Range statement for test TestAcronym missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +acronym_examples_test.go:1:9: package should be `acronym_test` instead of `acronym` (testpackage) +package acronym + ^ +acronym_test.go:1:9: package should be `acronym_test` instead of `acronym` (testpackage) +package acronym + ^ +cases_test.go:1:9: package should be `acronym_test` instead of `acronym` (testpackage) +package acronym + ^ +acronym.go:17:2: variable name 're' is too short for the scope of its usage (varnamelen) + re, e := regexp.Compile(reStr) + ^ +acronym.go:12:6: variable name 'a' is too short for the scope of its usage (varnamelen) + var a string + ^ +acronym.go:11:17: parameter name 's' is too short for the scope of its usage (varnamelen) +func Abbreviate(s string) string { + ^ + +real 0m0.641s +user 0m0.979s +sys 0m0.554s + + + ============================================================================== + +Exit code: -1 + +real 0m0.675s +user 0m1.000s +sys 0m0.585s + +real 0m0.677s +user 0m1.000s +sys 0m0.586s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.017s +sys 0m0.015s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.052s +user 0m0.031s +sys 0m0.033s + + + ============================================================================== + +Exit code: 0 + +real 0m0.082s +user 0m0.051s +sys 0m0.058s + +real 0m0.084s +user 0m0.052s +sys 0m0.059s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.000s +user 0m0.000s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.017s +sys 0m0.025s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "regexp" without types was imported from "acronym" + +real 0m0.091s +user 0m0.123s +sys 0m0.130s + + + ============================================================================== + +Exit code: -1 + +real 0m0.130s +user 0m0.148s +sys 0m0.166s + +real 0m0.132s +user 0m0.149s +sys 0m0.166s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.010s +sys 0m0.018s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.168s +user 0m0.250s +sys 0m0.119s + + + ============================================================================== + +Exit code: 0 + +real 0m0.197s +user 0m0.264s +sys 0m0.148s + +real 0m0.199s +user 0m0.264s +sys 0m0.150s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 -real 0m0.382s -user 0m0.388s -sys 0m0.343s + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.014s +sys 0m0.014s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.788s +user 0m1.823s +sys 0m0.252s + + + ============================================================================== + +Exit code: 0 + +real 0m0.817s +user 0m1.841s +sys 0m0.276s + +real 0m0.818s +user 0m1.842s +sys 0m0.276s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out acronym +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.018s +sys 0m0.022s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.112s +user 0m0.174s +sys 0m0.129s + + + ============================================================================== + +Exit code: 0 + +real 0m0.147s +user 0m0.195s +sys 0m0.161s + +real 0m0.149s +user 0m0.196s +sys 0m0.164s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.015s +sys 0m0.021s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.023s +user 0m0.016s +sys 0m0.022s + + + ============================================================================== + +Exit code: 0 + +real 0m0.059s +user 0m0.037s +sys 0m0.052s + +real 0m0.060s +user 0m0.038s +sys 0m0.053s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.013s +sys 0m0.020s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.432s +user 0m1.323s +sys 0m0.253s + + + ============================================================================== + +Exit code: 0 + +real 0m0.468s +user 0m1.347s +sys 0m0.286s + +real 0m0.470s +user 0m1.348s +sys 0m0.287s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.010s +sys 0m0.021s + + + ============================================================================== + +Running: gocyclo . + +4 acronym BenchmarkAcronym acronym_test.go:18:1 +3 acronym TestAcronym acronym_test.go:7:1 +3 acronym Abbreviate acronym.go:11:1 +1 acronym ExampleAbbreviate acronym_examples_test.go:7:1 + +real 0m0.002s +user 0m0.000s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.031s +user 0m0.019s +sys 0m0.027s + +real 0m0.032s +user 0m0.020s +sys 0m0.028s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + +acronym.go:34:55: "befoer" is a misspelling of "before" +run-tests-go.txt:41:19: "befoer" is a misspelling of "before" +run-tests-go.txt:42:55: "befoer" is a misspelling of "before" +coverage.html:114:62: "befoer" is a misspelling of "before" + +real 0m0.025s +user 0m0.025s +sys 0m0.016s + + + ============================================================================== + +Exit code: 0 + +real 0m0.035s +user 0m0.030s +sys 0m0.026s + +real 0m0.038s +user 0m0.031s +sys 0m0.027s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.021s +sys 0m0.021s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:19:56 Including rules: default +[gosec] 2023/09/07 00:19:56 Excluding rules: default +[gosec] 2023/09/07 00:19:56 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/acronym +[gosec] 2023/09/07 00:19:56 Checking package: acronym +[gosec] 2023/09/07 00:19:56 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/acronym/acronym.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 47 + Nosec : 0 + Issues : 0 + + +real 0m0.107s +user 0m0.122s +sys 0m0.082s + + + ============================================================================== + +Exit code: 0 + +real 0m0.149s +user 0m0.151s +sys 0m0.115s + +real 0m0.151s +user 0m0.152s +sys 0m0.117s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.018s +sys 0m0.018s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestAcronym === RUN TestAcronym/basic === RUN TestAcronym/lowercase_words @@ -38,33 +601,93 @@ go test -v -covermode=count -coverprofile coverage.out acronym --- PASS: ExampleAbbreviate (0.00s) PASS coverage: 85.7% of statements -ok acronym 0.013s coverage: 85.7% of statements +ok acronym 0.005s coverage: 85.7% of statements -real 0m1.055s -user 0m1.253s -sys 0m0.742s +real 0m0.185s +user 0m0.274s +sys 0m0.176s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + acronym/acronym.go:11: Abbreviate 85.7% total: (statements) 85.7% -real 0m0.413s -user 0m0.373s -sys 0m0.324s +real 0m0.073s +user 0m0.090s +sys 0m0.079s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.420s -user 0m0.389s -sys 0m0.409s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic acronym +real 0m0.043s +user 0m0.048s +sys 0m0.064s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +11 func Abbreviate(s string) string { +12 var a string +13 +14 // Since we can't use cases or language, we have to do some pre-processing. +15 reStr := `(["'_;:.]|[[:digit:]])` +16 +17 re, e := regexp.Compile(reStr) +18 if e != nil { +19 // the raw re string is static but you can still make mistakes, better +20 // to panic during tests than quietly "working" incorrectly. +21 MISS panic(e) +22 } +23 +24 a = re.ReplaceAllString(s, "") +25 +26 // Get the title converted string. +27 // Using deprecated function, the test harness doesn't run `go mod tidy` or +28 // it also lacks Internet access. +29 a = strings.ToLower(a) +30 a = strings.Title(a) +31 +32 // Thought about looping through the string to find uppercase letters, +33 // decided on just using regexp to remove everything else instead. +34 // I've tried using the strings IsSomething functions befoer and they're a mess. +35 reStr = `([[:lower:]]|[[:blank:]]|[[:punct:]])` +36 +37 re, e = regexp.Compile(reStr) +38 if e != nil { +39 // the raw re string is static but you can still make mistakes, better +40 // to panic during tests than quietly "working" incorrectly. +41 MISS panic(e) +42 } +43 +44 a = re.ReplaceAllString(a, "") +45 +46 return a +47 } + + +real 0m0.075s +user 0m0.046s +sys 0m0.036s + +real 0m0.075s +user 0m0.046s +sys 0m0.036s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestAcronym === RUN TestAcronym/basic === RUN TestAcronym/lowercase_words @@ -75,119 +698,148 @@ go test -v -race -covermode=atomic acronym === RUN TestAcronym/consecutive_delimiters === RUN TestAcronym/apostrophes === RUN TestAcronym/underscore_emphasis ---- PASS: TestAcronym (0.09s) +--- PASS: TestAcronym (0.00s) --- PASS: TestAcronym/basic (0.00s) --- PASS: TestAcronym/lowercase_words (0.00s) - --- PASS: TestAcronym/punctuation (0.01s) - --- PASS: TestAcronym/all_caps_word (0.01s) - --- PASS: TestAcronym/punctuation_without_whitespace (0.02s) + --- PASS: TestAcronym/punctuation (0.00s) + --- PASS: TestAcronym/all_caps_word (0.00s) + --- PASS: TestAcronym/punctuation_without_whitespace (0.00s) --- PASS: TestAcronym/very_long_abbreviation (0.00s) - --- PASS: TestAcronym/consecutive_delimiters (0.02s) + --- PASS: TestAcronym/consecutive_delimiters (0.00s) --- PASS: TestAcronym/apostrophes (0.00s) - --- PASS: TestAcronym/underscore_emphasis (0.02s) + --- PASS: TestAcronym/underscore_emphasis (0.00s) === RUN ExampleAbbreviate --- PASS: ExampleAbbreviate (0.00s) PASS coverage: 85.7% of statements -ok acronym 0.175s coverage: 85.7% of statements +ok acronym 1.021s coverage: 85.7% of statements -real 0m1.510s -user 0m1.833s -sys 0m0.944s +real 0m1.345s +user 0m0.357s +sys 0m0.198s + + + ============================================================================== + +Exit code: 0 + +real 0m1.760s +user 0m0.841s +sys 0m0.582s + +real 0m1.762s +user 0m0.842s +sys 0m0.583s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: acronym -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkAcronym-4 5791 305661 ns/op 30838 B/op 426 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkAcronym +BenchmarkAcronym-8 20481 57491 ns/op 31138 B/op 426 allocs/op PASS -ok acronym 1.839s +ok acronym 1.718s -real 0m2.645s -user 0m3.681s -sys 0m0.713s +real 0m1.872s +user 0m1.948s +sys 0m0.170s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestAcronym +=== RUN TestAcronym/basic +=== RUN TestAcronym/lowercase_words +=== RUN TestAcronym/punctuation +=== RUN TestAcronym/all_caps_word +=== RUN TestAcronym/punctuation_without_whitespace +=== RUN TestAcronym/very_long_abbreviation +=== RUN TestAcronym/consecutive_delimiters +=== RUN TestAcronym/apostrophes +=== RUN TestAcronym/underscore_emphasis +--- PASS: TestAcronym (0.00s) + --- PASS: TestAcronym/basic (0.00s) + --- PASS: TestAcronym/lowercase_words (0.00s) + --- PASS: TestAcronym/punctuation (0.00s) + --- PASS: TestAcronym/all_caps_word (0.00s) + --- PASS: TestAcronym/punctuation_without_whitespace (0.00s) + --- PASS: TestAcronym/very_long_abbreviation (0.00s) + --- PASS: TestAcronym/consecutive_delimiters (0.00s) + --- PASS: TestAcronym/apostrophes (0.00s) + --- PASS: TestAcronym/underscore_emphasis (0.00s) +=== RUN ExampleAbbreviate +--- PASS: ExampleAbbreviate (0.00s) PASS -ok acronym 0.027s +ok acronym 0.001s -real 0m0.826s -user 0m0.975s -sys 0m0.639s +real 0m0.127s +user 0m0.196s +sys 0m0.145s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m1.144s -user 0m1.412s -sys 0m0.612s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -Acronym-4 174µs ± 0% 306µs ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -Acronym-4 30.9kB ± 0% 30.8kB ± 0% ~ (p=1.000 n=1+1) - -name old allocs/op new allocs/op delta -Acronym-4 426 ± 0% 426 ± 0% ~ (all equal) - -real 0m0.070s -user 0m0.097s -sys 0m0.046s - -=============================================================================== - -go vet acronym - -real 0m0.570s -user 0m0.654s -sys 0m0.461s - -=============================================================================== - -go fix acronym +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: acronym +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Acronym-8 57.49µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Acronym-8 30.41Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Acronym-8 426.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.192s -user 0m0.215s -sys 0m0.137s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Acronym-4 305.7µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +Acronym-4 30.12Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./acronym -[gosec] 2022/07/30 14:00:21 Including rules: default -[gosec] 2022/07/30 14:00:21 Excluding rules: default -[gosec] 2022/07/30 14:00:21 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/acronym -2022/07/30 14:00:21 internal error: package "regexp" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +Acronym-4 426.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.778s -user 0m0.775s -sys 0m0.526s +real 0m0.004s +user 0m0.002s +sys 0m0.002s =============================================================================== gomarkdoc --output acronym-doc.md -real 0m0.049s -user 0m0.024s -sys 0m0.042s +real 0m0.009s +user 0m0.003s +sys 0m0.005s =============================================================================== go doc -all acronym package acronym // import "acronym" -Package acronym converts a phrase to its acronym. The 1st iteration is -better than the second one. +Package acronym converts a phrase to its acronym. The 1st iteration is better +than the second one. FUNCTIONS @@ -195,9 +847,9 @@ func Abbreviate(s string) string Abbreviate returns an acronym from the supplied string. -real 0m0.338s -user 0m0.262s -sys 0m0.350s +real 0m0.042s +user 0m0.019s +sys 0m0.041s =============================================================================== diff --git a/go/airport-robot/benchstat-new.txt b/go/airport-robot/benchstat-new.txt index 725b467a..ebb1812c 100644 --- a/go/airport-robot/benchstat-new.txt +++ b/go/airport-robot/benchstat-new.txt @@ -1,2 +1,2 @@ PASS -ok airportrobot 0.002s +ok airportrobot 0.009s diff --git a/go/airport-robot/benchstat-old.txt b/go/airport-robot/benchstat-old.txt new file mode 100644 index 00000000..725b467a --- /dev/null +++ b/go/airport-robot/benchstat-old.txt @@ -0,0 +1,2 @@ +PASS +ok airportrobot 0.002s diff --git a/go/airport-robot/run-tests-go.txt b/go/airport-robot/run-tests-go.txt index 927c5ee2..16159741 100644 --- a/go/airport-robot/run-tests-go.txt +++ b/go/airport-robot/run-tests-go.txt @@ -5,81 +5,442 @@ Go packages: airportrobot =============================================================================== -golangci-lint run ./... +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.234s -user 0m0.403s -sys 0m0.257s +Running GoLangCi-Lint -=============================================================================== +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== -golint ./... +Running: go clean ./... -real 0m0.010s -user 0m0.006s -sys 0m0.009s + +real 0m0.023s +user 0m0.014s +sys 0m0.031s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +airport_robot.go:6:30: Comment should end in a period (godot) +// Greeter language interface + ^ +airport_robot.go:12:30: Comment should end in a period (godot) +// SayHello in many languates + ^ +airport_robot.go:20:29: Comment should end in a period (godot) +// German language interface + ^ +airport_robot_test.go:25:23: Using the variable on range scope `tt` in function literal (scopelint) + if got := SayHello(tt.name, Italian{}); got != tt.want { + ^ +airport_robot_test.go:26:59: Using the variable on range scope `tt` in function literal (scopelint) + t.Errorf("SayHello(%q, \"Italian{}\") = %q, want %q", tt.name, got, tt.want) + ^ +airport_robot_test.go:52:23: Using the variable on range scope `tt` in function literal (scopelint) + if got := SayHello(tt.name, Portuguese{}); got != tt.want { + ^ +airport_robot.go:17:2: return statements should not be cuddled if block has more than two lines (wsl) + return response + ^ +airport_robot.go:31:2: return with no blank line before (nlreturn) + return response + ^ +airport_robot.go:45:2: return with no blank line before (nlreturn) + return response + ^ +airport_robot.go:59:2: return with no blank line before (nlreturn) + return response + ^ +airport_robot_test.go:5:1: Function TestSayHello_Italien missing the call to method parallel (paralleltest) +func TestSayHello_Italien(t *testing.T) { +^ +airport_robot_test.go:23:2: Range statement for test TestSayHello_Italien missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +airport_robot_test.go:32:1: Function TestSayHello_Portuguese missing the call to method parallel (paralleltest) +func TestSayHello_Portuguese(t *testing.T) { +^ +airport_robot_test.go:50:2: Range statement for test TestSayHello_Portuguese missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +airport_robot_examples_test.go:1:9: package should be `airportrobot_test` instead of `airportrobot` (testpackage) +package airportrobot + ^ +airport_robot_test.go:1:9: package should be `airportrobot_test` instead of `airportrobot` (testpackage) +package airportrobot + ^ + +real 0m0.425s +user 0m0.645s +sys 0m0.360s + + + ============================================================================== + +Exit code: -1 + +real 0m0.465s +user 0m0.665s +sys 0m0.405s + +real 0m0.468s +user 0m0.666s +sys 0m0.408s =============================================================================== -revive -formatter=stylish ./... +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.013s +sys 0m0.020s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.030s +user 0m0.016s +sys 0m0.021s + + + ============================================================================== + +Exit code: 0 -real 0m0.008s -user 0m0.004s -sys 0m0.005s +real 0m0.056s +user 0m0.032s +sys 0m0.048s + +real 0m0.057s +user 0m0.033s +sys 0m0.050s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.099s -user 0m0.170s -sys 0m0.103s +real 0m0.001s +user 0m0.000s +sys 0m0.001s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.018s +sys 0m0.018s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." internal error: package "fmt" without types was imported from "airportrobot" -real 0m0.117s -user 0m0.222s -sys 0m0.193s +real 0m0.088s +user 0m0.138s +sys 0m0.116s -=============================================================================== -staticcheck ./... + ============================================================================== + +Exit code: -1 -real 0m0.148s -user 0m0.211s -sys 0m0.142s +real 0m0.131s +user 0m0.163s +sys 0m0.150s + +real 0m0.132s +user 0m0.165s +sys 0m0.150s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + -real 0m0.774s -user 0m2.757s -sys 0m0.422s + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.033s +sys 0m0.030s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.163s +user 0m0.196s +sys 0m0.123s + + + ============================================================================== + +Exit code: 0 + +real 0m0.210s +user 0m0.234s +sys 0m0.166s + +real 0m0.211s +user 0m0.235s +sys 0m0.167s =============================================================================== -go vet ./... +Running: ../../.github/citools/go/go-lint-gocritic -real 0m0.097s -user 0m0.243s -sys 0m0.178s +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.024s +sys 0m0.031s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.810s +user 0m1.861s +sys 0m0.324s + + + ============================================================================== + +Exit code: 0 + +real 0m0.854s +user 0m1.890s +sys 0m0.370s + +real 0m0.856s +user 0m1.891s +sys 0m0.370s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + real 0m0.023s -user 0m0.021s +user 0m0.016s +sys 0m0.021s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.077s +user 0m0.111s +sys 0m0.100s + + + ============================================================================== + +Exit code: 0 + +real 0m0.111s +user 0m0.131s +sys 0m0.132s + +real 0m0.113s +user 0m0.133s +sys 0m0.132s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.017s +sys 0m0.015s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.022s +user 0m0.014s sys 0m0.027s + + ============================================================================== + +Exit code: 0 + +real 0m0.052s +user 0m0.034s +sys 0m0.054s + +real 0m0.054s +user 0m0.036s +sys 0m0.054s + =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.021s +sys 0m0.026s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.439s +user 0m1.259s +sys 0m0.292s + + + ============================================================================== + +Exit code: 0 + +real 0m0.475s +user 0m1.284s +sys 0m0.330s + +real 0m0.477s +user 0m1.284s +sys 0m0.333s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.034s +user 0m0.027s +sys 0m0.028s + + + ============================================================================== + +Running: gocyclo . + 3 airportrobot TestSayHello_Portuguese airport_robot_test.go:32:1 3 airportrobot TestSayHello_Italien airport_robot_test.go:5:1 1 airportrobot ExampleSayHello airport_robot_examples_test.go:5:1 @@ -91,33 +452,139 @@ gocyclo . 1 airportrobot (German).LanguageName airport_robot.go:24:1 1 airportrobot SayHello airport_robot.go:13:1 -real 0m0.002s +real 0m0.003s user 0m0.000s -sys 0m0.002s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.047s +user 0m0.032s +sys 0m0.040s + +real 0m0.049s +user 0m0.032s +sys 0m0.042s =============================================================================== -misspell . +Running: ../../.github/citools/go/go-lint-misspell -real 0m0.025s -user 0m0.023s -sys 0m0.020s +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.032s +user 0m0.039s +sys 0m0.011s + + + ============================================================================== + +Exit code: 0 + +real 0m0.048s +user 0m0.047s +sys 0m0.026s + +real 0m0.051s +user 0m0.047s +sys 0m0.029s =============================================================================== -gosec ./... -[gosec] 2023/03/04 20:22:43 Including rules: default -[gosec] 2023/03/04 20:22:43 Excluding rules: default -[gosec] 2023/03/04 20:22:43 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/airport-robot -2023/03/04 20:22:43 internal error: package "fmt" without types was imported from "command-line-arguments" +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.025s +sys 0m0.022s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:20:02 Including rules: default +[gosec] 2023/09/07 00:20:02 Excluding rules: default +[gosec] 2023/09/07 00:20:02 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/airport-robot +[gosec] 2023/09/07 00:20:02 Checking package: airportrobot +[gosec] 2023/09/07 00:20:02 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/airport-robot/airport_robot.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 60 + Nosec : 0 + Issues : 0 + real 0m0.116s -user 0m0.153s -sys 0m0.109s +user 0m0.126s +sys 0m0.092s + + + ============================================================================== + +Exit code: 0 + +real 0m0.155s +user 0m0.156s +sys 0m0.128s + +real 0m0.157s +user 0m0.158s +sys 0m0.129s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.021s +sys 0m0.023s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestSayHello_Italien === RUN TestSayHello_Italien/name_without_spaces === RUN TestSayHello_Italien/full_name @@ -133,16 +600,18 @@ gotest -v -covermode=count -coverprofile coverage.out ./... === RUN ExampleSayHello --- PASS: ExampleSayHello (0.00s) PASS - airportrobot coverage: 100.0% of statements -ok airportrobot 0.003s coverage: 100.0% of statements +coverage: 100.0% of statements +ok airportrobot 0.002s coverage: 100.0% of statements -real 0m0.185s -user 0m0.325s -sys 0m0.209s +real 0m0.182s +user 0m0.190s +sys 0m0.178s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + airportrobot/airport_robot.go:13: SayHello 100.0% airportrobot/airport_robot.go:24: LanguageName 100.0% airportrobot/airport_robot.go:29: Greet 100.0% @@ -152,29 +621,40 @@ airportrobot/airport_robot.go:52: LanguageName 100.0% airportrobot/airport_robot.go:57: Greet 100.0% total: (statements) 100.0% -real 0m0.060s -user 0m0.098s -sys 0m0.099s +real 0m0.054s +user 0m0.068s +sys 0m0.066s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.065s -user 0m0.101s -sys 0m0.083s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +real 0m0.052s +user 0m0.086s +sys 0m0.064s -real 0m0.021s -user 0m0.018s -sys 0m0.024s -=============================================================================== + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.078s +user 0m0.041s +sys 0m0.035s + +real 0m0.078s +user 0m0.041s +sys 0m0.035s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestSayHello_Italien === RUN TestSayHello_Italien/name_without_spaces === RUN TestSayHello_Italien/full_name @@ -190,22 +670,38 @@ gotest -v -race -covermode=atomic ./... === RUN ExampleSayHello --- PASS: ExampleSayHello (0.00s) PASS - airportrobot coverage: 100.0% of statements -ok airportrobot (cached) coverage: 100.0% of statements +coverage: 100.0% of statements +ok airportrobot 1.016s coverage: 100.0% of statements + +real 0m1.243s +user 0m0.262s +sys 0m0.155s + + + ============================================================================== + +Exit code: 0 + +real 0m1.647s +user 0m0.674s +sys 0m0.532s -real 0m0.119s -user 0m0.228s -sys 0m0.179s +real 0m1.650s +user 0m0.675s +sys 0m0.535s =============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt PASS -ok airportrobot 0.002s +ok airportrobot 0.009s -real 0m0.149s -user 0m0.292s -sys 0m0.233s +real 0m0.170s +user 0m0.213s +sys 0m0.204s =============================================================================== @@ -227,21 +723,25 @@ gotest -v -tags bonus PASS ok airportrobot 0.002s -real 0m0.139s -user 0m0.263s -sys 0m0.189s +real 0m0.134s +user 0m0.162s +sys 0m0.110s =============================================================================== -No old benchmarks to run benchstat against. +benchstat benchstat-old.txt benchstat-new.txt + +real 0m0.002s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output airportrobot-doc.md -real 0m0.013s -user 0m0.006s -sys 0m0.006s +real 0m0.012s +user 0m0.009s +sys 0m0.003s =============================================================================== @@ -293,7 +793,7 @@ func (s Portuguese) LanguageName() string real 0m0.042s -user 0m0.036s +user 0m0.028s sys 0m0.038s diff --git a/go/all-your-base/allyourbase-doc.md b/go/all-your-base/allyourbase-doc.md index a8c188ee..7ff5056c 100755 --- a/go/all-your-base/allyourbase-doc.md +++ b/go/all-your-base/allyourbase-doc.md @@ -6,7 +6,7 @@ import "allyourbase" ``` -Package allyourbase is used to convert from any base to any other base\. +Package allyourbase is used to convert from any base to any other base. ## Index @@ -23,7 +23,7 @@ Package allyourbase is used to convert from any base to any other base\. func ConvertFromBase10(outputBase int, inputNum int) []int ``` -ConvertFromBase10 returns a base x number\. It didn't make sense to pass the functions an int slice so I'm hiding that part of the algorithm in the function\. +ConvertFromBase10 returns a base x number. It didn't make sense to pass the functions an int slice so I'm hiding that part of the algorithm in the function.

Example

@@ -55,7 +55,7 @@ number: []int{1, 0, 1}, base: 2 func ConvertIntToIntList(num int) []int ``` -ConvertIntToIntList returns a list of intergers for the passed int\. +ConvertIntToIntList returns a list of intergers for the passed int. ## func [ConvertStrToIntList]() @@ -63,7 +63,7 @@ ConvertIntToIntList returns a list of intergers for the passed int\. func ConvertStrToIntList(inputStr string) []int ``` -ConvertStrToIntList returns a list of intergers for the passed string\. +ConvertStrToIntList returns a list of intergers for the passed string.

Example

@@ -94,7 +94,7 @@ list: []int{1, 2, 3, 4, 5} func ConvertToBase(inputBase int, inputDigits []int, outputBase int) ([]int, error) ``` -ConvertToBase returns an integer slice of converted numbers\. +ConvertToBase returns an integer slice of converted numbers.

Example

@@ -123,7 +123,7 @@ base 2 [1 0 1] to base 10 [5] func ConvertToBase10(inputBase int, inputDigits []int) int ``` -ConvertToBase10 returns a base 10 number\. +ConvertToBase10 returns a base 10 number.

Example

diff --git a/go/all-your-base/allyourbase-doc.txt b/go/all-your-base/allyourbase-doc.txt index 5fe507ca..9a90c0ca 100644 --- a/go/all-your-base/allyourbase-doc.txt +++ b/go/all-your-base/allyourbase-doc.txt @@ -5,8 +5,8 @@ Package allyourbase is used to convert from any base to any other base. FUNCTIONS func ConvertFromBase10(outputBase int, inputNum int) []int - ConvertFromBase10 returns a base x number. It didn't make sense to pass the - functions an int slice so I'm hiding that part of the algorithm in the + ConvertFromBase10 returns a base x number. It didn't make sense to pass + the functions an int slice so I'm hiding that part of the algorithm in the function. func ConvertIntToIntList(num int) []int diff --git a/go/all-your-base/benchstat-new.txt b/go/all-your-base/benchstat-new.txt index a934d9fc..096bdd83 100644 --- a/go/all-your-base/benchstat-new.txt +++ b/go/all-your-base/benchstat-new.txt @@ -1,2 +1,2 @@ PASS -ok allyourbase 0.019s +ok allyourbase 0.002s diff --git a/go/all-your-base/benchstat-old.txt b/go/all-your-base/benchstat-old.txt index e6d27adf..a934d9fc 100644 --- a/go/all-your-base/benchstat-old.txt +++ b/go/all-your-base/benchstat-old.txt @@ -1,2 +1,2 @@ PASS -ok allyourbase 0.028s +ok allyourbase 0.019s diff --git a/go/all-your-base/coverage-annotations.txt b/go/all-your-base/coverage-annotations.txt new file mode 100644 index 00000000..8b3d69f6 --- /dev/null +++ b/go/all-your-base/coverage-annotations.txt @@ -0,0 +1,65 @@ + +108 func ConvertStrToIntList(inputStr string) []int { +109 outputDigits := []int{} +110 +111 for _, s := range inputStr { +112 n, e := strconv.Atoi(string(s)) +113 +114 if e != nil { +115 MISS panic(e) +116 } +117 +118 outputDigits = append(outputDigits, n) +119 } +120 +121 return outputDigits +122 } + + +12 func ConvertToBase(inputBase int, inputDigits []int, outputBase int) ([]int, error) { +13 var baseTenDigits int +14 var outputDigits []int +15 +16 inputDigits, e := quickChecks(inputBase, outputBase, inputDigits) +17 +18 // If an error was picked up by quickChecks(), return it with a zero value int list. +19 if e != nil { +20 return inputDigits, e +21 } +22 +23 // If zero, return zero. +24 if len(inputDigits) == 1 && inputDigits[0] == 0 { +25 return inputDigits, nil +26 } +27 +28 // 1. Convert number from base x to base 10. +29 if inputBase == 10 { +30 var tmpStr string +31 for _, n := range inputDigits { +32 tmpStr += fmt.Sprintf("%d", n) +33 } +34 i, e := strconv.Atoi(tmpStr) +35 +36 if e != nil { +37 MISS panic(e) +38 } +39 +40 baseTenDigits = i +41 } else { +42 baseTenDigits = ConvertToBase10(inputBase, inputDigits) +43 // fmt.Printf("base: %d\tbaseTenDigits: %#v\n", outputBase, baseTenDigits) +44 } +45 +46 // 2. Convert from base 10 to base y. +47 if outputBase == 10 { +48 outputDigits = ConvertIntToIntList(baseTenDigits) +49 // fmt.Printf("base: %d\toutputDigits: %#v\n", outputBase, outputDigits) +50 return outputDigits, nil +51 } +52 +53 outputDigits = ConvertFromBase10(outputBase, baseTenDigits) +54 // fmt.Printf("base: %d\toutputDigits: %#v\n", outputBase, outputDigits) +55 +56 return outputDigits, nil +57 } + diff --git a/go/all-your-base/coverage.out b/go/all-your-base/coverage.out index bc4499fe..6989f458 100644 --- a/go/all-your-base/coverage.out +++ b/go/all-your-base/coverage.out @@ -1,44 +1,44 @@ mode: count allyourbase/all_your_base.go:12.85,19.14 4 22 -allyourbase/all_your_base.go:24.2,24.50 1 13 -allyourbase/all_your_base.go:29.2,29.21 1 10 -allyourbase/all_your_base.go:47.2,47.22 1 10 -allyourbase/all_your_base.go:53.2,56.26 2 5 allyourbase/all_your_base.go:19.14,21.3 1 9 +allyourbase/all_your_base.go:24.2,24.50 1 13 allyourbase/all_your_base.go:24.50,26.3 1 3 +allyourbase/all_your_base.go:29.2,29.21 1 10 allyourbase/all_your_base.go:29.21,31.33 2 2 -allyourbase/all_your_base.go:34.3,36.15 2 2 -allyourbase/all_your_base.go:40.3,40.20 1 2 allyourbase/all_your_base.go:31.33,33.4 1 3 +allyourbase/all_your_base.go:34.3,36.15 2 2 allyourbase/all_your_base.go:36.15,37.12 1 0 +allyourbase/all_your_base.go:40.3,40.20 1 2 allyourbase/all_your_base.go:41.8,44.3 1 8 +allyourbase/all_your_base.go:47.2,47.22 1 10 allyourbase/all_your_base.go:47.22,51.3 2 5 +allyourbase/all_your_base.go:53.2,56.26 2 5 allyourbase/all_your_base.go:61.83,62.19 1 22 -allyourbase/all_your_base.go:66.2,66.20 1 18 -allyourbase/all_your_base.go:70.2,70.27 1 15 -allyourbase/all_your_base.go:74.2,75.32 2 14 -allyourbase/all_your_base.go:78.2,78.14 1 14 -allyourbase/all_your_base.go:82.2,82.32 1 12 -allyourbase/all_your_base.go:88.2,88.25 1 10 allyourbase/all_your_base.go:62.19,64.3 1 4 +allyourbase/all_your_base.go:66.2,66.20 1 18 allyourbase/all_your_base.go:66.20,68.3 1 3 +allyourbase/all_your_base.go:70.2,70.27 1 15 allyourbase/all_your_base.go:70.27,72.3 1 1 +allyourbase/all_your_base.go:74.2,75.32 2 14 allyourbase/all_your_base.go:75.32,77.3 1 44 +allyourbase/all_your_base.go:78.2,78.14 1 14 allyourbase/all_your_base.go:78.14,80.3 1 2 +allyourbase/all_your_base.go:82.2,82.32 1 12 allyourbase/all_your_base.go:82.32,83.30 1 32 allyourbase/all_your_base.go:83.30,85.4 1 2 +allyourbase/all_your_base.go:88.2,88.25 1 10 allyourbase/all_your_base.go:93.32,95.2 1 28 allyourbase/all_your_base.go:98.41,105.2 3 5 allyourbase/all_your_base.go:108.49,111.29 2 6 -allyourbase/all_your_base.go:121.2,121.21 1 6 allyourbase/all_your_base.go:111.29,114.15 2 12 -allyourbase/all_your_base.go:118.3,118.41 1 12 allyourbase/all_your_base.go:114.15,115.12 1 0 +allyourbase/all_your_base.go:118.3,118.41 1 12 +allyourbase/all_your_base.go:121.2,121.21 1 6 allyourbase/all_your_base.go:125.60,132.32 4 9 -allyourbase/all_your_base.go:141.2,141.21 1 9 allyourbase/all_your_base.go:132.32,137.3 3 28 +allyourbase/all_your_base.go:141.2,141.21 1 9 allyourbase/all_your_base.go:147.60,156.12 6 6 -allyourbase/all_your_base.go:164.2,164.43 1 6 -allyourbase/all_your_base.go:169.2,169.21 1 6 allyourbase/all_your_base.go:156.12,161.3 3 21 +allyourbase/all_your_base.go:164.2,164.43 1 6 allyourbase/all_your_base.go:164.43,166.3 1 21 +allyourbase/all_your_base.go:169.2,169.21 1 6 diff --git a/go/all-your-base/run-tests-go.txt b/go/all-your-base/run-tests-go.txt index 068ea839..99b5fec0 100644 --- a/go/all-your-base/run-tests-go.txt +++ b/go/all-your-base/run-tests-go.txt @@ -5,15 +5,656 @@ Go packages: allyourbase =============================================================================== -golint allyourbase +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.568s -user 0m0.669s -sys 0m0.445s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.037s +user 0m0.029s +sys 0m0.037s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +all_your_base.go:99: File is not `gofumpt`-ed (gofumpt) + +all_your_base_test.go:14: line is 125 characters (lll) + t.Errorf("ConvertToBase(%d, %#v, %d) expected error: %q", tc.inputBase, tc.inputDigits, tc.outputBase, tc.expectedError) +all_your_base_test.go:16: line is 148 characters (lll) + t.Errorf("ConvertToBase(%d, %#v, %d)\nexpected error: %q\ngot: %q", tc.inputBase, tc.inputDigits, tc.outputBase, tc.expectedError, err.Error()) +all_your_base_test.go:19: line is 124 characters (lll) + t.Errorf("ConvertToBase(%d, %#v, %d) = %#v, want:%#v", tc.inputBase, tc.inputDigits, tc.outputBase, actual, tc.expected) +all_your_base.go:148:19: var-declaration: should omit type []int from declaration of var outputDigits; it will be inferred from the right-hand side (revive) + var outputDigits []int = []int{} + ^ +all_your_base.go:149:16: var-declaration: should omit type []int from declaration of var tmpDigits; it will be inferred from the right-hand side (revive) + var tmpDigits []int = []int{} + ^ +all_your_base.go:150:10: var-declaration: should omit type int from declaration of var num; it will be inferred from the right-hand side (revive) + var num int = inputNum + ^ +all_your_base_test.go:11:33: Using the variable on range scope `tc` in function literal (scopelint) + actual, err := ConvertToBase(tc.inputBase, tc.inputDigits, tc.outputBase) + ^ +all_your_base_test.go:12:7: Using the variable on range scope `tc` in function literal (scopelint) + if tc.expectedError != "" { + ^ +all_your_base_test.go:15:15: Using the variable on range scope `tc` in function literal (scopelint) + } else if tc.expectedError != err.Error() { + ^ +all_your_base.go:94:20: unnecessary conversion (unconvert) + return int(float64(math.Pow(float64(n), float64(p)))) + ^ +all_your_base.go:133:10: unnecessary conversion (unconvert) + r = int(n * mathPow(inputBase, p)) + ^ +all_your_base.go:98: unnecessary leading newline (whitespace) +func ConvertIntToIntList(num int) []int { + +all_your_base.go:14:2: declarations should never be cuddled (wsl) + var outputDigits []int + ^ +all_your_base.go:34:3: assignments should only be cuddled with other assignments (wsl) + i, e := strconv.Atoi(tmpStr) + ^ +all_your_base.go:78:2: if statements should only be cuddled with assignments (wsl) + if sum == 0 { + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +all_your_base.go:63:19: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"input base must be >= 2\")" (goerr113) + return []int{}, errors.New("input base must be >= 2") + ^ +all_your_base.go:67:19: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"output base must be >= 2\")" (goerr113) + return []int{}, errors.New("output base must be >= 2") + ^ +all_your_base.go:84:20: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"all digits must satisfy 0 <= d < input base\")" (goerr113) + return []int{}, errors.New("all digits must satisfy 0 <= d < input base") + ^ +all_your_base.go:29:18: mnd: Magic number: 10, in detected (gomnd) + if inputBase == 10 { + ^ +all_your_base.go:47:19: mnd: Magic number: 10, in detected (gomnd) + if outputBase == 10 { + ^ +all_your_base.go:62:17: mnd: Magic number: 2, in detected (gomnd) + if inputBase < 2 { + ^ +all_your_base.go:66:18: mnd: Magic number: 2, in detected (gomnd) + if outputBase < 2 { + ^ +all_your_base_test.go:8:1: Function TestConvertToBase missing the call to method parallel (paralleltest) +func TestConvertToBase(t *testing.T) { +^ +all_your_base_test.go:9:2: Range statement for test TestConvertToBase missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +all_your_base_examples_test.go:1:9: package should be `allyourbase_test` instead of `allyourbase` (testpackage) +package allyourbase + ^ +all_your_base_test.go:1:9: package should be `allyourbase_test` instead of `allyourbase` (testpackage) +package allyourbase + ^ +cases_test.go:1:9: package should be `allyourbase_test` instead of `allyourbase` (testpackage) +package allyourbase + ^ +all_your_base.go:128:2: variable name 'p' is too short for the scope of its usage (varnamelen) + p := len(inputDigits) - 1 + ^ +all_your_base.go:152:6: variable name 'q' is too short for the scope of its usage (varnamelen) + var q, r int + ^ +all_your_base.go:112:3: variable name 'n' is too short for the scope of its usage (varnamelen) + n, e := strconv.Atoi(string(s)) + ^ +all_your_base.go:130:6: variable name 'r' is too short for the scope of its usage (varnamelen) + var r int + ^ + +real 0m0.558s +user 0m0.806s +sys 0m0.547s + + + ============================================================================== + +Exit code: -1 + +real 0m0.610s +user 0m0.842s +sys 0m0.599s + +real 0m0.614s +user 0m0.846s +sys 0m0.604s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.024s +sys 0m0.023s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +all_your_base.go + (148, 19) https://revive.run/r#var-declaration should omit type []int from declaration of var outputDigits; it will be inferred from the right-hand side + (149, 16) https://revive.run/r#var-declaration should omit type []int from declaration of var tmpDigits; it will be inferred from the right-hand side + (150, 10) https://revive.run/r#var-declaration should omit type int from declaration of var num; it will be inferred from the right-hand side + + + ✖ 3 problems (0 errors) (3 warnings) + +real 0m0.087s +user 0m0.038s +sys 0m0.073s + + + ============================================================================== + +Exit code: 0 + +real 0m0.122s +user 0m0.066s +sys 0m0.105s + +real 0m0.125s +user 0m0.068s +sys 0m0.107s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.000s +user 0m0.000s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.012s +sys 0m0.030s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "errors" without types was imported from "allyourbase" + +real 0m0.079s +user 0m0.124s +sys 0m0.094s + + + ============================================================================== + +Exit code: -1 + +real 0m0.113s +user 0m0.142s +sys 0m0.133s + +real 0m0.114s +user 0m0.143s +sys 0m0.134s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.021s +sys 0m0.023s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +all_your_base.go:148:19: should omit type []int from declaration; it will be inferred from the right-hand side (ST1023) +all_your_base.go:149:16: should omit type []int from declaration; it will be inferred from the right-hand side (ST1023) +all_your_base.go:150:10: should omit type int from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.175s +user 0m0.248s +sys 0m0.111s + + + ============================================================================== + +Exit code: -1 + +real 0m0.206s +user 0m0.272s +sys 0m0.145s + +real 0m0.207s +user 0m0.273s +sys 0m0.146s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.024s +sys 0m0.013s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./all_your_base.go:43:3: commentedOutCode: may want to remove commented-out code +./all_your_base.go:49:3: commentedOutCode: may want to remove commented-out code +./all_your_base.go:54:2: commentedOutCode: may want to remove commented-out code +./all_your_base.go:139:2: commentedOutCode: may want to remove commented-out code +./all_your_base.go:162:2: commentedOutCode: may want to remove commented-out code +./all_your_base.go:167:2: commentedOutCode: may want to remove commented-out code +./all_your_base.go:61:1: paramTypeCombine: func(inputBase int, outputBase int, inputDigits []int) ([]int, error) could be replaced with func(inputBase, outputBase int, inputDigits []int) ([]int, error) +./all_your_base.go:93:1: paramTypeCombine: func(n int, p int) int could be replaced with func(n, p int) int +./all_your_base.go:147:1: paramTypeCombine: func(outputBase int, inputNum int) []int could be replaced with func(outputBase, inputNum int) []int +./all_your_base_examples_test.go:17:2: commentedOutCode: may want to remove commented-out code + +real 0m0.808s +user 0m1.869s +sys 0m0.303s + + + ============================================================================== + +Exit code: -1 + +real 0m0.843s +user 0m1.899s +sys 0m0.328s + +real 0m0.845s +user 0m1.901s +sys 0m0.329s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.028s +sys 0m0.034s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.083s +user 0m0.121s +sys 0m0.106s + + + ============================================================================== + +Exit code: 0 + +real 0m0.128s +user 0m0.156s +sys 0m0.152s + +real 0m0.131s +user 0m0.158s +sys 0m0.152s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.027s +sys 0m0.032s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.027s +user 0m0.022s +sys 0m0.023s + + + ============================================================================== + +Exit code: 0 + +real 0m0.067s +user 0m0.056s +sys 0m0.063s + +real 0m0.069s +user 0m0.056s +sys 0m0.065s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.034s +user 0m0.035s +sys 0m0.030s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.437s +user 0m1.346s +sys 0m0.255s + + + ============================================================================== + +Exit code: 0 + +real 0m0.487s +user 0m1.389s +sys 0m0.298s + +real 0m0.489s +user 0m1.390s +sys 0m0.298s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out allyourbase +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.029s +sys 0m0.025s + + + ============================================================================== + +Running: gocyclo . + +9 allyourbase quickChecks all_your_base.go:61:1 +8 allyourbase ConvertToBase all_your_base.go:12:1 +6 allyourbase TestConvertToBase all_your_base_test.go:8:1 +3 allyourbase ConvertFromBase10 all_your_base.go:147:1 +3 allyourbase ConvertStrToIntList all_your_base.go:108:1 +2 allyourbase ConvertToBase10 all_your_base.go:125:1 +1 allyourbase ExampleConvertStrToIntList all_your_base_examples_test.go:43:1 +1 allyourbase ExampleConvertFromBase10 all_your_base_examples_test.go:32:1 +1 allyourbase ExampleConvertToBase10 all_your_base_examples_test.go:21:1 +1 allyourbase ExamplemathPow all_your_base_examples_test.go:15:1 +1 allyourbase ExampleConvertToBase all_your_base_examples_test.go:7:1 +1 allyourbase ConvertIntToIntList all_your_base.go:98:1 +1 allyourbase mathPow all_your_base.go:93:1 + +real 0m0.002s +user 0m0.001s +sys 0m0.001s + + + ============================================================================== + +Exit code: 0 + +real 0m0.042s +user 0m0.035s +sys 0m0.037s + +real 0m0.044s +user 0m0.035s +sys 0m0.038s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.025s +user 0m0.028s +sys 0m0.011s + + + ============================================================================== + +Exit code: 0 + +real 0m0.037s +user 0m0.036s +sys 0m0.018s + +real 0m0.039s +user 0m0.037s +sys 0m0.019s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.023s +sys 0m0.035s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:20:14 Including rules: default +[gosec] 2023/09/07 00:20:14 Excluding rules: default +[gosec] 2023/09/07 00:20:14 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/all-your-base +[gosec] 2023/09/07 00:20:14 Checking package: allyourbase +[gosec] 2023/09/07 00:20:14 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/all-your-base/all_your_base.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 170 + Nosec : 0 + Issues : 0 + + +real 0m0.123s +user 0m0.126s +sys 0m0.121s + + + ============================================================================== + +Exit code: 0 + +real 0m0.164s +user 0m0.154s +sys 0m0.166s + +real 0m0.166s +user 0m0.155s +sys 0m0.168s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.034s +user 0m0.024s +sys 0m0.039s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestConvertToBase === RUN TestConvertToBase/single_bit_one_to_decimal === RUN TestConvertToBase/binary_to_single_decimal @@ -68,15 +709,17 @@ go test -v -covermode=count -coverprofile coverage.out allyourbase --- PASS: ExampleConvertStrToIntList (0.00s) PASS coverage: 97.0% of statements -ok allyourbase 0.007s coverage: 97.0% of statements +ok allyourbase 0.006s coverage: 97.0% of statements -real 0m1.209s -user 0m1.536s -sys 0m0.781s +real 0m0.171s +user 0m0.210s +sys 0m0.145s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + allyourbase/all_your_base.go:12: ConvertToBase 95.2% allyourbase/all_your_base.go:61: quickChecks 100.0% allyourbase/all_your_base.go:93: mathPow 100.0% @@ -86,21 +729,105 @@ allyourbase/all_your_base.go:125: ConvertToBase10 100.0% allyourbase/all_your_base.go:147: ConvertFromBase10 100.0% total: (statements) 97.0% -real 0m0.489s -user 0m0.586s -sys 0m0.393s +real 0m0.052s +user 0m0.070s +sys 0m0.065s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.415s -user 0m0.537s -sys 0m0.353s +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.049s +user 0m0.077s +sys 0m0.066s -=============================================================================== -go test -v -race -covermode=atomic allyourbase + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +108 func ConvertStrToIntList(inputStr string) []int { +109 outputDigits := []int{} +110 +111 for _, s := range inputStr { +112 n, e := strconv.Atoi(string(s)) +113 +114 if e != nil { +115 MISS panic(e) +116 } +117 +118 outputDigits = append(outputDigits, n) +119 } +120 +121 return outputDigits +122 } + + +12 func ConvertToBase(inputBase int, inputDigits []int, outputBase int) ([]int, error) { +13 var baseTenDigits int +14 var outputDigits []int +15 +16 inputDigits, e := quickChecks(inputBase, outputBase, inputDigits) +17 +18 // If an error was picked up by quickChecks(), return it with a zero value int list. +19 if e != nil { +20 return inputDigits, e +21 } +22 +23 // If zero, return zero. +24 if len(inputDigits) == 1 && inputDigits[0] == 0 { +25 return inputDigits, nil +26 } +27 +28 // 1. Convert number from base x to base 10. +29 if inputBase == 10 { +30 var tmpStr string +31 for _, n := range inputDigits { +32 tmpStr += fmt.Sprintf("%d", n) +33 } +34 i, e := strconv.Atoi(tmpStr) +35 +36 if e != nil { +37 MISS panic(e) +38 } +39 +40 baseTenDigits = i +41 } else { +42 baseTenDigits = ConvertToBase10(inputBase, inputDigits) +43 // fmt.Printf("base: %d\tbaseTenDigits: %#v\n", outputBase, baseTenDigits) +44 } +45 +46 // 2. Convert from base 10 to base y. +47 if outputBase == 10 { +48 outputDigits = ConvertIntToIntList(baseTenDigits) +49 // fmt.Printf("base: %d\toutputDigits: %#v\n", outputBase, outputDigits) +50 return outputDigits, nil +51 } +52 +53 outputDigits = ConvertFromBase10(outputBase, baseTenDigits) +54 // fmt.Printf("base: %d\toutputDigits: %#v\n", outputBase, outputDigits) +55 +56 return outputDigits, nil +57 } + + +real 0m0.018s +user 0m0.019s +sys 0m0.019s + +real 0m0.018s +user 0m0.019s +sys 0m0.019s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestConvertToBase === RUN TestConvertToBase/single_bit_one_to_decimal === RUN TestConvertToBase/binary_to_single_decimal @@ -123,7 +850,7 @@ go test -v -race -covermode=atomic allyourbase === RUN TestConvertToBase/output_base_is_zero === RUN TestConvertToBase/output_base_is_negative === RUN TestConvertToBase/both_bases_are_negative ---- PASS: TestConvertToBase (0.01s) +--- PASS: TestConvertToBase (0.00s) --- PASS: TestConvertToBase/single_bit_one_to_decimal (0.00s) --- PASS: TestConvertToBase/binary_to_single_decimal (0.00s) --- PASS: TestConvertToBase/single_decimal_to_binary (0.00s) @@ -155,84 +882,115 @@ go test -v -race -covermode=atomic allyourbase --- PASS: ExampleConvertStrToIntList (0.00s) PASS coverage: 97.0% of statements -ok allyourbase 0.056s coverage: 97.0% of statements - -real 0m1.478s -user 0m1.837s -sys 0m0.748s - -=============================================================================== +ok allyourbase 1.020s coverage: 97.0% of statements -mv -v benchstat-new.txt benchstat-old.txt -renamed 'benchstat-new.txt' -> 'benchstat-old.txt' +real 0m1.273s +user 0m0.279s +sys 0m0.148s -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -PASS -ok allyourbase 0.019s -real 0m1.079s -user 0m1.496s -sys 0m0.748s + ============================================================================== -=============================================================================== +Exit code: 0 -go test -tags bonus -PASS -ok allyourbase 0.008s +real 0m1.610s +user 0m0.686s +sys 0m0.492s -real 0m0.956s -user 0m1.235s -sys 0m0.688s +real 0m1.611s +user 0m0.687s +sys 0m0.492s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m1.212s -user 0m1.382s -sys 0m0.537s - -benchstat benchstat-old.txt benchstat-new.txt - -real 0m0.043s -user 0m0.041s -sys 0m0.027s - -=============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go vet allyourbase +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok allyourbase 0.002s -real 0m0.603s -user 0m0.833s -sys 0m0.452s +real 0m0.148s +user 0m0.212s +sys 0m0.144s =============================================================================== -go fix allyourbase +gotest -v -tags bonus +=== RUN TestConvertToBase +=== RUN TestConvertToBase/single_bit_one_to_decimal +=== RUN TestConvertToBase/binary_to_single_decimal +=== RUN TestConvertToBase/single_decimal_to_binary +=== RUN TestConvertToBase/binary_to_multiple_decimal +=== RUN TestConvertToBase/decimal_to_binary +=== RUN TestConvertToBase/trinary_to_hexadecimal +=== RUN TestConvertToBase/hexadecimal_to_trinary +=== RUN TestConvertToBase/15-bit_integer +=== RUN TestConvertToBase/empty_list +=== RUN TestConvertToBase/single_zero +=== RUN TestConvertToBase/multiple_zeros +=== RUN TestConvertToBase/leading_zeros +=== RUN TestConvertToBase/input_base_is_one +=== RUN TestConvertToBase/input_base_is_zero +=== RUN TestConvertToBase/input_base_is_negative +=== RUN TestConvertToBase/negative_digit +=== RUN TestConvertToBase/invalid_positive_digit +=== RUN TestConvertToBase/output_base_is_one +=== RUN TestConvertToBase/output_base_is_zero +=== RUN TestConvertToBase/output_base_is_negative +=== RUN TestConvertToBase/both_bases_are_negative +--- PASS: TestConvertToBase (0.00s) + --- PASS: TestConvertToBase/single_bit_one_to_decimal (0.00s) + --- PASS: TestConvertToBase/binary_to_single_decimal (0.00s) + --- PASS: TestConvertToBase/single_decimal_to_binary (0.00s) + --- PASS: TestConvertToBase/binary_to_multiple_decimal (0.00s) + --- PASS: TestConvertToBase/decimal_to_binary (0.00s) + --- PASS: TestConvertToBase/trinary_to_hexadecimal (0.00s) + --- PASS: TestConvertToBase/hexadecimal_to_trinary (0.00s) + --- PASS: TestConvertToBase/15-bit_integer (0.00s) + --- PASS: TestConvertToBase/empty_list (0.00s) + --- PASS: TestConvertToBase/single_zero (0.00s) + --- PASS: TestConvertToBase/multiple_zeros (0.00s) + --- PASS: TestConvertToBase/leading_zeros (0.00s) + --- PASS: TestConvertToBase/input_base_is_one (0.00s) + --- PASS: TestConvertToBase/input_base_is_zero (0.00s) + --- PASS: TestConvertToBase/input_base_is_negative (0.00s) + --- PASS: TestConvertToBase/negative_digit (0.00s) + --- PASS: TestConvertToBase/invalid_positive_digit (0.00s) + --- PASS: TestConvertToBase/output_base_is_one (0.00s) + --- PASS: TestConvertToBase/output_base_is_zero (0.00s) + --- PASS: TestConvertToBase/output_base_is_negative (0.00s) + --- PASS: TestConvertToBase/both_bases_are_negative (0.00s) +=== RUN ExampleConvertToBase +--- PASS: ExampleConvertToBase (0.00s) +=== RUN ExampleConvertToBase10 +--- PASS: ExampleConvertToBase10 (0.00s) +=== RUN ExampleConvertFromBase10 +--- PASS: ExampleConvertFromBase10 (0.00s) +=== RUN ExampleConvertStrToIntList +--- PASS: ExampleConvertStrToIntList (0.00s) +PASS +ok allyourbase 0.004s -real 0m0.301s -user 0m0.410s -sys 0m0.301s +real 0m0.139s +user 0m0.179s +sys 0m0.145s =============================================================================== -gosec ./all-your-base -[gosec] 2022/07/30 13:57:02 Including rules: default -[gosec] 2022/07/30 13:57:02 Excluding rules: default -[gosec] 2022/07/30 13:57:02 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/all-your-base -2022/07/30 13:57:02 internal error: package "errors" without types was imported from "command-line-arguments" +benchstat benchstat-old.txt benchstat-new.txt -real 0m0.864s -user 0m1.181s -sys 0m0.511s +real 0m0.002s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output allyourbase-doc.md -real 0m0.043s -user 0m0.034s -sys 0m0.022s +real 0m0.010s +user 0m0.008s +sys 0m0.002s =============================================================================== @@ -244,8 +1002,8 @@ Package allyourbase is used to convert from any base to any other base. FUNCTIONS func ConvertFromBase10(outputBase int, inputNum int) []int - ConvertFromBase10 returns a base x number. It didn't make sense to pass the - functions an int slice so I'm hiding that part of the algorithm in the + ConvertFromBase10 returns a base x number. It didn't make sense to pass + the functions an int slice so I'm hiding that part of the algorithm in the function. func ConvertIntToIntList(num int) []int @@ -261,9 +1019,9 @@ func ConvertToBase10(inputBase int, inputDigits []int) int ConvertToBase10 returns a base 10 number. -real 0m0.385s -user 0m0.439s -sys 0m0.349s +real 0m0.036s +user 0m0.023s +sys 0m0.035s =============================================================================== diff --git a/go/allergies/benchstat-new.txt b/go/allergies/benchstat-new.txt index c0fe35e0..be7b482a 100644 --- a/go/allergies/benchstat-new.txt +++ b/go/allergies/benchstat-new.txt @@ -3,8 +3,8 @@ goarch: amd64 pkg: allergies cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkAllergicTo -BenchmarkAllergicTo-16 44693260 28.04 ns/op 0 B/op 0 allocs/op +BenchmarkAllergicTo-8 32961602 31.14 ns/op 0 B/op 0 allocs/op BenchmarkAllergies -BenchmarkAllergies-16 68112 17789 ns/op 4608 B/op 130 allocs/op +BenchmarkAllergies-8 63153 16968 ns/op 4608 B/op 130 allocs/op PASS -ok allergies 2.678s +ok allergies 2.334s diff --git a/go/allergies/benchstat-old.txt b/go/allergies/benchstat-old.txt index 56a71e0a..c0fe35e0 100644 --- a/go/allergies/benchstat-old.txt +++ b/go/allergies/benchstat-old.txt @@ -1,10 +1,10 @@ goos: linux goarch: amd64 pkg: allergies -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkAllergicTo -BenchmarkAllergicTo-4 17573226 69.40 ns/op 0 B/op 0 allocs/op +BenchmarkAllergicTo-16 44693260 28.04 ns/op 0 B/op 0 allocs/op BenchmarkAllergies -BenchmarkAllergies-4 19191 62253 ns/op 4608 B/op 130 allocs/op +BenchmarkAllergies-16 68112 17789 ns/op 4608 B/op 130 allocs/op PASS -ok allergies 3.205s +ok allergies 2.678s diff --git a/go/allergies/coverage.html b/go/allergies/coverage.html index f4db8d7f..ccad2e5d 100644 --- a/go/allergies/coverage.html +++ b/go/allergies/coverage.html @@ -169,7 +169,7 @@ allergyFlags[name] = bits } - sort.Slice(allergies, func(i, j int) bool { + sort.Slice(allergies, func(i, j int) bool { return allergyFlags[allergies[i]] < allergyFlags[allergies[j]] }) diff --git a/go/allergies/coverage.out b/go/allergies/coverage.out index da3384b0..341e5dac 100644 --- a/go/allergies/coverage.out +++ b/go/allergies/coverage.out @@ -21,5 +21,5 @@ allergies/allergies.go:81.30,83.4 1 36 allergies/allergies.go:87.2,88.39 2 10 allergies/allergies.go:88.39,90.3 1 80 allergies/allergies.go:92.2,92.44 1 10 -allergies/allergies.go:92.44,94.3 1 52 +allergies/allergies.go:92.44,94.3 1 65 allergies/allergies.go:96.2,96.18 1 10 diff --git a/go/allergies/run-tests-go.txt b/go/allergies/run-tests-go.txt index 5abeecdb..60cd98d2 100644 --- a/go/allergies/run-tests-go.txt +++ b/go/allergies/run-tests-go.txt @@ -5,17 +5,39 @@ Go packages: allergies =============================================================================== -golangci-lint run --enable-all ./... -level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.012s +sys 0m0.024s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " -level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." -level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." -level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." -level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." -level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." allergies_test.go:51:33: Comment should end in a period (godot) // stringSet is a set of strings ^ @@ -74,88 +96,361 @@ cases_test.go:1:9: package should be `allergies_test` instead of `allergies` (te package allergies ^ -real 0m0.888s -user 0m1.467s -sys 0m0.891s +real 0m0.559s +user 0m0.753s +sys 0m0.553s -=============================================================================== -golint ./... + ============================================================================== -real 0m0.018s -user 0m0.004s -sys 0m0.003s +Exit code: -1 + +real 0m0.595s +user 0m0.771s +sys 0m0.588s + +real 0m0.598s +user 0m0.773s +sys 0m0.588s =============================================================================== -revive -formatter=stylish ./... +Running: ../../.github/citools/go/go-lint-revive -real 0m0.075s -user 0m0.027s +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.007s +sys 0m0.015s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.053s +user 0m0.024s sys 0m0.045s + + ============================================================================== + +Exit code: 0 + +real 0m0.079s +user 0m0.037s +sys 0m0.065s + +real 0m0.081s +user 0m0.039s +sys 0m0.066s + =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.095s -user 0m0.172s -sys 0m0.110s +real 0m0.001s +user 0m0.001s +sys 0m0.000s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.013s +sys 0m0.019s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." internal error: package "sort" without types was imported from "allergies" -real 0m0.116s -user 0m0.180s -sys 0m0.164s +real 0m0.099s +user 0m0.127s +sys 0m0.115s + + + ============================================================================== + +Exit code: -1 + +real 0m0.139s +user 0m0.152s +sys 0m0.144s + +real 0m0.140s +user 0m0.153s +sys 0m0.144s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.013s +sys 0m0.014s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.175s +user 0m0.217s +sys 0m0.121s + -real 0m0.268s -user 0m0.310s -sys 0m0.229s + ============================================================================== + +Exit code: 0 + +real 0m0.203s +user 0m0.235s +sys 0m0.142s + +real 0m0.205s +user 0m0.237s +sys 0m0.142s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.008s +sys 0m0.017s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + ./allergies.go:59:1: paramTypeCombine: func(flags allergy, flag allergy) bool could be replaced with func(flags, flag allergy) bool -real 0m0.823s -user 0m2.371s -sys 0m0.480s +real 0m0.884s +user 0m2.051s +sys 0m0.300s + + + ============================================================================== + +Exit code: -1 + +real 0m0.920s +user 0m2.064s +sys 0m0.332s + +real 0m0.922s +user 0m2.065s +sys 0m0.333s =============================================================================== -go vet ./... +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.012s +sys 0m0.014s + + + ============================================================================== + +Running: go vet ./... + -real 0m0.129s -user 0m0.211s -sys 0m0.156s +real 0m0.083s +user 0m0.124s +sys 0m0.100s + + + ============================================================================== + +Exit code: 0 + +real 0m0.113s +user 0m0.145s +sys 0m0.121s + +real 0m0.115s +user 0m0.146s +sys 0m0.121s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.007s +sys 0m0.017s -real 0m0.028s -user 0m0.014s -sys 0m0.019s + + ============================================================================== + +Running: go fix ./... + + +real 0m0.032s +user 0m0.023s +sys 0m0.018s + + + ============================================================================== + +Exit code: 0 + +real 0m0.063s +user 0m0.034s +sys 0m0.047s + +real 0m0.065s +user 0m0.035s +sys 0m0.048s =============================================================================== -errcheck ./... +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + -real 0m0.484s -user 0m1.596s -sys 0m0.388s +real 0m0.034s +user 0m0.020s +sys 0m0.026s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.455s +user 0m1.383s +sys 0m0.274s + + + ============================================================================== + +Exit code: 0 + +real 0m0.509s +user 0m1.409s +sys 0m0.320s + +real 0m0.512s +user 0m1.411s +sys 0m0.321s =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.014s +sys 0m0.019s + + + ============================================================================== + +Running: gocyclo . + 5 allergies Allergies allergies.go:72:1 4 allergies BenchmarkAllergies allergies_test.go:40:1 4 allergies BenchmarkAllergicTo allergies_test.go:29:1 @@ -170,26 +465,86 @@ gocyclo . 2 allergies ExampleAllergicTo allergies_examples_test.go:5:1 2 allergies (allergy).String allergies.go:32:1 -real 0m0.017s -user 0m0.003s -sys 0m0.001s +real 0m0.003s +user 0m0.002s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.041s +user 0m0.025s +sys 0m0.029s + +real 0m0.043s +user 0m0.025s +sys 0m0.031s =============================================================================== -misspell . +Running: ../../.github/citools/go/go-lint-misspell -real 0m0.031s -user 0m0.024s -sys 0m0.013s +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.047s +user 0m0.053s +sys 0m0.027s + + + ============================================================================== + +Exit code: 0 + +real 0m0.067s +user 0m0.065s +sys 0m0.040s + +real 0m0.070s +user 0m0.066s +sys 0m0.042s =============================================================================== -gosec ./... -[gosec] 2023/04/03 23:00:50 Including rules: default -[gosec] 2023/04/03 23:00:50 Excluding rules: default -[gosec] 2023/04/03 23:00:50 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/allergies -[gosec] 2023/04/03 23:00:50 Checking package: allergies -[gosec] 2023/04/03 23:00:50 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/allergies/allergies.go +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.010s +sys 0m0.028s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:20:07 Including rules: default +[gosec] 2023/09/07 00:20:07 Excluding rules: default +[gosec] 2023/09/07 00:20:07 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/allergies +[gosec] 2023/09/07 00:20:07 Checking package: allergies +[gosec] 2023/09/07 00:20:07 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/allergies/allergies.go Results: @@ -201,13 +556,48 @@ Results: Issues : 0 -real 0m0.124s -user 0m0.114s -sys 0m0.113s +real 0m0.104s +user 0m0.115s +sys 0m0.076s + + + ============================================================================== + +Exit code: 0 + +real 0m0.152s +user 0m0.137s +sys 0m0.119s + +real 0m0.156s +user 0m0.138s +sys 0m0.122s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.006s +sys 0m0.018s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestAllergicTo === RUN TestAllergicTo/not_allergic_to_anything === RUN TestAllergicTo/allergic_only_to_eggs @@ -317,16 +707,18 @@ gotest -v -covermode=count -coverprofile coverage.out ./... === RUN ExampleAllergies --- PASS: ExampleAllergies (0.00s) PASS - allergies coverage: 81.5% of statements +coverage: 81.5% of statements ok allergies 0.003s coverage: 81.5% of statements -real 0m0.705s -user 0m2.226s -sys 0m0.779s +real 0m0.178s +user 0m0.288s +sys 0m0.157s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + allergies/allergies.go:32: String 75.0% allergies/allergies.go:42: Uint 0.0% allergies/allergies.go:50: Bits 66.7% @@ -334,21 +726,26 @@ allergies/allergies.go:59: AllergicTo 100.0% allergies/allergies.go:72: Allergies 100.0% total: (statements) 81.5% -real 0m0.053s -user 0m0.054s -sys 0m0.065s +real 0m0.055s +user 0m0.027s +sys 0m0.063s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.057s -user 0m0.047s -sys 0m0.052s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +real 0m0.046s +user 0m0.029s +sys 0m0.061s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt 50 func (a allergy) Bits() allergy { 51 if a < 1 || a > 255 { @@ -379,13 +776,19 @@ gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annota 48 } -real 0m0.124s -user 0m0.033s -sys 0m0.047s +real 0m0.015s +user 0m0.007s +sys 0m0.013s -=============================================================================== +real 0m0.015s +user 0m0.008s +sys 0m0.013s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestAllergicTo === RUN TestAllergicTo/not_allergic_to_anything === RUN TestAllergicTo/allergic_only_to_eggs @@ -495,12 +898,25 @@ gotest -v -race -covermode=atomic ./... === RUN ExampleAllergies --- PASS: ExampleAllergies (0.00s) PASS - allergies coverage: 81.5% of statements -ok allergies 0.033s coverage: 81.5% of statements +coverage: 81.5% of statements +ok allergies 1.017s coverage: 81.5% of statements + +real 0m1.239s +user 0m0.289s +sys 0m0.153s -real 0m5.540s -user 0m15.027s -sys 0m2.795s + + ============================================================================== + +Exit code: 0 + +real 0m1.564s +user 0m0.650s +sys 0m0.477s + +real 0m1.566s +user 0m0.651s +sys 0m0.478s =============================================================================== @@ -513,15 +929,15 @@ goarch: amd64 pkg: allergies cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkAllergicTo -BenchmarkAllergicTo-16 44693260 28.04 ns/op 0 B/op 0 allocs/op +BenchmarkAllergicTo-8 32961602 31.14 ns/op 0 B/op 0 allocs/op BenchmarkAllergies -BenchmarkAllergies-16 68112 17789 ns/op 4608 B/op 130 allocs/op +BenchmarkAllergies-8 63153 16968 ns/op 4608 B/op 130 allocs/op PASS -ok allergies 2.678s +ok allergies 2.334s -real 0m2.842s -user 0m2.936s -sys 0m0.191s +real 0m2.494s +user 0m2.557s +sys 0m0.145s =============================================================================== @@ -635,11 +1051,11 @@ gotest -v -tags bonus === RUN ExampleAllergies --- PASS: ExampleAllergies (0.00s) PASS -ok allergies 0.003s +ok allergies 0.002s -real 0m0.173s -user 0m0.273s -sys 0m0.219s +real 0m0.124s +user 0m0.177s +sys 0m0.133s =============================================================================== @@ -652,64 +1068,52 @@ goos: linux goarch: amd64 pkg: allergies cpu: 12th Gen Intel(R) Core(TM) i5-1240P - │ benchstat-new.txt │ - │ sec/op │ + │ benchstat-old.txt │ benchstat-new.txt │ + │ sec/op │ sec/op vs base │ AllergicTo-16 28.04n ± ∞ ¹ Allergies-16 17.79µ ± ∞ ¹ -geomean 706.3n +AllergicTo-8 31.14n ± ∞ ¹ +Allergies-8 16.97µ ± ∞ ¹ +geomean 706.3n 726.9n ? ² ³ ¹ need >= 6 samples for confidence interval at level 0.95 +² benchmark set differs from baseline; geomeans may not be comparable +³ ratios must be >0 to compute geomean - │ benchstat-new.txt │ - │ B/op │ + │ benchstat-old.txt │ benchstat-new.txt │ + │ B/op │ B/op vs base │ AllergicTo-16 0.000 ± ∞ ¹ Allergies-16 4.500Ki ± ∞ ¹ -geomean ² +AllergicTo-8 0.000 ± ∞ ¹ +Allergies-8 4.500Ki ± ∞ ¹ +geomean ² ? ³ ² ⁴ ¹ need >= 6 samples for confidence interval at level 0.95 ² summaries must be >0 to compute geomean +³ benchmark set differs from baseline; geomeans may not be comparable +⁴ ratios must be >0 to compute geomean - │ benchstat-new.txt │ - │ allocs/op │ + │ benchstat-old.txt │ benchstat-new.txt │ + │ allocs/op │ allocs/op vs base │ AllergicTo-16 0.000 ± ∞ ¹ Allergies-16 130.0 ± ∞ ¹ -geomean ² -¹ need >= 6 samples for confidence interval at level 0.95 -² summaries must be >0 to compute geomean - -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz - │ benchstat-old.txt │ - │ sec/op │ -AllergicTo-4 69.40n ± ∞ ¹ -Allergies-4 62.25µ ± ∞ ¹ -geomean 2.079µ -¹ need >= 6 samples for confidence interval at level 0.95 - - │ benchstat-old.txt │ - │ B/op │ -AllergicTo-4 0.000 ± ∞ ¹ -Allergies-4 4.500Ki ± ∞ ¹ -geomean ² -¹ need >= 6 samples for confidence interval at level 0.95 -² summaries must be >0 to compute geomean - - │ benchstat-old.txt │ - │ allocs/op │ -AllergicTo-4 0.000 ± ∞ ¹ -Allergies-4 130.0 ± ∞ ¹ -geomean ² +AllergicTo-8 0.000 ± ∞ ¹ +Allergies-8 130.0 ± ∞ ¹ +geomean ² ? ³ ² ⁴ ¹ need >= 6 samples for confidence interval at level 0.95 ² summaries must be >0 to compute geomean +³ benchmark set differs from baseline; geomeans may not be comparable +⁴ ratios must be >0 to compute geomean -real 0m0.016s -user 0m0.001s -sys 0m0.002s +real 0m0.003s +user 0m0.000s +sys 0m0.003s =============================================================================== gomarkdoc --output allergies-doc.md -real 0m0.026s +real 0m0.009s user 0m0.005s -sys 0m0.008s +sys 0m0.005s =============================================================================== @@ -727,8 +1131,8 @@ func Allergies(flags allergy) []string Allergies returns a list of allergies the patient is allergic to. -real 0m0.042s -user 0m0.017s +real 0m0.036s +user 0m0.016s sys 0m0.031s diff --git a/go/anagram/anagram-doc.md b/go/anagram/anagram-doc.md index 7f2ad796..77430c54 100755 --- a/go/anagram/anagram-doc.md +++ b/go/anagram/anagram-doc.md @@ -6,7 +6,7 @@ import "anagram" ``` -Package anagram is a rearrangement of letters to form a new word\. +Package anagram is a rearrangement of letters to form a new word. ## Index @@ -19,7 +19,7 @@ Package anagram is a rearrangement of letters to form a new word\. func Detect(subject string, candidates []string) []string ``` -Detect returns a string slice anagram of the passed string\. +Detect returns a string slice anagram of the passed string.

Example

diff --git a/go/anagram/benchstat-new.txt b/go/anagram/benchstat-new.txt index 0b3a3dac..55fa3f4c 100644 --- a/go/anagram/benchstat-new.txt +++ b/go/anagram/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: anagram -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkDetectAnagrams-4 8602 125075 ns/op 8432 B/op 203 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkDetectAnagrams +BenchmarkDetectAnagrams-8 70953 16293 ns/op 8432 B/op 203 allocs/op PASS -ok anagram 1.187s +ok anagram 1.332s diff --git a/go/anagram/benchstat-old.txt b/go/anagram/benchstat-old.txt index cc125117..0b3a3dac 100644 --- a/go/anagram/benchstat-old.txt +++ b/go/anagram/benchstat-old.txt @@ -2,6 +2,6 @@ goos: linux goarch: amd64 pkg: anagram cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkDetectAnagrams-4 20246 50322 ns/op 6848 B/op 155 allocs/op +BenchmarkDetectAnagrams-4 8602 125075 ns/op 8432 B/op 203 allocs/op PASS -ok anagram 1.662s +ok anagram 1.187s diff --git a/go/anagram/coverage-annotations.txt b/go/anagram/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/anagram/coverage.out b/go/anagram/coverage.out index 00f08c42..1ce5382a 100644 --- a/go/anagram/coverage.out +++ b/go/anagram/coverage.out @@ -1,5 +1,5 @@ mode: count anagram/anagram.go:10.59,21.39 9 18 -anagram/anagram.go:32.2,32.17 1 18 anagram/anagram.go:21.39,27.70 5 45 anagram/anagram.go:27.70,29.4 1 15 +anagram/anagram.go:32.2,32.17 1 18 diff --git a/go/anagram/run-tests-go.txt b/go/anagram/run-tests-go.txt index 7adc2aae..e0a880b3 100644 --- a/go/anagram/run-tests-go.txt +++ b/go/anagram/run-tests-go.txt @@ -5,15 +5,580 @@ Go packages: anagram =============================================================================== -golint anagram +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.012s +sys 0m0.034s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +anagram.go:11:15: var-declaration: should omit type []string from declaration of var anagrams; it will be inferred from the right-hand side (revive) + var anagrams []string = []string{} + ^ +anagram.go:12:15: var-declaration: should omit type []string from declaration of var tmpSlice; it will be inferred from the right-hand side (revive) + var tmpSlice []string = []string{} + ^ +anagram.go:13:2: declarations should never be cuddled (wsl) + var subjectLower string + ^ +anagram.go:14:2: declarations should never be cuddled (wsl) + var candidateLower string + ^ +anagram_test.go:16:2: return statements should not be cuddled if block has more than two lines (wsl) + return fmt.Sprintf("%v", a) == fmt.Sprintf("%v", b) + ^ +anagram_test.go:40:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +anagram_test.go:19:1: Function TestDetectAnagrams missing the call to method parallel (paralleltest) +func TestDetectAnagrams(t *testing.T) { +^ +anagram_examples_test.go:1:9: package should be `anagram_test` instead of `anagram` (testpackage) +package anagram + ^ +anagram_test.go:1:9: package should be `anagram_test` instead of `anagram` (testpackage) +package anagram + ^ +cases_test.go:1:9: package should be `anagram_test` instead of `anagram` (testpackage) +package anagram + ^ +anagram_test.go:20:6: variable name 'tt' is too short for the scope of its usage (varnamelen) + for _, tt := range testCases { + ^ +anagram_test.go:9:12: parameter name 'a' is too short for the scope of its usage (varnamelen) +func equal(a, b []string) bool { + ^ + +real 0m0.503s +user 0m0.696s +sys 0m0.542s + + + ============================================================================== + +Exit code: -1 + +real 0m0.547s +user 0m0.712s +sys 0m0.588s + +real 0m0.550s +user 0m0.714s +sys 0m0.589s -real 0m0.362s -user 0m0.388s -sys 0m0.275s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.017s +sys 0m0.017s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +anagram.go + (11, 15) https://revive.run/r#var-declaration should omit type []string from declaration of var anagrams; it will be inferred from the right-hand side + (12, 15) https://revive.run/r#var-declaration should omit type []string from declaration of var tmpSlice; it will be inferred from the right-hand side + + + ✖ 2 problems (0 errors) (2 warnings) + +real 0m0.057s +user 0m0.028s +sys 0m0.045s + + + ============================================================================== + +Exit code: 0 + +real 0m0.092s +user 0m0.050s +sys 0m0.074s + +real 0m0.093s +user 0m0.050s +sys 0m0.075s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.000s +user 0m0.000s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.031s +sys 0m0.042s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "sort" without types was imported from "anagram" + +real 0m0.083s +user 0m0.112s +sys 0m0.103s + + + ============================================================================== + +Exit code: -1 + +real 0m0.128s +user 0m0.148s +sys 0m0.155s + +real 0m0.129s +user 0m0.149s +sys 0m0.155s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out anagram +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.008s +sys 0m0.019s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +anagram.go:11:15: should omit type []string from declaration; it will be inferred from the right-hand side (ST1023) +anagram.go:12:15: should omit type []string from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.161s +user 0m0.212s +sys 0m0.107s + + + ============================================================================== + +Exit code: -1 + +real 0m0.190s +user 0m0.225s +sys 0m0.135s + +real 0m0.192s +user 0m0.225s +sys 0m0.137s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.016s +sys 0m0.015s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.809s +user 0m2.094s +sys 0m0.287s + + + ============================================================================== + +Exit code: 0 + +real 0m0.838s +user 0m2.113s +sys 0m0.312s + +real 0m0.840s +user 0m2.114s +sys 0m0.314s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.013s +sys 0m0.014s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.080s +user 0m0.115s +sys 0m0.100s + + + ============================================================================== + +Exit code: 0 + +real 0m0.110s +user 0m0.134s +sys 0m0.123s + +real 0m0.112s +user 0m0.136s +sys 0m0.123s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.015s +sys 0m0.014s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.021s +user 0m0.012s +sys 0m0.018s + + + ============================================================================== + +Exit code: 0 + +real 0m0.052s +user 0m0.033s +sys 0m0.040s + +real 0m0.054s +user 0m0.034s +sys 0m0.042s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.024s +sys 0m0.026s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.489s +user 0m1.614s +sys 0m0.293s + + + ============================================================================== + +Exit code: 0 + +real 0m0.532s +user 0m1.646s +sys 0m0.327s + +real 0m0.534s +user 0m1.646s +sys 0m0.329s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.013s +sys 0m0.014s + + + ============================================================================== + +Running: gocyclo . + +4 anagram BenchmarkDetectAnagrams anagram_test.go:36:1 +4 anagram Detect anagram.go:10:1 +3 anagram TestDetectAnagrams anagram_test.go:19:1 +2 anagram equal anagram_test.go:9:1 +1 anagram ExampleDetect anagram_examples_test.go:7:1 + +real 0m0.002s +user 0m0.001s +sys 0m0.001s + + + ============================================================================== + +Exit code: 0 + +real 0m0.032s +user 0m0.022s +sys 0m0.022s + +real 0m0.034s +user 0m0.022s +sys 0m0.024s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.036s +user 0m0.038s +sys 0m0.020s + + + ============================================================================== + +Exit code: 0 + +real 0m0.047s +user 0m0.039s +sys 0m0.033s + +real 0m0.050s +user 0m0.040s +sys 0m0.034s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.011s +sys 0m0.015s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:20:19 Including rules: default +[gosec] 2023/09/07 00:20:19 Excluding rules: default +[gosec] 2023/09/07 00:20:19 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/anagram +[gosec] 2023/09/07 00:20:19 Checking package: anagram +[gosec] 2023/09/07 00:20:19 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/anagram/anagram.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 33 + Nosec : 0 + Issues : 0 + + +real 0m0.120s +user 0m0.122s +sys 0m0.123s + + + ============================================================================== + +Exit code: 0 + +real 0m0.151s +user 0m0.141s +sys 0m0.144s + +real 0m0.152s +user 0m0.143s +sys 0m0.144s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.016s +sys 0m0.018s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestDetectAnagrams anagram_test.go:31: PASS: no matches anagram_test.go:31: PASS: detects two anagrams @@ -37,33 +602,54 @@ go test -v -covermode=count -coverprofile coverage.out anagram --- PASS: ExampleDetect (0.00s) PASS coverage: 100.0% of statements -ok anagram 0.025s coverage: 100.0% of statements +ok anagram 0.002s coverage: 100.0% of statements -real 0m1.347s -user 0m1.470s -sys 0m0.918s +real 0m0.194s +user 0m0.282s +sys 0m0.173s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + anagram/anagram.go:10: Detect 100.0% total: (statements) 100.0% -real 0m0.435s -user 0m0.354s -sys 0m0.405s +real 0m0.042s +user 0m0.049s +sys 0m0.063s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.466s -user 0m0.396s -sys 0m0.414s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic anagram +real 0m0.041s +user 0m0.051s +sys 0m0.054s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.013s +user 0m0.011s +sys 0m0.012s + +real 0m0.013s +user 0m0.011s +sys 0m0.012s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestDetectAnagrams anagram_test.go:31: PASS: no matches anagram_test.go:31: PASS: detects two anagrams @@ -82,102 +668,130 @@ go test -v -race -covermode=atomic anagram anagram_test.go:31: PASS: words are not anagrams of themselves even if letter case is partially different anagram_test.go:31: PASS: words are not anagrams of themselves even if letter case is completely different anagram_test.go:31: PASS: words other than themselves can be anagrams ---- PASS: TestDetectAnagrams (0.01s) +--- PASS: TestDetectAnagrams (0.00s) === RUN ExampleDetect --- PASS: ExampleDetect (0.00s) PASS coverage: 100.0% of statements -ok anagram 0.066s coverage: 100.0% of statements +ok anagram 1.013s coverage: 100.0% of statements + +real 0m1.247s +user 0m0.321s +sys 0m0.186s + -real 0m1.731s -user 0m2.104s -sys 0m0.986s + ============================================================================== + +Exit code: 0 + +real 0m1.570s +user 0m0.737s +sys 0m0.515s + +real 0m1.572s +user 0m0.738s +sys 0m0.516s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: anagram -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkDetectAnagrams-4 8602 125075 ns/op 8432 B/op 203 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkDetectAnagrams +BenchmarkDetectAnagrams-8 70953 16293 ns/op 8432 B/op 203 allocs/op PASS -ok anagram 1.187s +ok anagram 1.332s -real 0m2.098s -user 0m2.849s -sys 0m0.864s +real 0m1.482s +user 0m1.557s +sys 0m0.154s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestDetectAnagrams + anagram_test.go:31: PASS: no matches + anagram_test.go:31: PASS: detects two anagrams + anagram_test.go:31: PASS: detects two anagrams + anagram_test.go:31: PASS: does not detect anagram subsets + anagram_test.go:31: PASS: detects anagram + anagram_test.go:31: PASS: detects three anagrams + anagram_test.go:31: PASS: detects multiple anagrams with different case + anagram_test.go:31: PASS: does not detect non-anagrams with identical checksum + anagram_test.go:31: PASS: detects anagrams case-insensitively + anagram_test.go:31: PASS: detects anagrams using case-insensitive subject + anagram_test.go:31: PASS: detects anagrams using case-insensitive possible matches + anagram_test.go:31: PASS: does not detect an anagram if the original word is repeated + anagram_test.go:31: PASS: anagrams must use all letters exactly once + anagram_test.go:31: PASS: words are not anagrams of themselves + anagram_test.go:31: PASS: words are not anagrams of themselves even if letter case is partially different + anagram_test.go:31: PASS: words are not anagrams of themselves even if letter case is completely different + anagram_test.go:31: PASS: words other than themselves can be anagrams +--- PASS: TestDetectAnagrams (0.00s) +=== RUN ExampleDetect +--- PASS: ExampleDetect (0.00s) PASS -ok anagram 0.005s +ok anagram 0.002s -real 0m1.182s -user 0m1.766s -sys 0m0.786s +real 0m0.138s +user 0m0.177s +sys 0m0.124s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m4.355s -user 0m1.146s -sys 0m0.652s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -DetectAnagrams-4 50.3µs ± 0% 125.1µs ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -DetectAnagrams-4 6.85kB ± 0% 8.43kB ± 0% ~ (p=1.000 n=1+1) - -name old allocs/op new allocs/op delta -DetectAnagrams-4 155 ± 0% 203 ± 0% ~ (p=1.000 n=1+1) - -real 0m0.035s -user 0m0.016s -sys 0m0.021s - -=============================================================================== - -go vet anagram - -real 0m0.722s -user 0m0.828s -sys 0m0.612s - -=============================================================================== - -go fix anagram +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: anagram +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +DetectAnagrams-8 16.29µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +DetectAnagrams-8 8.234Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +DetectAnagrams-8 203.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.283s -user 0m0.273s -sys 0m0.219s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +DetectAnagrams-4 125.1µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +DetectAnagrams-4 8.234Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./anagram -[gosec] 2022/07/30 13:56:04 Including rules: default -[gosec] 2022/07/30 13:56:04 Excluding rules: default -[gosec] 2022/07/30 13:56:04 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/anagram -2022/07/30 13:56:05 internal error: package "sort" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +DetectAnagrams-4 203.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m1.107s -user 0m1.251s -sys 0m0.730s +real 0m0.008s +user 0m0.002s +sys 0m0.002s =============================================================================== gomarkdoc --output anagram-doc.md -real 0m0.042s -user 0m0.032s -sys 0m0.018s +real 0m0.012s +user 0m0.007s +sys 0m0.006s =============================================================================== @@ -192,9 +806,9 @@ func Detect(subject string, candidates []string) []string Detect returns a string slice anagram of the passed string. -real 0m0.300s -user 0m0.242s -sys 0m0.280s +real 0m0.063s +user 0m0.034s +sys 0m0.051s =============================================================================== diff --git a/go/animal-magic/benchstat-new.txt b/go/animal-magic/benchstat-new.txt index 9c119f56..54a286a3 100644 --- a/go/animal-magic/benchstat-new.txt +++ b/go/animal-magic/benchstat-new.txt @@ -1,2 +1,2 @@ PASS -ok chance 0.012s +ok chance 0.002s diff --git a/go/animal-magic/benchstat-old.txt b/go/animal-magic/benchstat-old.txt new file mode 100644 index 00000000..9c119f56 --- /dev/null +++ b/go/animal-magic/benchstat-old.txt @@ -0,0 +1,2 @@ +PASS +ok chance 0.012s diff --git a/go/animal-magic/coverage.out b/go/animal-magic/coverage.out index 772c34bc..69689e16 100644 --- a/go/animal-magic/coverage.out +++ b/go/animal-magic/coverage.out @@ -3,5 +3,5 @@ chance/animal_magic.go:9.21,11.2 1 2 chance/animal_magic.go:14.21,16.2 1 101 chance/animal_magic.go:19.35,21.2 1 101 chance/animal_magic.go:24.32,36.25 2 101 -chance/animal_magic.go:37.2,38.16 2 101 chance/animal_magic.go:36.25,36.76 1 707 +chance/animal_magic.go:37.2,38.16 2 101 diff --git a/go/animal-magic/run-tests-go.txt b/go/animal-magic/run-tests-go.txt index df6b65c5..3c0734d5 100644 --- a/go/animal-magic/run-tests-go.txt +++ b/go/animal-magic/run-tests-go.txt @@ -5,57 +5,639 @@ Go packages: chance =============================================================================== -golint ./... +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.122s -user 0m0.045s -sys 0m0.070s +Running GoLangCi-Lint -=============================================================================== +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... -revive ./... -animal_magic.go:1:1: should have a package comment -real 0m0.053s +real 0m0.028s user 0m0.017s -sys 0m0.030s +sys 0m0.028s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +animal_magic.go:8:63: Comment should end in a period (godot) +// SeedWithTime seeds math/rand with the current computer time + ^ +animal_magic.go:13:53: Comment should end in a period (godot) +// RollADie returns a random int d with 1 <= d <= 20 + ^ +animal_magic.go:18:70: Comment should end in a period (godot) +// GenerateWandEnergy returns a random float64 f with 0.0 <= f < 12.0 + ^ +animal_magic_test.go:15:10: G404: Use of weak random number generator (math/rand instead of crypto/rand) (gosec) + got := rand.Int63() + ^ +animal_magic_test.go:20:28: G404: Use of weak random number generator (math/rand instead of crypto/rand) (gosec) + time.Sleep(time.Duration(rand.Intn(10)) * time.Microsecond) + ^ +animal_magic.go:38:2: return statements should not be cuddled if block has more than two lines (wsl) + return animals + ^ +animal_magic_test.go:12:2: declarations should never be cuddled (wsl) + var last int64 + ^ +animal_magic_test.go:16:3: only one cuddle assignment allowed before if statement (wsl) + if i > 0 && got != last { + ^ +animal_magic_test.go:19:3: assignments should only be cuddled with other assignments (wsl) + last = got + ^ +animal_magic_test.go:13:2: only one cuddle assignment allowed before for statement (wsl) + for i := 0; i < tests; i++ { + ^ +animal_magic_test.go:27:2: declarations should never be cuddled (wsl) + var got int + ^ +animal_magic_test.go:28:2: assignments should only be cuddled with other assignments (wsl) + foundDifferent := false + ^ +animal_magic_test.go:29:2: declarations should never be cuddled (wsl) + var last int + ^ +animal_magic_test.go:35:3: if statements should only be cuddled with assignments (wsl) + if i > 0 && got != last { + ^ +animal_magic_test.go:38:3: assignments should only be cuddled with other assignments (wsl) + last = got + ^ +animal_magic_test.go:30:2: only one cuddle assignment allowed before for statement (wsl) + for i := 0; i < tests; i++ { + ^ +animal_magic_test.go:40:2: if statements should only be cuddled with assignments (wsl) + if !foundDifferent { + ^ +animal_magic_test.go:55:3: if statements should only be cuddled with assignments (wsl) + if i > 0 && got != last { + ^ +animal_magic_test.go:50:2: only one cuddle assignment allowed before for statement (wsl) + for i := 0; i < tests; i++ { + ^ +animal_magic_test.go:102:2: return statements should not be cuddled if block has more than two lines (wsl) + return true + ^ +animal_magic_examples_test.go:13:2: Duplicate words (true) found (dupword) + // true + ^ +animal_magic_examples_test.go:22:2: Duplicate words (true) found (dupword) + // true + ^ +animal_magic.go:15:23: mnd: Magic number: 20, in detected (gomnd) + return 1 + rand.Intn(20) // #nosec G404 + ^ +animal_magic.go:20:26: mnd: Magic number: 12, in detected (gomnd) + return rand.Float64() * 12 // #nosec G404 + ^ +animal_magic_test.go:10:1: Function TestSeedWithTime missing the call to method parallel (paralleltest) +func TestSeedWithTime(t *testing.T) { +^ +animal_magic_test.go:25:1: Function TestRollADie missing the call to method parallel (paralleltest) +func TestRollADie(t *testing.T) { +^ +animal_magic_test.go:45:1: Function TestWandEnergy missing the call to method parallel (paralleltest) +func TestWandEnergy(t *testing.T) { +^ +animal_magic_test.go:65:1: Function TestShuffleAnimals missing the call to method parallel (paralleltest) +func TestShuffleAnimals(t *testing.T) { +^ +animal_magic_examples_test.go:1:9: package should be `chance_test` instead of `chance` (testpackage) +package chance + ^ +animal_magic_test.go:1:9: package should be `chance_test` instead of `chance` (testpackage) +package chance + ^ +animal_magic_test.go:89:18: parameter name 'a' is too short for the scope of its usage (varnamelen) +func slicesEqual(a, b []string) bool { + ^ + +real 0m0.617s +user 0m0.902s +sys 0m0.623s + + + ============================================================================== + +Exit code: -1 + +real 0m0.660s +user 0m0.928s +sys 0m0.665s + +real 0m0.664s +user 0m0.928s +sys 0m0.669s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.021s +sys 0m0.016s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +animal_magic.go + (1, 1) https://revive.run/r#package-comments should have a package comment + + + ✖ 1 problem (0 errors) (1 warnings) + +real 0m0.077s +user 0m0.038s +sys 0m0.060s + + + ============================================================================== + +Exit code: 0 + +real 0m0.111s +user 0m0.067s +sys 0m0.085s + +real 0m0.114s +user 0m0.068s +sys 0m0.086s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.429s -user 0m0.490s -sys 0m0.388s +real 0m0.001s +user 0m0.001s +sys 0m0.000s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.017s +sys 0m0.031s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." +internal error: package "math/rand" without types was imported from "chance" + +real 0m0.100s +user 0m0.129s +sys 0m0.114s + + + ============================================================================== + +Exit code: -1 + +real 0m0.146s +user 0m0.153s +sys 0m0.158s + +real 0m0.149s +user 0m0.155s +sys 0m0.159s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.016s +sys 0m0.014s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +animal_magic.go:1:1: at least one file in a package should have a package comment (ST1000) + +real 0m0.162s +user 0m0.214s +sys 0m0.124s + + + ============================================================================== + +Exit code: -1 + +real 0m0.190s +user 0m0.238s +sys 0m0.144s + +real 0m0.192s +user 0m0.239s +sys 0m0.145s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.017s +sys 0m0.026s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.821s +user 0m1.931s +sys 0m0.295s + + + ============================================================================== + +Exit code: 0 + +real 0m0.862s +user 0m1.956s +sys 0m0.333s + +real 0m0.864s +user 0m1.956s +sys 0m0.336s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.012s +sys 0m0.026s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.078s +user 0m0.117s +sys 0m0.103s + + + ============================================================================== + +Exit code: 0 + +real 0m0.109s +user 0m0.133s +sys 0m0.138s + +real 0m0.111s +user 0m0.135s +sys 0m0.138s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.027s +sys 0m0.033s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.028s +user 0m0.017s +sys 0m0.026s + + + ============================================================================== + +Exit code: 0 + +real 0m0.074s +user 0m0.051s +sys 0m0.069s + +real 0m0.076s +user 0m0.053s +sys 0m0.069s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + -real 0m0.639s -user 0m0.743s -sys 0m0.635s +real 0m0.025s +user 0m0.019s +sys 0m0.026s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.495s +user 0m1.454s +sys 0m0.299s + + + ============================================================================== + +Exit code: 0 + +real 0m0.536s +user 0m1.479s +sys 0m0.342s + +real 0m0.540s +user 0m1.480s +sys 0m0.344s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.019s +sys 0m0.015s + + + ============================================================================== + +Running: gocyclo . + +7 chance TestShuffleAnimals animal_magic_test.go:65:1 +7 chance TestWandEnergy animal_magic_test.go:45:1 +7 chance TestRollADie animal_magic_test.go:25:1 +5 chance slicesEqual animal_magic_test.go:89:1 +4 chance TestSeedWithTime animal_magic_test.go:10:1 +1 chance ExampleShuffleAnimals animal_magic_examples_test.go:25:1 +1 chance ExampleGenerateWandEnergy animal_magic_examples_test.go:16:1 +1 chance ExampleRollADie animal_magic_examples_test.go:7:1 +1 chance ShuffleAnimals animal_magic.go:24:1 +1 chance GenerateWandEnergy animal_magic.go:19:1 +1 chance RollADie animal_magic.go:14:1 +1 chance SeedWithTime animal_magic.go:9:1 + +real 0m0.002s +user 0m0.001s +sys 0m0.001s + -real 0m0.519s -user 0m0.511s -sys 0m0.446s + ============================================================================== + +Exit code: 0 + +real 0m0.036s +user 0m0.025s +sys 0m0.029s + +real 0m0.037s +user 0m0.025s +sys 0m0.031s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . -real 0m2.901s -user 0m4.532s -sys 0m1.241s + +real 0m0.023s +user 0m0.026s +sys 0m0.010s + + + ============================================================================== + +Exit code: 0 + +real 0m0.035s +user 0m0.028s +sys 0m0.024s + +real 0m0.037s +user 0m0.029s +sys 0m0.025s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.026s +sys 0m0.024s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:20:25 Including rules: default +[gosec] 2023/09/07 00:20:25 Excluding rules: default +[gosec] 2023/09/07 00:20:25 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/animal-magic +[gosec] 2023/09/07 00:20:25 Checking package: chance +[gosec] 2023/09/07 00:20:25 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/animal-magic/animal_magic.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 39 + Nosec : 2 + Issues : 0 + + +real 0m0.121s +user 0m0.137s +sys 0m0.101s + + + ============================================================================== + +Exit code: 0 + +real 0m0.162s +user 0m0.168s +sys 0m0.133s + +real 0m0.164s +user 0m0.169s +sys 0m0.134s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.023s +sys 0m0.015s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestSeedWithTime --- PASS: TestSeedWithTime (0.00s) === RUN TestRollADie @@ -72,44 +654,57 @@ gotest -v -covermode=count -coverprofile coverage.out ./... --- PASS: ExampleShuffleAnimals (0.00s) PASS coverage: 100.0% of statements -ok chance 0.008s coverage: 100.0% of statements +ok chance 0.003s coverage: 100.0% of statements -real 0m1.166s -user 0m1.284s -sys 0m0.855s +real 0m0.175s +user 0m0.240s +sys 0m0.156s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + chance/animal_magic.go:9: SeedWithTime 100.0% chance/animal_magic.go:14: RollADie 100.0% chance/animal_magic.go:19: GenerateWandEnergy 100.0% chance/animal_magic.go:24: ShuffleAnimals 100.0% total: (statements) 100.0% -real 0m0.274s -user 0m0.227s -sys 0m0.288s +real 0m0.059s +user 0m0.070s +sys 0m0.087s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.488s -user 0m0.362s -sys 0m0.452s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 -color - | tee coverage-annotations.txt +real 0m0.058s +user 0m0.061s +sys 0m0.080s -real 0m0.225s -user 0m0.142s -sys 0m0.218s -=============================================================================== + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.024s +user 0m0.015s +sys 0m0.024s + +real 0m0.024s +user 0m0.015s +sys 0m0.024s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestSeedWithTime --- PASS: TestSeedWithTime (0.00s) === RUN TestRollADie @@ -126,99 +721,77 @@ gotest -v -race -covermode=atomic ./... --- PASS: ExampleShuffleAnimals (0.00s) PASS coverage: 100.0% of statements -ok chance 0.047s coverage: 100.0% of statements +ok chance 1.014s coverage: 100.0% of statements -real 0m2.929s -user 0m2.252s -sys 0m1.557s +real 0m1.228s +user 0m0.264s +sys 0m0.132s -=============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -PASS -ok chance 0.012s + ============================================================================== -real 0m1.467s -user 0m1.683s -sys 0m1.181s - -=============================================================================== +Exit code: 0 -go test -tags bonus -PASS -ok chance 0.034s - -real 0m1.178s -user 0m1.319s -sys 0m0.833s - -=============================================================================== +real 0m1.582s +user 0m0.682s +sys 0m0.507s -No old benchmarks to run benchstat against. +real 0m1.585s +user 0m0.683s +sys 0m0.509s =============================================================================== -go vet ./... +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -real 0m1.307s -user 0m0.888s -sys 0m1.032s - -=============================================================================== - -go fix ./... - -real 0m0.426s -user 0m0.110s -sys 0m0.222s - -=============================================================================== - -gocyclo . -7 chance TestShuffleAnimals animal_magic_test.go:65:1 -7 chance TestWandEnergy animal_magic_test.go:45:1 -7 chance TestRollADie animal_magic_test.go:25:1 -5 chance slicesEqual animal_magic_test.go:89:1 -4 chance TestSeedWithTime animal_magic_test.go:10:1 -1 chance ExampleShuffleAnimals animal_magic_examples_test.go:25:1 -1 chance ExampleGenerateWandEnergy animal_magic_examples_test.go:16:1 -1 chance ExampleRollADie animal_magic_examples_test.go:7:1 -1 chance ShuffleAnimals animal_magic.go:24:1 -1 chance GenerateWandEnergy animal_magic.go:19:1 -1 chance RollADie animal_magic.go:14:1 -1 chance SeedWithTime animal_magic.go:9:1 +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok chance 0.002s -real 0m0.061s -user 0m0.010s -sys 0m0.023s +real 0m0.136s +user 0m0.183s +sys 0m0.129s =============================================================================== -misspell . +gotest -v -tags bonus +=== RUN TestSeedWithTime +--- PASS: TestSeedWithTime (0.00s) +=== RUN TestRollADie +--- PASS: TestRollADie (0.00s) +=== RUN TestWandEnergy +--- PASS: TestWandEnergy (0.00s) +=== RUN TestShuffleAnimals +--- PASS: TestShuffleAnimals (0.00s) +=== RUN ExampleRollADie +--- PASS: ExampleRollADie (0.00s) +=== RUN ExampleGenerateWandEnergy +--- PASS: ExampleGenerateWandEnergy (0.00s) +=== RUN ExampleShuffleAnimals +--- PASS: ExampleShuffleAnimals (0.00s) +PASS +ok chance 0.002s -real 0m0.527s -user 0m0.312s -sys 0m0.169s +real 0m0.141s +user 0m0.196s +sys 0m0.144s =============================================================================== -gosec ./... -[gosec] 2022/08/24 21:03:57 Including rules: default -[gosec] 2022/08/24 21:03:57 Excluding rules: default -[gosec] 2022/08/24 21:03:57 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/animal-magic -2022/08/24 21:03:58 internal error: package "math/rand" without types was imported from "command-line-arguments" +benchstat benchstat-old.txt benchstat-new.txt -real 0m1.234s -user 0m0.941s -sys 0m0.765s +real 0m0.002s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output chance-doc.md -real 0m0.143s -user 0m0.065s -sys 0m0.066s +real 0m0.011s +user 0m0.007s +sys 0m0.005s =============================================================================== @@ -241,9 +814,9 @@ func ShuffleAnimals() []string ShuffleAnimals returns a slice with all eight animal strings in random order -real 0m0.490s -user 0m0.280s -sys 0m0.495s +real 0m0.041s +user 0m0.033s +sys 0m0.056s =============================================================================== diff --git a/go/annalyns-infiltration/benchstat-new.txt b/go/annalyns-infiltration/benchstat-new.txt index 32311912..e614990a 100644 --- a/go/annalyns-infiltration/benchstat-new.txt +++ b/go/annalyns-infiltration/benchstat-new.txt @@ -1,2 +1,2 @@ PASS -ok annalyn 0.064s +ok annalyn 0.002s diff --git a/go/annalyns-infiltration/benchstat-old.txt b/go/annalyns-infiltration/benchstat-old.txt new file mode 100644 index 00000000..32311912 --- /dev/null +++ b/go/annalyns-infiltration/benchstat-old.txt @@ -0,0 +1,2 @@ +PASS +ok annalyn 0.064s diff --git a/go/annalyns-infiltration/coverage-annotations.txt b/go/annalyns-infiltration/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/annalyns-infiltration/coverage.out b/go/annalyns-infiltration/coverage.out index 64d4a42e..3486a7d4 100644 --- a/go/annalyns-infiltration/coverage.out +++ b/go/annalyns-infiltration/coverage.out @@ -3,7 +3,7 @@ annalyn/annalyns_infiltration.go:4.45,6.2 1 3 annalyn/annalyns_infiltration.go:9.70,11.2 1 9 annalyn/annalyns_infiltration.go:14.66,16.2 1 5 annalyn/annalyns_infiltration.go:20.96,21.42 1 19 -annalyn/annalyns_infiltration.go:25.2,25.21 1 12 -annalyn/annalyns_infiltration.go:29.2,29.41 1 4 annalyn/annalyns_infiltration.go:21.42,23.3 1 7 +annalyn/annalyns_infiltration.go:25.2,25.21 1 12 annalyn/annalyns_infiltration.go:25.21,27.3 1 8 +annalyn/annalyns_infiltration.go:29.2,29.41 1 4 diff --git a/go/annalyns-infiltration/run-tests-go.txt b/go/annalyns-infiltration/run-tests-go.txt index afe2e947..11317862 100644 --- a/go/annalyns-infiltration/run-tests-go.txt +++ b/go/annalyns-infiltration/run-tests-go.txt @@ -5,15 +5,598 @@ Go packages: annalyn =============================================================================== -golint annalyn +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.007s +sys 0m0.018s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +annalyns_infiltration_test.go:36: Function 'TestCanSpy' is too long (65 > 60) (funlen) +func TestCanSpy(t *testing.T) { +annalyns_infiltration_test.go:140: Function 'TestCanFreePrisoner' is too long (153 > 60) (funlen) +func TestCanFreePrisoner(t *testing.T) { +annalyns_infiltration.go:3:66: Comment should end in a period (godot) +// CanFastAttack can be executed only when the knight is sleeping + ^ +annalyns_infiltration.go:8:69: Comment should end in a period (godot) +// CanSpy can be executed if at least one of the characters is awake + ^ +annalyns_infiltration.go:13:89: Comment should end in a period (godot) +// CanSignalPrisoner can be executed if the prisoner is awake and the archer is sleeping + ^ +annalyns_infiltration_test.go:98: line is 122 characters (lll) + t.Errorf("CanSpy(%v, %v, %v) = %v; want %v", tt.knightIsAwake, tt.archerIsAwake, tt.prisonerIsAwake, got, tt.expected) +annalyns_infiltration_test.go:289: line is 123 characters (lll) + if got := CanFreePrisoner(tt.knightIsAwake, tt.archerIsAwake, tt.prisonerIsAwake, tt.dogIsPresent); got != tt.expected { +annalyns_infiltration_test.go:290: line is 149 characters (lll) + t.Errorf("CanFreePrisoner(%v,%v,%v,%v) = %v; want %v", tt.knightIsAwake, tt.archerIsAwake, tt.prisonerIsAwake, tt.dogIsPresent, got, tt.expected) +annalyns_infiltration_test.go:29:28: Using the variable on range scope `tt` in function literal (scopelint) + if got := CanFastAttack(tt.knightIsAwake); got != tt.expected { + ^ +annalyns_infiltration_test.go:30:49: Using the variable on range scope `tt` in function literal (scopelint) + t.Errorf("CanFastAttack(%v) = %v; want %v", tt.knightIsAwake, tt.knightIsAwake, tt.expected) + ^ +annalyns_infiltration_test.go:97:21: Using the variable on range scope `tt` in function literal (scopelint) + if got := CanSpy(tt.knightIsAwake, tt.archerIsAwake, tt.prisonerIsAwake); got != tt.expected { + ^ +annalyns_infiltration_test.go:14:1: Function TestCanFastAttack missing the call to method parallel (paralleltest) +func TestCanFastAttack(t *testing.T) { +^ +annalyns_infiltration_test.go:27:2: Range statement for test TestCanFastAttack missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +annalyns_infiltration_test.go:95:2: Range statement for test TestCanSpy missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +annalyns_infiltration_test.go:104:1: Function TestCanSignalPrisoner missing the call to method parallel (paralleltest) +func TestCanSignalPrisoner(t *testing.T) { +^ +annalyns_infiltration_test.go:131:2: Range statement for test TestCanSignalPrisoner missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +annalyns_infiltration_test.go:287:2: Range statement for test TestCanFreePrisoner missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +annalyns_infiltration_examples_test.go:1:9: package should be `annalyn_test` instead of `annalyn` (testpackage) +package annalyn + ^ +annalyns_infiltration_test.go:1:9: package should be `annalyn_test` instead of `annalyn` (testpackage) +package annalyn + ^ + +real 0m0.417s +user 0m0.631s +sys 0m0.364s + + + ============================================================================== + +Exit code: -1 + +real 0m0.457s +user 0m0.647s +sys 0m0.401s + +real 0m0.460s +user 0m0.648s +sys 0m0.403s -real 0m0.277s -user 0m0.129s -sys 0m0.183s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.007s +sys 0m0.007s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +annalyns_infiltration.go + (1, 1) https://revive.run/r#package-comments should have a package comment + + + ✖ 1 problem (0 errors) (1 warnings) + +real 0m0.026s +user 0m0.013s +sys 0m0.019s + + + ============================================================================== + +Exit code: 0 + +real 0m0.047s +user 0m0.027s +sys 0m0.033s + +real 0m0.050s +user 0m0.029s +sys 0m0.033s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.005s +sys 0m0.012s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "annalyn [annalyn.test]" + +real 0m0.085s +user 0m0.115s +sys 0m0.116s + + + ============================================================================== + +Exit code: -1 + +real 0m0.110s +user 0m0.125s +sys 0m0.140s + +real 0m0.113s +user 0m0.127s +sys 0m0.141s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.006s +sys 0m0.017s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +annalyns_infiltration.go:1:1: at least one file in a package should have a package comment (ST1000) + +real 0m0.180s +user 0m0.208s +sys 0m0.110s + + + ============================================================================== + +Exit code: -1 + +real 0m0.212s +user 0m0.223s +sys 0m0.135s + +real 0m0.214s +user 0m0.223s +sys 0m0.137s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.016s +user 0m0.005s +sys 0m0.015s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.788s +user 0m1.808s +sys 0m0.255s + + + ============================================================================== + +Exit code: 0 + +real 0m0.821s +user 0m1.823s +sys 0m0.283s + +real 0m0.823s +user 0m1.823s +sys 0m0.285s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.006s +sys 0m0.011s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.079s +user 0m0.114s +sys 0m0.103s + + + ============================================================================== + +Exit code: 0 + +real 0m0.103s +user 0m0.124s +sys 0m0.123s + +real 0m0.104s +user 0m0.125s +sys 0m0.123s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.006s +sys 0m0.010s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.015s +user 0m0.006s +sys 0m0.013s + + + ============================================================================== + +Exit code: 0 + +real 0m0.042s +user 0m0.020s +sys 0m0.031s + +real 0m0.043s +user 0m0.020s +sys 0m0.032s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.008s +sys 0m0.016s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.436s +user 0m1.185s +sys 0m0.282s + + + ============================================================================== + +Exit code: 0 + +real 0m0.466s +user 0m1.200s +sys 0m0.306s + +real 0m0.468s +user 0m1.200s +sys 0m0.308s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out annalyn +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.003s +sys 0m0.012s + + + ============================================================================== + +Running: gocyclo . + +5 annalyn CanFreePrisoner annalyns_infiltration.go:20:1 +3 annalyn TestCanFreePrisoner annalyns_infiltration_test.go:140:1 +3 annalyn TestCanSignalPrisoner annalyns_infiltration_test.go:104:1 +3 annalyn TestCanSpy annalyns_infiltration_test.go:36:1 +3 annalyn TestCanFastAttack annalyns_infiltration_test.go:14:1 +3 annalyn CanSpy annalyns_infiltration.go:9:1 +2 annalyn CanSignalPrisoner annalyns_infiltration.go:14:1 +1 annalyn ExampleCanFreePrisoner annalyns_infiltration_examples_test.go:25:1 +1 annalyn ExampleCanSignalPrisoner annalyns_infiltration_examples_test.go:19:1 +1 annalyn ExampleCanSpy annalyns_infiltration_examples_test.go:13:1 +1 annalyn ExampleCanFastAttack annalyns_infiltration_examples_test.go:7:1 +1 annalyn CanFastAttack annalyns_infiltration.go:4:1 + +real 0m0.002s +user 0m0.000s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.025s +user 0m0.006s +sys 0m0.026s + +real 0m0.026s +user 0m0.006s +sys 0m0.027s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.023s +user 0m0.024s +sys 0m0.012s + + + ============================================================================== + +Exit code: 0 + +real 0m0.035s +user 0m0.029s +sys 0m0.023s + +real 0m0.037s +user 0m0.030s +sys 0m0.024s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.008s +sys 0m0.008s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:20:30 Including rules: default +[gosec] 2023/09/07 00:20:30 Excluding rules: default +[gosec] 2023/09/07 00:20:30 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/annalyns-infiltration +[gosec] 2023/09/07 00:20:30 Checking package: annalyn +[gosec] 2023/09/07 00:20:30 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/annalyns-infiltration/annalyns_infiltration.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 30 + Nosec : 0 + Issues : 0 + + +real 0m0.083s +user 0m0.063s +sys 0m0.067s + + + ============================================================================== + +Exit code: 0 + +real 0m0.106s +user 0m0.077s +sys 0m0.083s + +real 0m0.109s +user 0m0.077s +sys 0m0.086s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.007s +sys 0m0.012s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestCanFastAttack === RUN TestCanFastAttack/Knight_is_awake === RUN TestCanFastAttack/Knight_is_sleeping @@ -96,36 +679,57 @@ go test -v -covermode=count -coverprofile coverage.out annalyn --- PASS: ExampleCanFreePrisoner (0.00s) PASS coverage: 100.0% of statements -ok annalyn 0.027s coverage: 100.0% of statements +ok annalyn 0.003s coverage: 100.0% of statements -real 0m1.685s -user 0m2.116s -sys 0m1.111s +real 0m0.172s +user 0m0.207s +sys 0m0.150s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + annalyn/annalyns_infiltration.go:4: CanFastAttack 100.0% annalyn/annalyns_infiltration.go:9: CanSpy 100.0% annalyn/annalyns_infiltration.go:14: CanSignalPrisoner 100.0% annalyn/annalyns_infiltration.go:20: CanFreePrisoner 100.0% total: (statements) 100.0% -real 0m0.187s -user 0m0.113s -sys 0m0.169s +real 0m0.025s +user 0m0.013s +sys 0m0.018s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.166s -user 0m0.085s -sys 0m0.152s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic annalyn +real 0m0.026s +user 0m0.010s +sys 0m0.022s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.013s +user 0m0.008s +sys 0m0.010s + +real 0m0.013s +user 0m0.008s +sys 0m0.010s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestCanFastAttack === RUN TestCanFastAttack/Knight_is_awake === RUN TestCanFastAttack/Knight_is_sleeping @@ -179,7 +783,7 @@ go test -v -race -covermode=atomic annalyn === RUN TestCanFreePrisoner/Knight_and_archer_are_awake._Prisoner_is_awake._Dog_is_present === RUN TestCanFreePrisoner/Knight_and_archer_are_awake._Prisoner_is_sleeping._Dog_is_not_present#01 === RUN TestCanFreePrisoner/Everyone_is_sleeping._Dog_is_not_present ---- PASS: TestCanFreePrisoner (0.02s) +--- PASS: TestCanFreePrisoner (0.00s) --- PASS: TestCanFreePrisoner/All_characters_are_sleeping._Dog_is_not_present. (0.00s) --- PASS: TestCanFreePrisoner/All_characters_are_sleeping._Dog_is_present. (0.00s) --- PASS: TestCanFreePrisoner/Knight_and_archer_are_sleeping._Prisoner_is_awake._Dog_is_not_present. (0.00s) @@ -208,81 +812,143 @@ go test -v -race -covermode=atomic annalyn --- PASS: ExampleCanFreePrisoner (0.00s) PASS coverage: 100.0% of statements -ok annalyn 0.096s coverage: 100.0% of statements +ok annalyn 1.024s coverage: 100.0% of statements -real 0m2.045s -user 0m2.152s -sys 0m1.073s +real 0m1.251s +user 0m0.304s +sys 0m0.176s -=============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -PASS -ok annalyn 0.064s + ============================================================================== -real 0m1.051s -user 0m1.191s -sys 0m0.715s +Exit code: 0 -=============================================================================== - -go test -tags bonus -PASS -ok annalyn 0.006s +real 0m1.518s +user 0m0.556s +sys 0m0.405s -real 0m1.103s -user 0m1.449s -sys 0m0.807s +real 0m1.520s +user 0m0.557s +sys 0m0.406s =============================================================================== -No old benchmarks to run benchstat against. +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -=============================================================================== - -go vet annalyn +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok annalyn 0.002s -real 0m0.683s -user 0m0.895s -sys 0m0.614s +real 0m0.149s +user 0m0.204s +sys 0m0.144s =============================================================================== -go fix annalyn +gotest -v -tags bonus +=== RUN TestCanFastAttack +=== RUN TestCanFastAttack/Knight_is_awake +=== RUN TestCanFastAttack/Knight_is_sleeping +--- PASS: TestCanFastAttack (0.00s) + --- PASS: TestCanFastAttack/Knight_is_awake (0.00s) + --- PASS: TestCanFastAttack/Knight_is_sleeping (0.00s) +=== RUN TestCanSpy +=== RUN TestCanSpy/All_characters_are_sleeping +=== RUN TestCanSpy/Knight_is_awake,_archer_and_prisoner_are_sleeping +=== RUN TestCanSpy/Knight_and_archer_are_awake,_prisoner_is_sleeping +=== RUN TestCanSpy/Knight_and_prisoner_are_awake,_archer_is_sleeping +=== RUN TestCanSpy/Archer_is_awake,_knight_and_prisoner_are_sleeping +=== RUN TestCanSpy/Archer_and_prisoner_are_awake,_knight_is_sleeping +=== RUN TestCanSpy/Prisoner_is_awake,_knight_and_archer_are_sleeping +=== RUN TestCanSpy/All_characters_are_awake +--- PASS: TestCanSpy (0.00s) + --- PASS: TestCanSpy/All_characters_are_sleeping (0.00s) + --- PASS: TestCanSpy/Knight_is_awake,_archer_and_prisoner_are_sleeping (0.00s) + --- PASS: TestCanSpy/Knight_and_archer_are_awake,_prisoner_is_sleeping (0.00s) + --- PASS: TestCanSpy/Knight_and_prisoner_are_awake,_archer_is_sleeping (0.00s) + --- PASS: TestCanSpy/Archer_is_awake,_knight_and_prisoner_are_sleeping (0.00s) + --- PASS: TestCanSpy/Archer_and_prisoner_are_awake,_knight_is_sleeping (0.00s) + --- PASS: TestCanSpy/Prisoner_is_awake,_knight_and_archer_are_sleeping (0.00s) + --- PASS: TestCanSpy/All_characters_are_awake (0.00s) +=== RUN TestCanSignalPrisoner +=== RUN TestCanSignalPrisoner/All_characters_are_sleeping +=== RUN TestCanSignalPrisoner/Archer_is_sleeping,_prisoner_is_awake +=== RUN TestCanSignalPrisoner/Archer_is_awake,_prisoner_is_sleeping +=== RUN TestCanSignalPrisoner/All_characters_are_awake +--- PASS: TestCanSignalPrisoner (0.00s) + --- PASS: TestCanSignalPrisoner/All_characters_are_sleeping (0.00s) + --- PASS: TestCanSignalPrisoner/Archer_is_sleeping,_prisoner_is_awake (0.00s) + --- PASS: TestCanSignalPrisoner/Archer_is_awake,_prisoner_is_sleeping (0.00s) + --- PASS: TestCanSignalPrisoner/All_characters_are_awake (0.00s) +=== RUN TestCanFreePrisoner +=== RUN TestCanFreePrisoner/All_characters_are_sleeping._Dog_is_not_present. +=== RUN TestCanFreePrisoner/All_characters_are_sleeping._Dog_is_present. +=== RUN TestCanFreePrisoner/Knight_and_archer_are_sleeping._Prisoner_is_awake._Dog_is_not_present. +=== RUN TestCanFreePrisoner/Knight_and_archer_are_sleeping._Prisoner_is_awake._Dog_is_present. +=== RUN TestCanFreePrisoner/Knight_is_sleeping._Archer_is_awake._Prisoner_is_sleeping._Dog_is_not_present. +=== RUN TestCanFreePrisoner/Knight_is_sleeping._Archer_is_awake._Prisoner_is_sleeping._Dog_is_present. +=== RUN TestCanFreePrisoner/Knight_is_sleeping._Archer_is_awake._Prisoner_is_awake._Dog_is_not_present. +=== RUN TestCanFreePrisoner/Knight_is_sleeping._Archer_is_awake._Prisoner_is_awake._Dog_is_present. +=== RUN TestCanFreePrisoner/Knight_is_awake._Archer_is_sleeping._Prisoner_is_sleeping._Dog_is_not_present. +=== RUN TestCanFreePrisoner/Knight_is_awake._Archer_is_sleeping._Prisoner_is_sleeping._Dog_is_present. +=== RUN TestCanFreePrisoner/Knight_is_awake._Archer_is_sleeping._Prisoner_is_awake._Dog_is_not_present +=== RUN TestCanFreePrisoner/Knight_is_awake._Archer_is_sleeping._Prisoner_is_awake._Dog_is_present +=== RUN TestCanFreePrisoner/Knight_and_archer_are_awake._Prisoner_is_sleeping._Dog_is_not_present +=== RUN TestCanFreePrisoner/Knight_and_archer_are_awake._Prisoner_is_sleeping._Dog_is_present +=== RUN TestCanFreePrisoner/Knight_and_archer_are_awake._Prisoner_is_awake._Dog_is_not_present +=== RUN TestCanFreePrisoner/Knight_and_archer_are_awake._Prisoner_is_awake._Dog_is_present +=== RUN TestCanFreePrisoner/Knight_and_archer_are_awake._Prisoner_is_sleeping._Dog_is_not_present#01 +=== RUN TestCanFreePrisoner/Everyone_is_sleeping._Dog_is_not_present +--- PASS: TestCanFreePrisoner (0.00s) + --- PASS: TestCanFreePrisoner/All_characters_are_sleeping._Dog_is_not_present. (0.00s) + --- PASS: TestCanFreePrisoner/All_characters_are_sleeping._Dog_is_present. (0.00s) + --- PASS: TestCanFreePrisoner/Knight_and_archer_are_sleeping._Prisoner_is_awake._Dog_is_not_present. (0.00s) + --- PASS: TestCanFreePrisoner/Knight_and_archer_are_sleeping._Prisoner_is_awake._Dog_is_present. (0.00s) + --- PASS: TestCanFreePrisoner/Knight_is_sleeping._Archer_is_awake._Prisoner_is_sleeping._Dog_is_not_present. (0.00s) + --- PASS: TestCanFreePrisoner/Knight_is_sleeping._Archer_is_awake._Prisoner_is_sleeping._Dog_is_present. (0.00s) + --- PASS: TestCanFreePrisoner/Knight_is_sleeping._Archer_is_awake._Prisoner_is_awake._Dog_is_not_present. (0.00s) + --- PASS: TestCanFreePrisoner/Knight_is_sleeping._Archer_is_awake._Prisoner_is_awake._Dog_is_present. (0.00s) + --- PASS: TestCanFreePrisoner/Knight_is_awake._Archer_is_sleeping._Prisoner_is_sleeping._Dog_is_not_present. (0.00s) + --- PASS: TestCanFreePrisoner/Knight_is_awake._Archer_is_sleeping._Prisoner_is_sleeping._Dog_is_present. (0.00s) + --- PASS: TestCanFreePrisoner/Knight_is_awake._Archer_is_sleeping._Prisoner_is_awake._Dog_is_not_present (0.00s) + --- PASS: TestCanFreePrisoner/Knight_is_awake._Archer_is_sleeping._Prisoner_is_awake._Dog_is_present (0.00s) + --- PASS: TestCanFreePrisoner/Knight_and_archer_are_awake._Prisoner_is_sleeping._Dog_is_not_present (0.00s) + --- PASS: TestCanFreePrisoner/Knight_and_archer_are_awake._Prisoner_is_sleeping._Dog_is_present (0.00s) + --- PASS: TestCanFreePrisoner/Knight_and_archer_are_awake._Prisoner_is_awake._Dog_is_not_present (0.00s) + --- PASS: TestCanFreePrisoner/Knight_and_archer_are_awake._Prisoner_is_awake._Dog_is_present (0.00s) + --- PASS: TestCanFreePrisoner/Knight_and_archer_are_awake._Prisoner_is_sleeping._Dog_is_not_present#01 (0.00s) + --- PASS: TestCanFreePrisoner/Everyone_is_sleeping._Dog_is_not_present (0.00s) +=== RUN ExampleCanFastAttack +--- PASS: ExampleCanFastAttack (0.00s) +=== RUN ExampleCanSpy +--- PASS: ExampleCanSpy (0.00s) +=== RUN ExampleCanSignalPrisoner +--- PASS: ExampleCanSignalPrisoner (0.00s) +=== RUN ExampleCanFreePrisoner +--- PASS: ExampleCanFreePrisoner (0.00s) +PASS +ok annalyn 0.002s -real 0m0.089s -user 0m0.039s -sys 0m0.068s +real 0m0.139s +user 0m0.177s +sys 0m0.121s =============================================================================== -gosec ./annalyns-infiltration -[gosec] 2022/07/30 13:53:49 Including rules: default -[gosec] 2022/07/30 13:53:49 Excluding rules: default -[gosec] 2022/07/30 13:53:49 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/annalyns-infiltration -[gosec] 2022/07/30 13:53:49 Checking package: annalyn -[gosec] 2022/07/30 13:53:49 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/annalyns-infiltration/annalyns_infiltration.go -Results: - - -Summary: - Files: 1 - Lines: 30 - Nosec: 0 - Issues: 0 - +benchstat benchstat-old.txt benchstat-new.txt -real 0m0.537s -user 0m0.722s -sys 0m0.314s +real 0m0.001s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output annalyn-doc.md -real 0m0.119s -user 0m0.129s -sys 0m0.074s +real 0m0.009s +user 0m0.005s +sys 0m0.004s =============================================================================== @@ -308,9 +974,9 @@ func CanSpy(knightIsAwake, archerIsAwake, prisonerIsAwake bool) bool CanSpy can be executed if at least one of the characters is awake -real 0m0.412s -user 0m0.219s -sys 0m0.443s +real 0m0.028s +user 0m0.011s +sys 0m0.024s =============================================================================== diff --git a/go/armstrong-numbers/armstrong-doc.md b/go/armstrong-numbers/armstrong-doc.md index 5d5bc655..6bebce71 100755 --- a/go/armstrong-numbers/armstrong-doc.md +++ b/go/armstrong-numbers/armstrong-doc.md @@ -6,7 +6,7 @@ import "armstrong" ``` -Package armstrong checks that a number is an Armstrong number\. +Package armstrong checks that a number is an Armstrong number. ## Index @@ -19,7 +19,7 @@ Package armstrong checks that a number is an Armstrong number\. func IsNumber(number int) bool ``` -IsNumber returns true if the passed number equals the sum of it's digits to the power of the number of digits\. +IsNumber returns true if the passed number equals the sum of it's digits to the power of the number of digits.

Example

diff --git a/go/armstrong-numbers/benchstat-new.txt b/go/armstrong-numbers/benchstat-new.txt index 0422c0fa..4b28aff4 100644 --- a/go/armstrong-numbers/benchstat-new.txt +++ b/go/armstrong-numbers/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: armstrong -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkIsNumber-4 461610 3258 ns/op 212 B/op 43 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkIsNumber +BenchmarkIsNumber-8 1231435 959.5 ns/op 72 B/op 11 allocs/op PASS -ok armstrong 1.593s +ok armstrong 2.154s diff --git a/go/armstrong-numbers/benchstat-old.txt b/go/armstrong-numbers/benchstat-old.txt index 76c34b3e..0422c0fa 100644 --- a/go/armstrong-numbers/benchstat-old.txt +++ b/go/armstrong-numbers/benchstat-old.txt @@ -2,14 +2,6 @@ goos: linux goarch: amd64 pkg: armstrong cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkIsNumber/0-4 6247946 165.2 ns/op 4 B/op 1 allocs/op -BenchmarkIsNumber/5-4 7303632 167.6 ns/op 4 B/op 1 allocs/op -BenchmarkIsNumber/10-4 4960125 270.0 ns/op 12 B/op 3 allocs/op -BenchmarkIsNumber/153-4 3109310 368.2 ns/op 16 B/op 4 allocs/op -BenchmarkIsNumber/100-4 3486847 299.8 ns/op 16 B/op 4 allocs/op -BenchmarkIsNumber/9474-4 2473671 475.4 ns/op 32 B/op 6 allocs/op -BenchmarkIsNumber/9475-4 2123463 525.2 ns/op 32 B/op 6 allocs/op -BenchmarkIsNumber/9926315-4 1591429 783.3 ns/op 48 B/op 9 allocs/op -BenchmarkIsNumber/9926314-4 1539709 746.1 ns/op 48 B/op 9 allocs/op +BenchmarkIsNumber-4 461610 3258 ns/op 212 B/op 43 allocs/op PASS -ok armstrong 15.886s +ok armstrong 1.593s diff --git a/go/armstrong-numbers/coverage-annotations.txt b/go/armstrong-numbers/coverage-annotations.txt new file mode 100644 index 00000000..5ce90e20 --- /dev/null +++ b/go/armstrong-numbers/coverage-annotations.txt @@ -0,0 +1,23 @@ + +12 func IsNumber(number int) bool { +13 var digits string = fmt.Sprintf("%d", number) +14 var exponent float64 = float64(len(digits)) +15 var sum int +16 +17 for _, r := range digits { +18 n, e := strconv.Atoi(string(r)) +19 if e != nil { +20 MISS panic(e) +21 } +22 +23 f := float64(n) +24 sum += int(math.Pow(f, exponent)) +25 } +26 +27 if number == sum { +28 return true +29 } +30 +31 return false +32 } + diff --git a/go/armstrong-numbers/coverage.out b/go/armstrong-numbers/coverage.out index aedaed83..70d2703b 100644 --- a/go/armstrong-numbers/coverage.out +++ b/go/armstrong-numbers/coverage.out @@ -1,8 +1,8 @@ mode: count armstrong/armstrong_numbers.go:12.32,17.27 4 11 -armstrong/armstrong_numbers.go:27.2,27.19 1 11 -armstrong/armstrong_numbers.go:31.2,31.14 1 5 armstrong/armstrong_numbers.go:17.27,19.15 2 37 -armstrong/armstrong_numbers.go:23.3,24.36 2 37 armstrong/armstrong_numbers.go:19.15,20.12 1 0 +armstrong/armstrong_numbers.go:23.3,24.36 2 37 +armstrong/armstrong_numbers.go:27.2,27.19 1 11 armstrong/armstrong_numbers.go:27.19,29.3 1 6 +armstrong/armstrong_numbers.go:31.2,31.14 1 5 diff --git a/go/armstrong-numbers/run-tests-go.txt b/go/armstrong-numbers/run-tests-go.txt index 0c907bc6..3e117317 100644 --- a/go/armstrong-numbers/run-tests-go.txt +++ b/go/armstrong-numbers/run-tests-go.txt @@ -5,15 +5,579 @@ Go packages: armstrong =============================================================================== -golint armstrong +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.185s -user 0m0.213s -sys 0m0.188s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.034s +user 0m0.020s +sys 0m0.039s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +armstrong_numbers.go:13:13: var-declaration: should omit type string from declaration of var digits; it will be inferred from the right-hand side (revive) + var digits string = fmt.Sprintf("%d", number) + ^ +armstrong_numbers.go:14:15: var-declaration: should omit type float64 from declaration of var exponent; it will be inferred from the right-hand side (revive) + var exponent float64 = float64(len(digits)) + ^ +armstrong_numbers_test.go:10:26: Using the variable on range scope `tc` in function literal (scopelint) + if actual := IsNumber(tc.input); actual != tc.expected { + ^ +armstrong_numbers_test.go:11:45: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("IsNumber(%d) = %t, want: %t", tc.input, actual, tc.expected) + ^ +armstrong_numbers.go:15:2: declarations should never be cuddled (wsl) + var sum int + ^ +armstrong_numbers_test.go:21:2: ranges should only be cuddled with assignments used in the iteration (wsl) + for _, tc := range testCases { + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +armstrong_numbers.go:27:2: S1008: should use 'return number == sum' instead of 'if number == sum { return true }; return false' (gosimple) + if number == sum { + ^ +armstrong_numbers_test.go:7:1: Function TestArmstrong missing the call to method parallel (paralleltest) +func TestArmstrong(t *testing.T) { +^ +armstrong_numbers_test.go:8:2: Range statement for test TestArmstrong missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +armstrong_numbers_examples_test.go:1:9: package should be `armstrong_test` instead of `armstrong` (testpackage) +package armstrong + ^ +armstrong_numbers_test.go:1:9: package should be `armstrong_test` instead of `armstrong` (testpackage) +package armstrong + ^ +cases_test.go:1:9: package should be `armstrong_test` instead of `armstrong` (testpackage) +package armstrong + ^ + +real 0m0.475s +user 0m0.707s +sys 0m0.440s + + + ============================================================================== + +Exit code: -1 + +real 0m0.527s +user 0m0.731s +sys 0m0.499s + +real 0m0.530s +user 0m0.732s +sys 0m0.500s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.013s +sys 0m0.026s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +armstrong_numbers.go + (14, 15) https://revive.run/r#var-declaration should omit type float64 from declaration of var exponent; it will be inferred from the right-hand side + + + ✖ 1 problem (0 errors) (1 warnings) + +real 0m0.063s +user 0m0.027s +sys 0m0.052s + + + ============================================================================== + +Exit code: 0 + +real 0m0.096s +user 0m0.044s +sys 0m0.086s + +real 0m0.098s +user 0m0.045s +sys 0m0.087s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.000s +user 0m0.000s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.018s +sys 0m0.020s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "armstrong" + +real 0m0.085s +user 0m0.109s +sys 0m0.116s + + + ============================================================================== + +Exit code: -1 + +real 0m0.119s +user 0m0.131s +sys 0m0.148s + +real 0m0.120s +user 0m0.131s +sys 0m0.149s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.016s +sys 0m0.027s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +armstrong_numbers.go:13:13: should omit type string from declaration; it will be inferred from the right-hand side (ST1023) +armstrong_numbers.go:14:15: should omit type float64 from declaration; it will be inferred from the right-hand side (ST1023) +armstrong_numbers.go:27:2: should use 'return number == sum' instead of 'if number == sum { return true }; return false' (S1008) + +real 0m0.156s +user 0m0.218s +sys 0m0.121s + + + ============================================================================== + +Exit code: -1 + +real 0m0.189s +user 0m0.240s +sys 0m0.159s + +real 0m0.191s +user 0m0.240s +sys 0m0.161s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out armstrong +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.038s +sys 0m0.048s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.836s +user 0m2.065s +sys 0m0.273s + + + ============================================================================== + +Exit code: 0 + +real 0m0.880s +user 0m2.110s +sys 0m0.329s + +real 0m0.881s +user 0m2.112s +sys 0m0.329s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.020s +sys 0m0.024s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.068s +user 0m0.097s +sys 0m0.083s + + + ============================================================================== + +Exit code: 0 + +real 0m0.102s +user 0m0.121s +sys 0m0.118s + +real 0m0.104s +user 0m0.122s +sys 0m0.118s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.020s +sys 0m0.027s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.022s +user 0m0.022s +sys 0m0.017s + + + ============================================================================== + +Exit code: 0 + +real 0m0.057s +user 0m0.046s +sys 0m0.053s + +real 0m0.059s +user 0m0.046s +sys 0m0.055s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.022s +sys 0m0.033s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.457s +user 0m1.457s +sys 0m0.311s + + + ============================================================================== + +Exit code: 0 + +real 0m0.500s +user 0m1.483s +sys 0m0.360s + +real 0m0.502s +user 0m1.484s +sys 0m0.361s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.023s +sys 0m0.020s + + + ============================================================================== + +Running: gocyclo . + +4 armstrong BenchmarkIsNumber armstrong_numbers_test.go:17:1 +4 armstrong IsNumber armstrong_numbers.go:12:1 +3 armstrong TestArmstrong armstrong_numbers_test.go:7:1 +1 armstrong ExampleIsNumber armstrong_numbers_examples_test.go:7:1 + +real 0m0.002s +user 0m0.000s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.035s +user 0m0.030s +sys 0m0.029s + +real 0m0.037s +user 0m0.032s +sys 0m0.029s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.034s +user 0m0.039s +sys 0m0.016s + + + ============================================================================== + +Exit code: 0 + +real 0m0.048s +user 0m0.045s +sys 0m0.028s + +real 0m0.050s +user 0m0.046s +sys 0m0.030s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.018s +sys 0m0.035s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:20:34 Including rules: default +[gosec] 2023/09/07 00:20:34 Excluding rules: default +[gosec] 2023/09/07 00:20:34 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/armstrong-numbers +[gosec] 2023/09/07 00:20:34 Checking package: armstrong +[gosec] 2023/09/07 00:20:34 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/armstrong-numbers/armstrong_numbers.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 32 + Nosec : 0 + Issues : 0 + + +real 0m0.123s +user 0m0.125s +sys 0m0.118s + + + ============================================================================== + +Exit code: 0 + +real 0m0.172s +user 0m0.150s +sys 0m0.168s + +real 0m0.173s +user 0m0.151s +sys 0m0.169s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.018s +sys 0m0.026s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestArmstrong === RUN TestArmstrong/Zero_is_an_Armstrong_number === RUN TestArmstrong/Single-digit_numbers_are_Armstrong_numbers @@ -38,33 +602,77 @@ go test -v -covermode=count -coverprofile coverage.out armstrong --- PASS: ExampleIsNumber (0.00s) PASS coverage: 91.7% of statements -ok armstrong 0.010s coverage: 91.7% of statements +ok armstrong 0.003s coverage: 91.7% of statements -real 0m0.534s -user 0m0.642s -sys 0m0.394s +real 0m0.167s +user 0m0.234s +sys 0m0.150s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + armstrong/armstrong_numbers.go:12: IsNumber 91.7% total: (statements) 91.7% -real 0m0.225s -user 0m0.237s -sys 0m0.216s +real 0m0.049s +user 0m0.067s +sys 0m0.063s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.235s -user 0m0.209s -sys 0m0.221s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic armstrong +real 0m0.060s +user 0m0.071s +sys 0m0.079s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +12 func IsNumber(number int) bool { +13 var digits string = fmt.Sprintf("%d", number) +14 var exponent float64 = float64(len(digits)) +15 var sum int +16 +17 for _, r := range digits { +18 n, e := strconv.Atoi(string(r)) +19 if e != nil { +20 MISS panic(e) +21 } +22 +23 f := float64(n) +24 sum += int(math.Pow(f, exponent)) +25 } +26 +27 if number == sum { +28 return true +29 } +30 +31 return false +32 } + + +real 0m0.017s +user 0m0.021s +sys 0m0.019s + +real 0m0.017s +user 0m0.021s +sys 0m0.019s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestArmstrong === RUN TestArmstrong/Zero_is_an_Armstrong_number === RUN TestArmstrong/Single-digit_numbers_are_Armstrong_numbers @@ -75,7 +683,7 @@ go test -v -race -covermode=atomic armstrong === RUN TestArmstrong/Four-digit_number_that_is_not_an_Armstrong_number === RUN TestArmstrong/Seven-digit_number_that_is_an_Armstrong_number === RUN TestArmstrong/Seven-digit_number_that_is_not_an_Armstrong_number ---- PASS: TestArmstrong (0.01s) +--- PASS: TestArmstrong (0.00s) --- PASS: TestArmstrong/Zero_is_an_Armstrong_number (0.00s) --- PASS: TestArmstrong/Single-digit_numbers_are_Armstrong_numbers (0.00s) --- PASS: TestArmstrong/There_are_no_two-digit_Armstrong_numbers (0.00s) @@ -89,89 +697,126 @@ go test -v -race -covermode=atomic armstrong --- PASS: ExampleIsNumber (0.00s) PASS coverage: 91.7% of statements -ok armstrong 0.045s coverage: 91.7% of statements +ok armstrong 1.013s coverage: 91.7% of statements -real 0m0.730s -user 0m0.761s -sys 0m0.550s +real 0m1.236s +user 0m0.273s +sys 0m0.156s + + + ============================================================================== + +Exit code: 0 + +real 0m1.569s +user 0m0.689s +sys 0m0.505s + +real 0m1.570s +user 0m0.690s +sys 0m0.506s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: armstrong -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkIsNumber-4 461610 3258 ns/op 212 B/op 43 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkIsNumber +BenchmarkIsNumber-8 1231435 959.5 ns/op 72 B/op 11 allocs/op PASS -ok armstrong 1.593s +ok armstrong 2.154s -real 0m2.053s -user 0m2.279s -sys 0m0.392s +real 0m2.316s +user 0m2.367s +sys 0m0.144s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestArmstrong +=== RUN TestArmstrong/Zero_is_an_Armstrong_number +=== RUN TestArmstrong/Single-digit_numbers_are_Armstrong_numbers +=== RUN TestArmstrong/There_are_no_two-digit_Armstrong_numbers +=== RUN TestArmstrong/Three-digit_number_that_is_an_Armstrong_number +=== RUN TestArmstrong/Three-digit_number_that_is_not_an_Armstrong_number +=== RUN TestArmstrong/Four-digit_number_that_is_an_Armstrong_number +=== RUN TestArmstrong/Four-digit_number_that_is_not_an_Armstrong_number +=== RUN TestArmstrong/Seven-digit_number_that_is_an_Armstrong_number +=== RUN TestArmstrong/Seven-digit_number_that_is_not_an_Armstrong_number +--- PASS: TestArmstrong (0.00s) + --- PASS: TestArmstrong/Zero_is_an_Armstrong_number (0.00s) + --- PASS: TestArmstrong/Single-digit_numbers_are_Armstrong_numbers (0.00s) + --- PASS: TestArmstrong/There_are_no_two-digit_Armstrong_numbers (0.00s) + --- PASS: TestArmstrong/Three-digit_number_that_is_an_Armstrong_number (0.00s) + --- PASS: TestArmstrong/Three-digit_number_that_is_not_an_Armstrong_number (0.00s) + --- PASS: TestArmstrong/Four-digit_number_that_is_an_Armstrong_number (0.00s) + --- PASS: TestArmstrong/Four-digit_number_that_is_not_an_Armstrong_number (0.00s) + --- PASS: TestArmstrong/Seven-digit_number_that_is_an_Armstrong_number (0.00s) + --- PASS: TestArmstrong/Seven-digit_number_that_is_not_an_Armstrong_number (0.00s) +=== RUN ExampleIsNumber +--- PASS: ExampleIsNumber (0.00s) PASS -ok armstrong 0.009s +ok armstrong 0.002s -real 0m0.534s -user 0m0.593s -sys 0m0.414s +real 0m0.132s +user 0m0.209s +sys 0m0.133s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m0.754s -user 0m0.709s -sys 0m0.411s - benchstat benchstat-old.txt benchstat-new.txt +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: armstrong +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +IsNumber-8 959.5n ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +IsNumber-8 72.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +IsNumber-8 11.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.009s -user 0m0.003s -sys 0m0.004s - -=============================================================================== - -go vet armstrong - -real 0m0.353s -user 0m0.402s -sys 0m0.337s - -=============================================================================== - -go fix armstrong - -real 0m0.187s -user 0m0.179s -sys 0m0.156s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +IsNumber-4 3.258µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +IsNumber-4 212.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./armstrong-numbers -[gosec] 2022/07/24 00:20:42 Including rules: default -[gosec] 2022/07/24 00:20:42 Excluding rules: default -[gosec] 2022/07/24 00:20:42 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/armstrong-numbers -2022/07/24 00:20:42 internal error: package "fmt" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +IsNumber-4 43.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.519s -user 0m0.640s -sys 0m0.385s +real 0m0.003s +user 0m0.002s +sys 0m0.001s =============================================================================== gomarkdoc --output armstrong-doc.md -real 0m0.033s -user 0m0.020s -sys 0m0.018s +real 0m0.013s +user 0m0.006s +sys 0m0.007s =============================================================================== @@ -187,9 +832,9 @@ func IsNumber(number int) bool the power of the number of digits. -real 0m0.214s -user 0m0.219s -sys 0m0.205s +real 0m0.037s +user 0m0.029s +sys 0m0.034s =============================================================================== diff --git a/go/atbash-cipher/atbash-doc.md b/go/atbash-cipher/atbash-doc.md index a637c2dd..c592b806 100755 --- a/go/atbash-cipher/atbash-doc.md +++ b/go/atbash-cipher/atbash-doc.md @@ -6,7 +6,7 @@ import "atbash" ``` -Package atbash implements the atbash ciper\. +Package atbash implements the atbash ciper. ## Index @@ -19,7 +19,7 @@ Package atbash implements the atbash ciper\. func Atbash(plain string) string ``` -Atbash returns a simple substitution cipher text\. Ciphertext is written out in groups of fixed length\, the traditional group size being 5 letters\, leaving numbers unchanged\, and punctuation is excluded\. This is to make it harder to guess things based on word boundaries\. All text will be encoded as lowercase letters\. +Atbash returns a simple substitution cipher text. Ciphertext is written out in groups of fixed length, the traditional group size being 5 letters, leaving numbers unchanged, and punctuation is excluded. This is to make it harder to guess things based on word boundaries. All text will be encoded as lowercase letters.

Example

diff --git a/go/atbash-cipher/benchstat-new.txt b/go/atbash-cipher/benchstat-new.txt index f5716879..df08c5c2 100644 --- a/go/atbash-cipher/benchstat-new.txt +++ b/go/atbash-cipher/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: atbash -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkAtbash-4 126147 8726 ns/op 1216 B/op 55 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkAtbash +BenchmarkAtbash-8 335793 3605 ns/op 1216 B/op 55 allocs/op PASS -ok atbash 1.241s +ok atbash 2.112s diff --git a/go/atbash-cipher/benchstat-old.txt b/go/atbash-cipher/benchstat-old.txt new file mode 100644 index 00000000..f5716879 --- /dev/null +++ b/go/atbash-cipher/benchstat-old.txt @@ -0,0 +1,7 @@ +goos: linux +goarch: amd64 +pkg: atbash +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkAtbash-4 126147 8726 ns/op 1216 B/op 55 allocs/op +PASS +ok atbash 1.241s diff --git a/go/atbash-cipher/coverage-annotations.txt b/go/atbash-cipher/coverage-annotations.txt new file mode 100644 index 00000000..76ef2ff6 --- /dev/null +++ b/go/atbash-cipher/coverage-annotations.txt @@ -0,0 +1,29 @@ + +15 func Atbash(plain string) string { +16 if len(plain) == 0 { +17 MISS return "" +18 } +19 +20 var cipher strings.Builder +21 var count int +22 +23 for _, char := range plain { +24 c, e := shiftChar(char) +25 +26 // ok to ignore the errors since we're dropping non-encodable characters +27 if e != nil { +28 continue +29 } +30 +31 if count%5 == 0 && count != 0 { +32 cipher.WriteString(" ") +33 } +34 +35 count++ +36 +37 cipher.WriteString(string(c)) +38 } +39 +40 return cipher.String() +41 } + diff --git a/go/atbash-cipher/coverage.out b/go/atbash-cipher/coverage.out index 8cc2f92b..5e481a22 100644 --- a/go/atbash-cipher/coverage.out +++ b/go/atbash-cipher/coverage.out @@ -1,17 +1,17 @@ mode: count atbash/atbash_cipher.go:15.34,16.21 1 9 -atbash/atbash_cipher.go:20.2,23.29 3 9 -atbash/atbash_cipher.go:40.2,40.24 1 9 atbash/atbash_cipher.go:16.21,18.3 1 0 +atbash/atbash_cipher.go:20.2,23.29 3 9 atbash/atbash_cipher.go:23.29,27.15 2 136 -atbash/atbash_cipher.go:31.3,31.33 1 116 -atbash/atbash_cipher.go:35.3,37.32 2 116 atbash/atbash_cipher.go:27.15,28.12 1 20 +atbash/atbash_cipher.go:31.3,31.33 1 116 atbash/atbash_cipher.go:31.33,33.4 1 18 +atbash/atbash_cipher.go:35.3,37.32 2 116 +atbash/atbash_cipher.go:40.2,40.24 1 9 atbash/atbash_cipher.go:43.41,44.27 1 136 -atbash/atbash_cipher.go:48.2,50.28 2 136 -atbash/atbash_cipher.go:54.2,54.28 1 133 -atbash/atbash_cipher.go:58.2,58.63 1 20 atbash/atbash_cipher.go:44.27,46.3 1 35 +atbash/atbash_cipher.go:48.2,50.28 2 136 atbash/atbash_cipher.go:50.28,52.3 1 3 +atbash/atbash_cipher.go:54.2,54.28 1 133 atbash/atbash_cipher.go:54.28,56.3 1 113 +atbash/atbash_cipher.go:58.2,58.63 1 20 diff --git a/go/atbash-cipher/run-tests-go.txt b/go/atbash-cipher/run-tests-go.txt index b60e1ccd..0de01462 100644 --- a/go/atbash-cipher/run-tests-go.txt +++ b/go/atbash-cipher/run-tests-go.txt @@ -5,15 +5,579 @@ Go packages: atbash =============================================================================== -golint atbash +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.032s +sys 0m0.016s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +atbash_cipher_test.go:8:21: Using the variable on range scope `tc` in function literal (scopelint) + actual := Atbash(tc.phrase) + ^ +atbash_cipher_test.go:9:17: Using the variable on range scope `tc` in function literal (scopelint) + if actual != tc.expected { + ^ +atbash_cipher_test.go:10:58: Using the variable on range scope `tc` in function literal (scopelint) + t.Errorf("Atbash('%s'): expected '%s', actual '%s'", tc.phrase, tc.expected, actual) + ^ +atbash_cipher.go:21:2: declarations should never be cuddled (wsl) + var count int + ^ +atbash_cipher_test.go:20:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:8:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +atbash_cipher.go:58:17: err113: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"char, %q, is not encodable\", char)" (goerr113) + return '\x00', fmt.Errorf("char, %q, is not encodable", char) + ^ +atbash_cipher.go:48:12: mnd: Magic number: 97, in detected (gomnd) + offset := 97 - 1 + ^ +atbash_cipher.go:55:26: mnd: Magic number: 26, in detected (gomnd) + return rune(((offset + 26) - (int(char) - 1)) + offset), nil + ^ +atbash_cipher_test.go:5:1: Function TestAtbash missing the call to method parallel (paralleltest) +func TestAtbash(t *testing.T) { +^ +atbash_cipher_test.go:6:2: Range statement for test TestAtbash missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +atbash_cipher_examples_test.go:1:9: package should be `atbash_test` instead of `atbash` (testpackage) +package atbash + ^ +atbash_cipher_test.go:1:9: package should be `atbash_test` instead of `atbash` (testpackage) +package atbash + ^ +cases_test.go:1:9: package should be `atbash_test` instead of `atbash` (testpackage) +package atbash + ^ +atbash_cipher.go:24:3: variable name 'c' is too short for the scope of its usage (varnamelen) + c, e := shiftChar(char) + ^ + +real 0m0.526s +user 0m0.746s +sys 0m0.513s + + + ============================================================================== + +Exit code: -1 + +real 0m0.565s +user 0m0.786s +sys 0m0.541s + +real 0m0.568s +user 0m0.788s +sys 0m0.542s -real 0m0.122s -user 0m0.097s -sys 0m0.105s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.016s +sys 0m0.028s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.065s +user 0m0.033s +sys 0m0.051s + + + ============================================================================== + +Exit code: 0 + +real 0m0.112s +user 0m0.063s +sys 0m0.096s + +real 0m0.115s +user 0m0.063s +sys 0m0.099s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.027s +sys 0m0.034s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "atbash" + +real 0m0.118s +user 0m0.154s +sys 0m0.162s + + + ============================================================================== + +Exit code: -1 + +real 0m0.169s +user 0m0.186s +sys 0m0.216s + +real 0m0.171s +user 0m0.187s +sys 0m0.218s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.022s +sys 0m0.023s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.173s +user 0m0.207s +sys 0m0.123s + + + ============================================================================== + +Exit code: 0 + +real 0m0.207s +user 0m0.237s +sys 0m0.155s + +real 0m0.210s +user 0m0.239s +sys 0m0.156s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.015s +sys 0m0.018s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./atbash_cipher.go:16:5: emptyStringTest: replace `len(plain) == 0` with `plain == ""` + +real 0m0.769s +user 0m1.916s +sys 0m0.290s + + + ============================================================================== + +Exit code: -1 + +real 0m0.799s +user 0m1.938s +sys 0m0.316s + +real 0m0.801s +user 0m1.939s +sys 0m0.317s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.033s +sys 0m0.025s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.088s +user 0m0.139s +sys 0m0.123s + + + ============================================================================== + +Exit code: 0 + +real 0m0.128s +user 0m0.176s +sys 0m0.159s + +real 0m0.130s +user 0m0.177s +sys 0m0.160s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.023s +sys 0m0.018s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.032s +user 0m0.024s +sys 0m0.035s + + + ============================================================================== + +Exit code: 0 + +real 0m0.064s +user 0m0.052s +sys 0m0.063s + +real 0m0.066s +user 0m0.053s +sys 0m0.063s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.028s +sys 0m0.031s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.467s +user 0m1.446s +sys 0m0.308s + + + ============================================================================== + +Exit code: 0 + +real 0m0.514s +user 0m1.481s +sys 0m0.355s + +real 0m0.518s +user 0m1.483s +sys 0m0.356s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.018s +sys 0m0.020s + + + ============================================================================== + +Running: gocyclo . + +6 atbash Atbash atbash_cipher.go:15:1 +4 atbash BenchmarkAtbash atbash_cipher_test.go:16:1 +4 atbash shiftChar atbash_cipher.go:43:1 +3 atbash TestAtbash atbash_cipher_test.go:5:1 +1 atbash ExampleAtbash atbash_cipher_examples_test.go:7:1 + +real 0m0.003s +user 0m0.000s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.037s +user 0m0.024s +sys 0m0.033s + +real 0m0.039s +user 0m0.026s +sys 0m0.033s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out atbash +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.025s +user 0m0.035s +sys 0m0.011s + + + ============================================================================== + +Exit code: 0 + +real 0m0.035s +user 0m0.040s +sys 0m0.020s + +real 0m0.037s +user 0m0.041s +sys 0m0.021s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.041s +user 0m0.035s +sys 0m0.045s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:20:41 Including rules: default +[gosec] 2023/09/07 00:20:41 Excluding rules: default +[gosec] 2023/09/07 00:20:41 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/atbash-cipher +[gosec] 2023/09/07 00:20:41 Checking package: atbash +[gosec] 2023/09/07 00:20:41 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/atbash-cipher/atbash_cipher.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 59 + Nosec : 0 + Issues : 0 + + +real 0m0.134s +user 0m0.164s +sys 0m0.098s + + + ============================================================================== + +Exit code: 0 + +real 0m0.195s +user 0m0.209s +sys 0m0.160s + +real 0m0.198s +user 0m0.210s +sys 0m0.162s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.016s +sys 0m0.020s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestAtbash === RUN TestAtbash/encode_yes === RUN TestAtbash/encode_no @@ -36,34 +600,84 @@ go test -v -covermode=count -coverprofile coverage.out atbash --- PASS: ExampleAtbash (0.00s) PASS coverage: 95.2% of statements -ok atbash 0.007s coverage: 95.2% of statements +ok atbash 0.003s coverage: 95.2% of statements -real 0m0.544s -user 0m0.665s -sys 0m0.419s +real 0m0.188s +user 0m0.252s +sys 0m0.190s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + atbash/atbash_cipher.go:15: Atbash 92.3% atbash/atbash_cipher.go:43: shiftChar 100.0% total: (statements) 95.2% -real 0m0.238s -user 0m0.211s -sys 0m0.217s +real 0m0.061s +user 0m0.060s +sys 0m0.100s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.209s -user 0m0.189s -sys 0m0.181s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic atbash +real 0m0.056s +user 0m0.076s +sys 0m0.079s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +15 func Atbash(plain string) string { +16 if len(plain) == 0 { +17 MISS return "" +18 } +19 +20 var cipher strings.Builder +21 var count int +22 +23 for _, char := range plain { +24 c, e := shiftChar(char) +25 +26 // ok to ignore the errors since we're dropping non-encodable characters +27 if e != nil { +28 continue +29 } +30 +31 if count%5 == 0 && count != 0 { +32 cipher.WriteString(" ") +33 } +34 +35 count++ +36 +37 cipher.WriteString(string(c)) +38 } +39 +40 return cipher.String() +41 } + + +real 0m0.019s +user 0m0.019s +sys 0m0.026s + +real 0m0.019s +user 0m0.019s +sys 0m0.026s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestAtbash === RUN TestAtbash/encode_yes === RUN TestAtbash/encode_no @@ -86,105 +700,124 @@ go test -v -race -covermode=atomic atbash --- PASS: ExampleAtbash (0.00s) PASS coverage: 95.2% of statements -ok atbash 0.053s coverage: 95.2% of statements +ok atbash 1.016s coverage: 95.2% of statements -real 0m0.854s -user 0m0.665s -sys 0m0.498s +real 0m1.222s +user 0m0.242s +sys 0m0.145s -=============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -goos: linux -goarch: amd64 -pkg: atbash -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkAtbash-4 126147 8726 ns/op 1216 B/op 55 allocs/op -PASS -ok atbash 1.241s - -real 0m1.609s -user 0m2.009s -sys 0m0.380s + ============================================================================== -=============================================================================== - -go test -tags bonus -PASS -ok atbash 0.007s +Exit code: 0 -real 0m0.552s -user 0m0.600s -sys 0m0.439s - -=============================================================================== +real 0m1.574s +user 0m0.672s +sys 0m0.564s -No old benchmarks to run benchstat against. +real 0m1.577s +user 0m0.675s +sys 0m0.564s =============================================================================== -go vet atbash +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -real 0m0.266s -user 0m0.277s -sys 0m0.359s - -=============================================================================== - -go fix atbash - -real 0m0.118s -user 0m0.078s -sys 0m0.134s - -=============================================================================== - -ineffassign ./... +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +goos: linux +goarch: amd64 +pkg: atbash +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkAtbash +BenchmarkAtbash-8 335793 3605 ns/op 1216 B/op 55 allocs/op +PASS +ok atbash 2.112s -real 0m0.358s -user 0m0.337s -sys 0m0.355s +real 0m2.337s +user 0m2.402s +sys 0m0.201s =============================================================================== -gocyclo . -6 atbash Atbash atbash_cipher.go:15:1 -4 atbash BenchmarkAtbash atbash_cipher_test.go:16:1 -4 atbash shiftChar atbash_cipher.go:43:1 -3 atbash TestAtbash atbash_cipher_test.go:5:1 -1 atbash ExampleAtbash atbash_cipher_examples_test.go:7:1 +gotest -v -tags bonus +=== RUN TestAtbash +=== RUN TestAtbash/encode_yes +=== RUN TestAtbash/encode_no +=== RUN TestAtbash/encode_OMG +=== RUN TestAtbash/encode_spaces +=== RUN TestAtbash/encode_mindblowingly +=== RUN TestAtbash/encode_numbers +=== RUN TestAtbash/encode_deep_thought +=== RUN TestAtbash/encode_all_the_letters +--- PASS: TestAtbash (0.00s) + --- PASS: TestAtbash/encode_yes (0.00s) + --- PASS: TestAtbash/encode_no (0.00s) + --- PASS: TestAtbash/encode_OMG (0.00s) + --- PASS: TestAtbash/encode_spaces (0.00s) + --- PASS: TestAtbash/encode_mindblowingly (0.00s) + --- PASS: TestAtbash/encode_numbers (0.00s) + --- PASS: TestAtbash/encode_deep_thought (0.00s) + --- PASS: TestAtbash/encode_all_the_letters (0.00s) +=== RUN ExampleAtbash +--- PASS: ExampleAtbash (0.00s) +PASS +ok atbash 0.002s -real 0m0.028s -user 0m0.010s -sys 0m0.020s +real 0m0.134s +user 0m0.200s +sys 0m0.105s =============================================================================== -misspell . +benchstat benchstat-old.txt benchstat-new.txt +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: atbash +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Atbash-8 3.605µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Atbash-8 1.188Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Atbash-8 55.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.079s -user 0m0.074s -sys 0m0.057s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Atbash-4 8.726µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +Atbash-4 1.188Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./atbash-cipher -[gosec] 2022/08/18 07:53:23 Including rules: default -[gosec] 2022/08/18 07:53:23 Excluding rules: default -[gosec] 2022/08/18 07:53:23 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/atbash-cipher -2022/08/18 07:53:24 internal error: package "fmt" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +Atbash-4 55.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.501s -user 0m0.463s -sys 0m0.419s +real 0m0.002s +user 0m0.002s +sys 0m0.000s =============================================================================== gomarkdoc --output atbash-doc.md -real 0m0.098s -user 0m0.035s -sys 0m0.032s +real 0m0.013s +user 0m0.006s +sys 0m0.007s =============================================================================== @@ -203,9 +836,9 @@ func Atbash(plain string) string lowercase letters. -real 0m0.160s -user 0m0.091s -sys 0m0.197s +real 0m0.041s +user 0m0.017s +sys 0m0.040s =============================================================================== diff --git a/go/beer-song/benchstat-new.txt b/go/beer-song/benchstat-new.txt index 7d375d74..1cfa618f 100644 --- a/go/beer-song/benchstat-new.txt +++ b/go/beer-song/benchstat-new.txt @@ -3,8 +3,8 @@ goarch: amd64 pkg: beer cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkSeveralVerses -BenchmarkSeveralVerses-8 3228 323315 ns/op 1312432 B/op 1037 allocs/op +BenchmarkSeveralVerses-8 3944 285156 ns/op 1312498 B/op 1038 allocs/op BenchmarkEntireSong -BenchmarkEntireSong-8 5156 195579 ns/op 665279 B/op 880 allocs/op +BenchmarkEntireSong-8 6330 192521 ns/op 665309 B/op 880 allocs/op PASS -ok beer 2.125s +ok beer 3.079s diff --git a/go/beer-song/benchstat-old.txt b/go/beer-song/benchstat-old.txt index a159c48c..7d375d74 100644 --- a/go/beer-song/benchstat-old.txt +++ b/go/beer-song/benchstat-old.txt @@ -1,3 +1,10 @@ -# beer [beer.test] -./beer_song.go:37:11: syntax error: unexpected literal 1, expected { -FAIL beer [build failed] +goos: linux +goarch: amd64 +pkg: beer +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkSeveralVerses +BenchmarkSeveralVerses-8 3228 323315 ns/op 1312432 B/op 1037 allocs/op +BenchmarkEntireSong +BenchmarkEntireSong-8 5156 195579 ns/op 665279 B/op 880 allocs/op +PASS +ok beer 2.125s diff --git a/go/beer-song/run-tests-go.txt b/go/beer-song/run-tests-go.txt index ddfb95d8..6b9bc1e0 100644 --- a/go/beer-song/run-tests-go.txt +++ b/go/beer-song/run-tests-go.txt @@ -5,16 +5,38 @@ Go packages: beer =============================================================================== -golangci-lint run --enable-all ./... -level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " -level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." -level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." -level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.025s +sys 0m0.030s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." -level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " -level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." beer_song_test.go:119:10: Error return value is not checked (errcheck) Verses(tt.upperBound, tt.lowerBound) @@ -109,28 +131,55 @@ package beer beer_song_test.go:1:9: package should be `beer_test` instead of `beer` (testpackage) package beer ^ -beer_song_test.go:50:6: variable name 'tt' is too short for the scope of its usage (varnamelen) - for _, tt := range verseTestCases { - ^ beer_song_test.go:89:6: variable name 'tt' is too short for the scope of its usage (varnamelen) for _, tt := range versesTestCases { ^ +beer_song_test.go:50:6: variable name 'tt' is too short for the scope of its usage (varnamelen) + for _, tt := range verseTestCases { + ^ -real 0m0.639s -user 0m0.972s -sys 0m0.454s +real 0m0.481s +user 0m0.699s +sys 0m0.446s -=============================================================================== -golint ./... + ============================================================================== + +Exit code: -1 -real 0m0.006s -user 0m0.003s -sys 0m0.003s +real 0m0.520s +user 0m0.730s +sys 0m0.485s + +real 0m0.521s +user 0m0.731s +sys 0m0.486s =============================================================================== -revive -formatter=stylish ./... +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.016s +sys 0m0.029s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + beer_song.go (51, 10) https://revive.run/r#var-declaration should omit type string from declaration of var fs1; it will be inferred from the right-hand side (52, 10) https://revive.run/r#var-declaration should omit type string from declaration of var fs2; it will be inferred from the right-hand side @@ -139,72 +188,321 @@ beer_song.go ✖ 3 problems (0 errors) (3 warnings) -real 0m0.038s -user 0m0.019s -sys 0m0.029s +real 0m0.058s +user 0m0.025s +sys 0m0.047s + + + ============================================================================== + +Exit code: 0 + +real 0m0.091s +user 0m0.052s +sys 0m0.080s + +real 0m0.093s +user 0m0.053s +sys 0m0.081s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.087s -user 0m0.151s -sys 0m0.127s +real 0m0.001s +user 0m0.000s +sys 0m0.001s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.050s +user 0m0.060s +sys 0m0.035s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." internal error: package "errors" without types was imported from "beer" -real 0m0.098s -user 0m0.115s -sys 0m0.108s +real 0m0.087s +user 0m0.118s +sys 0m0.101s + + + ============================================================================== + +Exit code: -1 + +real 0m0.148s +user 0m0.183s +sys 0m0.145s + +real 0m0.149s +user 0m0.184s +sys 0m0.145s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + -real 0m0.171s -user 0m0.229s -sys 0m0.125s +real 0m0.030s +user 0m0.029s +sys 0m0.022s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +beer_song.go:51:10: should omit type string from declaration; it will be inferred from the right-hand side (ST1023) +beer_song.go:52:10: should omit type string from declaration; it will be inferred from the right-hand side (ST1023) +beer_song.go:53:16: should omit type string from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.160s +user 0m0.216s +sys 0m0.126s + + + ============================================================================== + +Exit code: -1 + +real 0m0.202s +user 0m0.255s +sys 0m0.156s + +real 0m0.204s +user 0m0.255s +sys 0m0.157s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== -real 0m0.851s -user 0m1.878s -sys 0m0.381s +Running: go clean ./... + + +real 0m0.022s +user 0m0.024s +sys 0m0.020s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.799s +user 0m1.917s +sys 0m0.275s + + + ============================================================================== + +Exit code: 0 + +real 0m0.831s +user 0m1.945s +sys 0m0.305s + +real 0m0.832s +user 0m1.945s +sys 0m0.307s =============================================================================== -go vet ./... +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + -real 0m0.088s -user 0m0.134s -sys 0m0.109s + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.023s +sys 0m0.016s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.083s +user 0m0.136s +sys 0m0.094s + + + ============================================================================== + +Exit code: 0 + +real 0m0.124s +user 0m0.167s +sys 0m0.130s + +real 0m0.126s +user 0m0.168s +sys 0m0.131s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 -real 0m0.037s -user 0m0.034s -sys 0m0.039s + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.027s +sys 0m0.036s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.025s +user 0m0.019s +sys 0m0.025s + + + ============================================================================== + +Exit code: 0 + +real 0m0.069s +user 0m0.051s +sys 0m0.073s + +real 0m0.071s +user 0m0.053s +sys 0m0.074s =============================================================================== -errcheck ./... +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.022s +sys 0m0.027s + + + ============================================================================== + +Running: errcheck ./... + beer_song_test.go:119:10: Verses(tt.upperBound, tt.lowerBound) -real 0m0.532s -user 0m1.318s -sys 0m0.395s +real 0m0.444s +user 0m1.309s +sys 0m0.303s + + + ============================================================================== + +Exit code: -1 + +real 0m0.482s +user 0m1.336s +sys 0m0.341s + +real 0m0.484s +user 0m1.337s +sys 0m0.342s =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.045s +sys 0m0.022s + + + ============================================================================== + +Running: gocyclo . + 8 beer Verse beer_song.go:50:1 6 beer TestSeveralVerses beer_song_test.go:87:1 6 beer TestBottlesVerse beer_song_test.go:49:1 @@ -216,26 +514,86 @@ gocyclo . 1 beer ExampleVerses beer_song_examples_test.go:27:1 1 beer ExampleVerse beer_song_examples_test.go:7:1 -real 0m0.002s -user 0m0.000s +real 0m0.003s +user 0m0.001s sys 0m0.002s + + ============================================================================== + +Exit code: 0 + +real 0m0.042s +user 0m0.053s +sys 0m0.031s + +real 0m0.044s +user 0m0.054s +sys 0m0.032s + =============================================================================== -misspell . +Running: ../../.github/citools/go/go-lint-misspell -real 0m0.025s -user 0m0.027s -sys 0m0.007s +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.028s +user 0m0.037s +sys 0m0.012s + + + ============================================================================== + +Exit code: 0 + +real 0m0.042s +user 0m0.042s +sys 0m0.026s + +real 0m0.045s +user 0m0.044s +sys 0m0.028s =============================================================================== -gosec ./... -[gosec] 2023/08/02 13:11:21 Including rules: default -[gosec] 2023/08/02 13:11:21 Excluding rules: default -[gosec] 2023/08/02 13:11:21 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/beer-song -[gosec] 2023/08/02 13:11:21 Checking package: beer -[gosec] 2023/08/02 13:11:21 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/beer-song/beer_song.go +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.036s +sys 0m0.031s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:20:48 Including rules: default +[gosec] 2023/09/07 00:20:48 Excluding rules: default +[gosec] 2023/09/07 00:20:48 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/beer-song +[gosec] 2023/09/07 00:20:48 Checking package: beer +[gosec] 2023/09/07 00:20:48 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/beer-song/beer_song.go Results: @@ -247,54 +605,96 @@ Results: Issues : 0 -real 0m0.138s -user 0m0.155s -sys 0m0.126s +real 0m0.118s +user 0m0.125s +sys 0m0.088s + + + ============================================================================== + +Exit code: 0 + +real 0m0.164s +user 0m0.168s +sys 0m0.133s + +real 0m0.165s +user 0m0.170s +sys 0m0.133s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.041s +user 0m0.044s +sys 0m0.041s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestBottlesVerse --- PASS: TestBottlesVerse (0.00s) === RUN TestSeveralVerses --- PASS: TestSeveralVerses (0.00s) === RUN TestEntireSong ---- PASS: TestEntireSong (0.01s) +--- PASS: TestEntireSong (0.00s) === RUN ExampleVerse --- PASS: ExampleVerse (0.00s) === RUN ExampleVerses --- PASS: ExampleVerses (0.00s) PASS - beer coverage: 97.6% of statements -ok beer 0.016s coverage: 97.6% of statements +coverage: 97.6% of statements +ok beer 0.003s coverage: 97.6% of statements -real 0m0.267s -user 0m0.282s -sys 0m0.179s +real 0m0.179s +user 0m0.242s +sys 0m0.152s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + beer/beer_song.go:10: Song 75.0% beer/beer_song.go:21: Verses 100.0% beer/beer_song.go:50: Verse 100.0% total: (statements) 97.6% -real 0m0.056s -user 0m0.059s -sys 0m0.064s +real 0m0.055s +user 0m0.080s +sys 0m0.088s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html -real 0m0.061s + +real 0m0.063s user 0m0.065s -sys 0m0.073s +sys 0m0.059s -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt 10 func Song() string { 11 lyrics, e := Verses(99, 0) @@ -307,30 +707,49 @@ gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annota 18 } -real 0m0.244s -user 0m0.109s -sys 0m0.179s +real 0m0.019s +user 0m0.019s +sys 0m0.025s + +real 0m0.020s +user 0m0.019s +sys 0m0.025s + -=============================================================================== + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestBottlesVerse --- PASS: TestBottlesVerse (0.00s) === RUN TestSeveralVerses --- PASS: TestSeveralVerses (0.00s) === RUN TestEntireSong ---- PASS: TestEntireSong (0.01s) +--- PASS: TestEntireSong (0.00s) === RUN ExampleVerse --- PASS: ExampleVerse (0.00s) === RUN ExampleVerses --- PASS: ExampleVerses (0.00s) PASS - beer coverage: 97.6% of statements -ok beer 0.044s coverage: 97.6% of statements +coverage: 97.6% of statements +ok beer 1.022s coverage: 97.6% of statements + +real 0m1.236s +user 0m0.280s +sys 0m0.141s -real 0m0.429s -user 0m0.432s -sys 0m0.278s + + ============================================================================== + +Exit code: 0 + +real 0m1.612s +user 0m0.739s +sys 0m0.524s + +real 0m1.614s +user 0m0.740s +sys 0m0.525s =============================================================================== @@ -343,15 +762,15 @@ goarch: amd64 pkg: beer cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkSeveralVerses -BenchmarkSeveralVerses-8 3228 323315 ns/op 1312432 B/op 1037 allocs/op +BenchmarkSeveralVerses-8 3944 285156 ns/op 1312498 B/op 1038 allocs/op BenchmarkEntireSong -BenchmarkEntireSong-8 5156 195579 ns/op 665279 B/op 880 allocs/op +BenchmarkEntireSong-8 6330 192521 ns/op 665309 B/op 880 allocs/op PASS -ok beer 2.125s +ok beer 3.079s -real 0m2.294s -user 0m2.448s -sys 0m0.602s +real 0m3.228s +user 0m3.625s +sys 0m0.762s =============================================================================== @@ -369,51 +788,57 @@ gotest -v -tags bonus PASS ok beer 0.004s -real 0m0.161s -user 0m0.215s -sys 0m0.141s +real 0m0.158s +user 0m0.194s +sys 0m0.196s =============================================================================== benchstat benchstat-old.txt benchstat-new.txt +benchstat-old.txt:5: missing iteration count +benchstat-old.txt:7: missing iteration count benchstat-new.txt:5: missing iteration count benchstat-new.txt:7: missing iteration count goos: linux goarch: amd64 pkg: beer cpu: 12th Gen Intel(R) Core(TM) i5-1240P - │ benchstat-new.txt │ - │ sec/op │ -SeveralVerses-8 323.3µ ± ∞ ¹ -EntireSong-8 195.6µ ± ∞ ¹ -geomean 251.5µ + │ benchstat-old.txt │ benchstat-new.txt │ + │ sec/op │ sec/op vs base │ +SeveralVerses-8 323.3µ ± ∞ ¹ 285.2µ ± ∞ ¹ ~ (p=1.000 n=1) ² +EntireSong-8 195.6µ ± ∞ ¹ 192.5µ ± ∞ ¹ ~ (p=1.000 n=1) ² +geomean 251.5µ 234.3µ -6.82% ¹ need >= 6 samples for confidence interval at level 0.95 +² need >= 4 samples to detect a difference at alpha level 0.05 - │ benchstat-new.txt │ - │ B/op │ -SeveralVerses-8 1.252Mi ± ∞ ¹ -EntireSong-8 649.7Ki ± ∞ ¹ -geomean 912.5Ki + │ benchstat-old.txt │ benchstat-new.txt │ + │ B/op │ B/op vs base │ +SeveralVerses-8 1.252Mi ± ∞ ¹ 1.252Mi ± ∞ ¹ ~ (p=1.000 n=1) ² +EntireSong-8 649.7Ki ± ∞ ¹ 649.7Ki ± ∞ ¹ ~ (p=1.000 n=1) ² +geomean 912.5Ki 912.6Ki +0.00% ¹ need >= 6 samples for confidence interval at level 0.95 +² need >= 4 samples to detect a difference at alpha level 0.05 - │ benchstat-new.txt │ - │ allocs/op │ -SeveralVerses-8 1.037k ± ∞ ¹ -EntireSong-8 880.0 ± ∞ ¹ -geomean 955.3 + │ benchstat-old.txt │ benchstat-new.txt │ + │ allocs/op │ allocs/op vs base │ +SeveralVerses-8 1.037k ± ∞ ¹ 1.038k ± ∞ ¹ ~ (p=1.000 n=1) ² +EntireSong-8 880.0 ± ∞ ¹ 880.0 ± ∞ ¹ ~ (p=1.000 n=1) ³ +geomean 955.3 955.7 +0.05% ¹ need >= 6 samples for confidence interval at level 0.95 +² need >= 4 samples to detect a difference at alpha level 0.05 +³ all samples are equal -real 0m0.005s -user 0m0.000s -sys 0m0.004s +real 0m0.002s +user 0m0.002s +sys 0m0.001s =============================================================================== gomarkdoc --output beer-doc.md -real 0m0.013s -user 0m0.003s -sys 0m0.010s +real 0m0.009s +user 0m0.004s +sys 0m0.005s =============================================================================== @@ -434,9 +859,9 @@ func Verses(start, stop int) (string, error) Verses returns select verselyricss 99 Bottles of Beer on the Wall song. -real 0m0.041s -user 0m0.030s -sys 0m0.039s +real 0m0.036s +user 0m0.020s +sys 0m0.041s =============================================================================== diff --git a/go/bird-watcher/benchstat-new.txt b/go/bird-watcher/benchstat-new.txt new file mode 100644 index 00000000..a1879f4a --- /dev/null +++ b/go/bird-watcher/benchstat-new.txt @@ -0,0 +1,2 @@ +PASS +ok birdwatcher 0.003s diff --git a/go/bird-watcher/birdwatcher-doc.md b/go/bird-watcher/birdwatcher-doc.md index 4974a33a..31c6ad5f 100755 --- a/go/bird-watcher/birdwatcher-doc.md +++ b/go/bird-watcher/birdwatcher-doc.md @@ -19,7 +19,7 @@ import "birdwatcher" func BirdsInWeek(birdsPerDay []int, week int) int ``` -BirdsInWeek returns the total bird count by summing only the items belonging to the given week\. +BirdsInWeek returns the total bird count by summing only the items belonging to the given week.

Example

@@ -47,7 +47,7 @@ BirdsInWeek returns the total bird count by summing only the items belonging to func FixBirdCountLog(birdsPerDay []int) []int ``` -FixBirdCountLog returns the bird counts after correcting the bird counts for alternate days\. +FixBirdCountLog returns the bird counts after correcting the bird counts for alternate days.

Example

@@ -75,7 +75,7 @@ FixBirdCountLog returns the bird counts after correcting the bird counts for alt func TotalBirdCount(birdsPerDay []int) int ``` -TotalBirdCount return the total bird count by summing the individual day's counts\. +TotalBirdCount return the total bird count by summing the individual day's counts.

Example

diff --git a/go/bird-watcher/coverage-annotations.txt b/go/bird-watcher/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/bird-watcher/coverage.html b/go/bird-watcher/coverage.html new file mode 100644 index 00000000..6a7558c8 --- /dev/null +++ b/go/bird-watcher/coverage.html @@ -0,0 +1,152 @@ + + + + + + birdwatcher: Go Coverage Report + + + +

+ +
+ not tracked + + no coverage + low coverage + * + * + * + * + * + * + * + * + high coverage + +
+
+
+ + + +
+ + + diff --git a/go/bird-watcher/coverage.out b/go/bird-watcher/coverage.out index 4330bd67..34816e47 100644 --- a/go/bird-watcher/coverage.out +++ b/go/bird-watcher/coverage.out @@ -1,9 +1,9 @@ mode: count birdwatcher/bird_watcher.go:4.30,7.33 2 8 -birdwatcher/bird_watcher.go:11.2,11.14 1 8 birdwatcher/bird_watcher.go:7.33,9.3 1 70 +birdwatcher/bird_watcher.go:11.2,11.14 1 8 birdwatcher/bird_watcher.go:16.44,18.2 1 4 birdwatcher/bird_watcher.go:22.51,30.2 5 4 birdwatcher/bird_watcher.go:34.47,35.43 1 5 -birdwatcher/bird_watcher.go:39.2,39.20 1 5 birdwatcher/bird_watcher.go:35.43,37.3 1 26 +birdwatcher/bird_watcher.go:39.2,39.20 1 5 diff --git a/go/bird-watcher/run-tests-go.txt b/go/bird-watcher/run-tests-go.txt index 6afd2123..c690ecaa 100644 --- a/go/bird-watcher/run-tests-go.txt +++ b/go/bird-watcher/run-tests-go.txt @@ -5,15 +5,597 @@ Go packages: birdwatcher =============================================================================== -golint birdwatcher +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.016s +user 0m0.008s +sys 0m0.011s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +bird_watcher_test.go:108: File is not `gofumpt`-ed (gofumpt) + +bird_watcher.go:23:17: var-declaration: should omit type int from declaration of var daysInWeek; it will be inferred from the right-hand side (revive) + var daysInWeek int = 7 + ^ +bird_watcher_test.go:32:29: Using the variable on range scope `tt` in function literal (scopelint) + if got := TotalBirdCount(tt.birdCounts); got != tt.want { + ^ +bird_watcher_test.go:33:50: Using the variable on range scope `tt` in function literal (scopelint) + t.Errorf("TotalBirdCount(%v) = %v; want %v", tt.birdCounts, got, tt.want) + ^ +bird_watcher_test.go:67:26: Using the variable on range scope `tt` in function literal (scopelint) + if got := BirdsInWeek(tt.birdCounts, tt.week); got != tt.want { + ^ +bird_watcher.go:24:2: declarations should never be cuddled (wsl) + var offsetStart, offsetEnd int + ^ +bird_watcher_test.go:109:1: block should not end with a whitespace (or comment) (wsl) +} +^ +bird_watcher_test.go:114:2: only one cuddle assignment allowed before if statement (wsl) + if reflect.ValueOf(got).Pointer() != reflect.ValueOf(counts).Pointer() { + ^ +bird_watcher_test.go:8:1: Function TestTotalBirdCount missing the call to method parallel (paralleltest) +func TestTotalBirdCount(t *testing.T) { +^ +bird_watcher_test.go:30:2: Range statement for test TestTotalBirdCount missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +bird_watcher_test.go:39:1: Function TestBirdsInWeek missing the call to method parallel (paralleltest) +func TestBirdsInWeek(t *testing.T) { +^ +bird_watcher_test.go:65:2: Range statement for test TestBirdsInWeek missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +bird_watcher_test.go:74:1: Function TestFixBirdCount missing the call to method parallel (paralleltest) +func TestFixBirdCount(t *testing.T) { +^ +bird_watcher_test.go:98:2: Range statement for test TestFixBirdCount missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +bird_watcher_test.go:111:1: Function TestFixBirdCountDoesNotCreateNewSlice missing the call to method parallel (paralleltest) +func TestFixBirdCountDoesNotCreateNewSlice(t *testing.T) { +^ +bird_watcher_examples_test.go:1:9: package should be `birdwatcher_test` instead of `birdwatcher` (testpackage) +package birdwatcher + ^ +bird_watcher_test.go:1:9: package should be `birdwatcher_test` instead of `birdwatcher` (testpackage) +package birdwatcher + ^ + +real 0m0.500s +user 0m0.722s +sys 0m0.469s + + + ============================================================================== + +Exit code: -1 + +real 0m0.530s +user 0m0.736s +sys 0m0.493s + +real 0m0.532s +user 0m0.737s +sys 0m0.495s -real 0m0.188s -user 0m0.121s -sys 0m0.111s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.009s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +bird_watcher.go + (23, 17) https://revive.run/r#var-declaration should omit type int from declaration of var daysInWeek; it will be inferred from the right-hand side + (1, 1) https://revive.run/r#package-comments should have a package comment + + + ✖ 2 problems (0 errors) (2 warnings) + +real 0m0.039s +user 0m0.025s +sys 0m0.023s + + + ============================================================================== + +Exit code: 0 + +real 0m0.062s +user 0m0.036s +sys 0m0.042s + +real 0m0.064s +user 0m0.038s +sys 0m0.043s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.012s +sys 0m0.013s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "birdwatcher [birdwatcher.test]" + +real 0m0.085s +user 0m0.128s +sys 0m0.108s + + + ============================================================================== + +Exit code: -1 + +real 0m0.118s +user 0m0.149s +sys 0m0.130s + +real 0m0.120s +user 0m0.149s +sys 0m0.132s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.007s +sys 0m0.010s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +bird_watcher.go:1:1: at least one file in a package should have a package comment (ST1000) +bird_watcher.go:23:17: should omit type int from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.189s +user 0m0.223s +sys 0m0.123s + + + ============================================================================== + +Exit code: -1 + +real 0m0.213s +user 0m0.234s +sys 0m0.145s + +real 0m0.215s +user 0m0.234s +sys 0m0.146s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.005s +sys 0m0.010s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.837s +user 0m2.021s +sys 0m0.296s + + + ============================================================================== + +Exit code: 0 + +real 0m0.870s +user 0m2.033s +sys 0m0.325s + +real 0m0.872s +user 0m2.033s +sys 0m0.327s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out birdwatcher +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.006s +sys 0m0.013s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.087s +user 0m0.143s +sys 0m0.120s + + + ============================================================================== + +Exit code: 0 + +real 0m0.113s +user 0m0.157s +sys 0m0.141s + +real 0m0.115s +user 0m0.158s +sys 0m0.142s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.009s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.017s +user 0m0.007s +sys 0m0.014s + + + ============================================================================== + +Exit code: 0 + +real 0m0.044s +user 0m0.020s +sys 0m0.035s + +real 0m0.046s +user 0m0.022s +sys 0m0.035s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.007s +sys 0m0.016s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.528s +user 0m1.567s +sys 0m0.316s + + + ============================================================================== + +Exit code: 0 + +real 0m0.559s +user 0m1.581s +sys 0m0.345s + +real 0m0.562s +user 0m1.582s +sys 0m0.346s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.010s + + + ============================================================================== + +Running: gocyclo . + +3 birdwatcher TestFixBirdCount bird_watcher_test.go:74:1 +3 birdwatcher TestBirdsInWeek bird_watcher_test.go:39:1 +3 birdwatcher TestTotalBirdCount bird_watcher_test.go:8:1 +2 birdwatcher TestFixBirdCountDoesNotCreateNewSlice bird_watcher_test.go:111:1 +2 birdwatcher FixBirdCountLog bird_watcher.go:34:1 +2 birdwatcher sum bird_watcher.go:4:1 +1 birdwatcher ExampleFixBirdCountLog bird_watcher_examples_test.go:21:1 +1 birdwatcher ExampleBirdsInWeek bird_watcher_examples_test.go:14:1 +1 birdwatcher ExampleTotalBirdCount bird_watcher_examples_test.go:7:1 +1 birdwatcher BirdsInWeek bird_watcher.go:22:1 +1 birdwatcher TotalBirdCount bird_watcher.go:16:1 + +real 0m0.003s +user 0m0.000s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.025s +user 0m0.012s +sys 0m0.020s + +real 0m0.027s +user 0m0.012s +sys 0m0.022s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.031s +user 0m0.031s +sys 0m0.013s + + + ============================================================================== + +Exit code: 0 + +real 0m0.046s +user 0m0.039s +sys 0m0.025s + +real 0m0.048s +user 0m0.039s +sys 0m0.027s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.007s +sys 0m0.013s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:20:56 Including rules: default +[gosec] 2023/09/07 00:20:56 Excluding rules: default +[gosec] 2023/09/07 00:20:56 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/bird-watcher +[gosec] 2023/09/07 00:20:56 Checking package: birdwatcher +[gosec] 2023/09/07 00:20:56 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/bird-watcher/bird_watcher.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 40 + Nosec : 0 + Issues : 0 + + +real 0m0.071s +user 0m0.062s +sys 0m0.040s + + + ============================================================================== + +Exit code: 0 + +real 0m0.104s +user 0m0.078s +sys 0m0.068s + +real 0m0.107s +user 0m0.079s +sys 0m0.070s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.006s +sys 0m0.008s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestTotalBirdCount === RUN TestTotalBirdCount/calculates_the_correct_total_number_of_birds === RUN TestTotalBirdCount/works_for_a_short_bird_count_list @@ -48,28 +630,57 @@ go test -v -covermode=count -coverprofile coverage.out birdwatcher --- PASS: ExampleFixBirdCountLog (0.00s) PASS coverage: 100.0% of statements -ok birdwatcher 0.017s coverage: 100.0% of statements +ok birdwatcher 0.003s coverage: 100.0% of statements -real 0m0.688s -user 0m0.792s -sys 0m0.537s +real 0m0.172s +user 0m0.201s +sys 0m0.167s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + birdwatcher/bird_watcher.go:4: sum 100.0% birdwatcher/bird_watcher.go:16: TotalBirdCount 100.0% birdwatcher/bird_watcher.go:22: BirdsInWeek 100.0% birdwatcher/bird_watcher.go:34: FixBirdCountLog 100.0% total: (statements) 100.0% -real 0m0.123s -user 0m0.028s -sys 0m0.146s +real 0m0.027s +user 0m0.013s +sys 0m0.021s + + + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.029s +user 0m0.013s +sys 0m0.023s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.011s +user 0m0.004s +sys 0m0.011s + +real 0m0.012s +user 0m0.004s +sys 0m0.011s -=============================================================================== -go test -v -race -covermode=atomic birdwatcher + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestTotalBirdCount === RUN TestTotalBirdCount/calculates_the_correct_total_number_of_birds === RUN TestTotalBirdCount/works_for_a_short_bird_count_list @@ -104,78 +715,88 @@ go test -v -race -covermode=atomic birdwatcher --- PASS: ExampleFixBirdCountLog (0.00s) PASS coverage: 100.0% of statements -ok birdwatcher 0.045s coverage: 100.0% of statements +ok birdwatcher 1.023s coverage: 100.0% of statements -real 0m0.706s -user 0m0.744s -sys 0m0.483s +real 0m1.267s +user 0m0.307s +sys 0m0.179s -=============================================================================== - -go test --bench . --benchmem -PASS -ok birdwatcher 0.015s -real 0m0.715s -user 0m0.842s -sys 0m0.519s + ============================================================================== -=============================================================================== +Exit code: 0 -go test -tags bonus -PASS -ok birdwatcher 0.008s +real 0m1.530s +user 0m0.549s +sys 0m0.420s -real 0m0.465s -user 0m0.588s -sys 0m0.347s +real 0m1.532s +user 0m0.550s +sys 0m0.420s =============================================================================== -go vet birdwatcher +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok birdwatcher 0.003s -real 0m0.346s -user 0m0.409s -sys 0m0.358s +real 0m0.164s +user 0m0.182s +sys 0m0.164s =============================================================================== -go fix birdwatcher +gotest -v -tags bonus +=== RUN TestTotalBirdCount +=== RUN TestTotalBirdCount/calculates_the_correct_total_number_of_birds +=== RUN TestTotalBirdCount/works_for_a_short_bird_count_list +=== RUN TestTotalBirdCount/works_for_a_long_bird_count_list +--- PASS: TestTotalBirdCount (0.00s) + --- PASS: TestTotalBirdCount/calculates_the_correct_total_number_of_birds (0.00s) + --- PASS: TestTotalBirdCount/works_for_a_short_bird_count_list (0.00s) + --- PASS: TestTotalBirdCount/works_for_a_long_bird_count_list (0.00s) +=== RUN TestBirdsInWeek +=== RUN TestBirdsInWeek/calculates_the_number_of_birds_in_the_first_week +=== RUN TestBirdsInWeek/calculates_the_number_of_birds_for_a_week_in_the_middle_of_the_log +=== RUN TestBirdsInWeek/works_when_there_is_only_one_week +--- PASS: TestBirdsInWeek (0.00s) + --- PASS: TestBirdsInWeek/calculates_the_number_of_birds_in_the_first_week (0.00s) + --- PASS: TestBirdsInWeek/calculates_the_number_of_birds_for_a_week_in_the_middle_of_the_log (0.00s) + --- PASS: TestBirdsInWeek/works_when_there_is_only_one_week (0.00s) +=== RUN TestFixBirdCount +=== RUN TestFixBirdCount/returns_a_bird_count_list_with_the_corrected_values +=== RUN TestFixBirdCount/works_for_a_short_bird_count_list +=== RUN TestFixBirdCount/works_for_a_long_bird_count_list +--- PASS: TestFixBirdCount (0.00s) + --- PASS: TestFixBirdCount/returns_a_bird_count_list_with_the_corrected_values (0.00s) + --- PASS: TestFixBirdCount/works_for_a_short_bird_count_list (0.00s) + --- PASS: TestFixBirdCount/works_for_a_long_bird_count_list (0.00s) +=== RUN TestFixBirdCountDoesNotCreateNewSlice +--- PASS: TestFixBirdCountDoesNotCreateNewSlice (0.00s) +=== RUN ExampleTotalBirdCount +--- PASS: ExampleTotalBirdCount (0.00s) +=== RUN ExampleBirdsInWeek +--- PASS: ExampleBirdsInWeek (0.00s) +=== RUN ExampleFixBirdCountLog +--- PASS: ExampleFixBirdCountLog (0.00s) +PASS +ok birdwatcher 0.002s -real 0m0.049s -user 0m0.029s -sys 0m0.049s +real 0m0.139s +user 0m0.192s +sys 0m0.148s =============================================================================== -gosec ./bird-watcher -[gosec] 2022/06/20 23:42:20 Including rules: default -[gosec] 2022/06/20 23:42:20 Excluding rules: default -[gosec] 2022/06/20 23:42:20 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/bird-watcher -[gosec] 2022/06/20 23:42:20 Checking package: birdwatcher -[gosec] 2022/06/20 23:42:20 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/bird-watcher/bird_watcher.go -Results: - - -Summary: - Gosec : dev - Files : 1 - Lines : 40 - Nosec : 0 - Issues : 0 - - -real 0m0.293s -user 0m0.293s -sys 0m0.250s +No old benchmarks to run benchstat against. =============================================================================== gomarkdoc --output birdwatcher-doc.md -real 0m0.029s -user 0m0.018s -sys 0m0.019s +real 0m0.012s +user 0m0.007s +sys 0m0.005s =============================================================================== @@ -198,9 +819,9 @@ func TotalBirdCount(birdsPerDay []int) int counts. -real 0m0.141s -user 0m0.055s -sys 0m0.148s +real 0m0.026s +user 0m0.014s +sys 0m0.019s =============================================================================== diff --git a/go/blackjack/benchstat-new.txt b/go/blackjack/benchstat-new.txt new file mode 100644 index 00000000..9cffdb35 --- /dev/null +++ b/go/blackjack/benchstat-new.txt @@ -0,0 +1,2 @@ +PASS +ok blackjack 0.002s diff --git a/go/blackjack/blackjack-doc.md b/go/blackjack/blackjack-doc.md index 9e3b58ec..a6f1aef2 100755 --- a/go/blackjack/blackjack-doc.md +++ b/go/blackjack/blackjack-doc.md @@ -18,7 +18,7 @@ import "blackjack" func FirstTurn(card1, card2, dealerCard string) string ``` -FirstTurn returns the decision for the first turn\, given two cards of the player and one card of the dealer\. +FirstTurn returns the decision for the first turn, given two cards of the player and one card of the dealer.
Example

@@ -49,7 +49,7 @@ H func ParseCard(card string) int ``` -ParseCard returns the integer value of a card following blackjack ruleset\. +ParseCard returns the integer value of a card following blackjack ruleset.

Example

diff --git a/go/blackjack/coverage-annotations.txt b/go/blackjack/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/blackjack/coverage.html b/go/blackjack/coverage.html new file mode 100644 index 00000000..6849f409 --- /dev/null +++ b/go/blackjack/coverage.html @@ -0,0 +1,179 @@ + + + + + + blackjack: Go Coverage Report + + + +

+ +
+ not tracked + + no coverage + low coverage + * + * + * + * + * + * + * + * + high coverage + +
+
+
+ + + +
+ + + diff --git a/go/blackjack/coverage.out b/go/blackjack/coverage.out index ff02347d..57e73b31 100644 --- a/go/blackjack/coverage.out +++ b/go/blackjack/coverage.out @@ -12,15 +12,15 @@ blackjack/blackjack.go:22.14,23.11 1 4 blackjack/blackjack.go:24.38,25.12 1 39 blackjack/blackjack.go:26.10,27.11 1 1 blackjack/blackjack.go:33.56,41.38 2 35 -blackjack/blackjack.go:45.2,45.19 1 33 -blackjack/blackjack.go:53.2,53.36 1 28 -blackjack/blackjack.go:57.2,57.36 1 22 -blackjack/blackjack.go:66.2,66.12 1 6 blackjack/blackjack.go:41.38,43.3 1 2 +blackjack/blackjack.go:45.2,45.19 1 33 blackjack/blackjack.go:45.19,46.33 1 5 -blackjack/blackjack.go:50.3,50.13 1 3 blackjack/blackjack.go:46.33,48.4 1 2 +blackjack/blackjack.go:50.3,50.13 1 3 +blackjack/blackjack.go:53.2,53.36 1 28 blackjack/blackjack.go:53.36,55.3 1 6 +blackjack/blackjack.go:57.2,57.36 1 22 blackjack/blackjack.go:57.36,58.33 1 16 -blackjack/blackjack.go:62.3,62.13 1 5 blackjack/blackjack.go:58.33,60.4 1 11 +blackjack/blackjack.go:62.3,62.13 1 5 +blackjack/blackjack.go:66.2,66.12 1 6 diff --git a/go/blackjack/run-tests-go.txt b/go/blackjack/run-tests-go.txt index c7466d66..98056b25 100644 --- a/go/blackjack/run-tests-go.txt +++ b/go/blackjack/run-tests-go.txt @@ -5,15 +5,621 @@ Go packages: blackjack =============================================================================== -golint blackjack +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.104s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.004s +sys 0m0.014s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +blackjack_test.go:5: Function 'TestParseCard' is too long (83 > 60) (funlen) +func TestParseCard(t *testing.T) { +blackjack_test.go:91: Function 'TestFirstTurn' is too long (209 > 60) (funlen) +func TestFirstTurn(t *testing.T) { +blackjack.go:6:7: string `ace` has 3 occurrences, make it a constant (goconst) + case "ace": + ^ +blackjack.go:39:14: var-declaration: should omit type int from declaration of var cardSum; it will be inferred from the right-hand side (revive) + var cardSum int = ParseCard(card1) + ParseCard(card2) + ^ +blackjack_test.go:84:24: Using the variable on range scope `tt` in function literal (scopelint) + if got := ParseCard(tt.card); got != tt.want { + ^ +blackjack_test.go:85:45: Using the variable on range scope `tt` in function literal (scopelint) + t.Errorf("ParseCard(%s) = %d, want %d", tt.card, got, tt.want) + ^ +blackjack_test.go:296:24: Using the variable on range scope `tt` in function literal (scopelint) + if got := FirstTurn(tt.hand.card1, tt.hand.card2, tt.dealer); got != tt.want { + ^ +blackjack.go:33:56: block should not start with a whitespace (wsl) +func FirstTurn(card1, card2, dealerCard string) string { + ^ +blackjack_test.go:95:2: assignments should only be cuddled with other assignments (wsl) + tests := []struct { + ^ +blackjack_test.go:294:2: only one cuddle assignment allowed before range statement (wsl) + for _, tt := range tests { + ^ +blackjack.go:4:1: calculated cyclomatic complexity for function ParseCard is 12, max is 10 (cyclop) +func ParseCard(card string) int { +^ +blackjack.go:45:16: mnd: Magic number: 21, in detected (gomnd) + if cardSum == 21 { + ^ +blackjack.go:46:30: mnd: Magic number: 10, in detected (gomnd) + if ParseCard(dealerCard) < 10 { + ^ +blackjack.go:58:31: mnd: Magic number: 7, in detected (gomnd) + if ParseCard(dealerCard) >= 7 { + ^ +blackjack.go:7:10: mnd: Magic number: 11, in detected (gomnd) + return 11 + ^ +blackjack.go:9:10: mnd: Magic number: 2, in detected (gomnd) + return 2 + ^ +blackjack.go:11:10: mnd: Magic number: 3, in detected (gomnd) + return 3 + ^ +blackjack.go:13:10: mnd: Magic number: 4, in detected (gomnd) + return 4 + ^ +blackjack.go:15:10: mnd: Magic number: 5, in detected (gomnd) + return 5 + ^ +blackjack.go:17:10: mnd: Magic number: 6, in detected (gomnd) + return 6 + ^ +blackjack.go:19:10: mnd: Magic number: 7, in detected (gomnd) + return 7 + ^ +blackjack.go:21:10: mnd: Magic number: 8, in detected (gomnd) + return 8 + ^ +blackjack.go:23:10: mnd: Magic number: 9, in detected (gomnd) + return 9 + ^ +blackjack.go:25:10: mnd: Magic number: 10, in detected (gomnd) + return 10 + ^ +blackjack_test.go:82:2: Range statement for test TestParseCard missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +blackjack_examples_test.go:1:9: package should be `blackjack_test` instead of `blackjack` (testpackage) +package blackjack + ^ +blackjack_test.go:1:9: package should be `blackjack_test` instead of `blackjack` (testpackage) +package blackjack + ^ + +real 0m0.455s +user 0m0.793s +sys 0m0.437s + + + ============================================================================== + +Exit code: -1 + +real 0m0.484s +user 0m0.801s +sys 0m0.463s + +real 0m0.485s +user 0m0.802s +sys 0m0.465s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.011s +sys 0m0.004s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +blackjack.go + (39, 14) https://revive.run/r#var-declaration should omit type int from declaration of var cardSum; it will be inferred from the right-hand side + (1, 1) https://revive.run/r#package-comments should have a package comment + + + ✖ 2 problems (0 errors) (2 warnings) + +real 0m0.033s +user 0m0.013s +sys 0m0.028s + + + ============================================================================== + +Exit code: 0 + +real 0m0.055s +user 0m0.034s +sys 0m0.036s + +real 0m0.057s +user 0m0.034s +sys 0m0.038s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.005s +sys 0m0.011s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "blackjack [blackjack.test]" + +real 0m0.092s +user 0m0.133s +sys 0m0.124s + + + ============================================================================== + +Exit code: -1 + +real 0m0.116s +user 0m0.142s +sys 0m0.149s + +real 0m0.118s +user 0m0.143s +sys 0m0.149s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.008s +sys 0m0.007s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +blackjack.go:1:1: at least one file in a package should have a package comment (ST1000) +blackjack.go:39:14: should omit type int from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.167s +user 0m0.202s +sys 0m0.111s + + + ============================================================================== + +Exit code: -1 + +real 0m0.191s +user 0m0.214s +sys 0m0.127s + +real 0m0.192s +user 0m0.216s +sys 0m0.127s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.002s +sys 0m0.014s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.826s +user 0m1.893s +sys 0m0.315s + + + ============================================================================== + +Exit code: 0 + +real 0m0.853s +user 0m1.901s +sys 0m0.343s + +real 0m0.855s +user 0m1.902s +sys 0m0.343s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.016s +user 0m0.009s +sys 0m0.012s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.092s +user 0m0.151s +sys 0m0.119s + + + ============================================================================== + +Exit code: 0 + +real 0m0.121s +user 0m0.165s +sys 0m0.143s + +real 0m0.124s +user 0m0.167s +sys 0m0.143s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.004s +sys 0m0.022s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.017s +user 0m0.010s +sys 0m0.013s + + + ============================================================================== + +Exit code: 0 + +real 0m0.052s +user 0m0.019s +sys 0m0.047s + +real 0m0.054s +user 0m0.022s +sys 0m0.048s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.007s +sys 0m0.013s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.458s +user 0m1.223s +sys 0m0.312s + + + ============================================================================== + +Exit code: 0 + +real 0m0.488s +user 0m1.235s +sys 0m0.340s + +real 0m0.490s +user 0m1.236s +sys 0m0.341s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.010s +user 0m0.004s +sys 0m0.008s + + + ============================================================================== + +Running: gocyclo . + +11 blackjack ParseCard blackjack.go:4:1 +10 blackjack FirstTurn blackjack.go:33:1 +3 blackjack TestFirstTurn blackjack_test.go:91:1 +3 blackjack TestParseCard blackjack_test.go:5:1 +1 blackjack ExampleFirstTurn blackjack_examples_test.go:12:1 +1 blackjack ExampleParseCard blackjack_examples_test.go:7:1 + +real 0m0.002s +user 0m0.000s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.022s +user 0m0.009s +sys 0m0.019s + +real 0m0.024s +user 0m0.009s +sys 0m0.021s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.028s +user 0m0.027s +sys 0m0.018s + + + ============================================================================== + +Exit code: 0 + +real 0m0.039s +user 0m0.031s +sys 0m0.028s + +real 0m0.041s +user 0m0.031s +sys 0m0.031s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.010s +user 0m0.005s +sys 0m0.007s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:21:00 Including rules: default +[gosec] 2023/09/07 00:21:00 Excluding rules: default +[gosec] 2023/09/07 00:21:00 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/blackjack +[gosec] 2023/09/07 00:21:00 Checking package: blackjack +[gosec] 2023/09/07 00:21:00 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/blackjack/blackjack.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 67 + Nosec : 0 + Issues : 0 + + +real 0m0.084s +user 0m0.074s +sys 0m0.043s + + + ============================================================================== + +Exit code: 0 + +real 0m0.103s user 0m0.084s -sys 0m0.096s +sys 0m0.058s + +real 0m0.105s +user 0m0.084s +sys 0m0.059s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out blackjack +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.016s +user 0m0.006s +sys 0m0.016s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestParseCard === RUN TestParseCard/parse_ace === RUN TestParseCard/parse_two @@ -116,26 +722,55 @@ go test -v -covermode=count -coverprofile coverage.out blackjack --- PASS: ExampleFirstTurn (0.00s) PASS coverage: 100.0% of statements -ok blackjack 0.004s coverage: 100.0% of statements +ok blackjack 0.003s coverage: 100.0% of statements -real 0m0.703s -user 0m0.775s -sys 0m0.620s +real 0m0.164s +user 0m0.191s +sys 0m0.150s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + blackjack/blackjack.go:4: ParseCard 100.0% blackjack/blackjack.go:33: FirstTurn 100.0% total: (statements) 100.0% -real 0m0.104s -user 0m0.041s -sys 0m0.120s +real 0m0.041s +user 0m0.013s +sys 0m0.036s -=============================================================================== -go test -v -race -covermode=atomic blackjack + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.030s +user 0m0.012s +sys 0m0.026s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.015s +user 0m0.006s +sys 0m0.013s + +real 0m0.015s +user 0m0.006s +sys 0m0.013s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestParseCard === RUN TestParseCard/parse_ace === RUN TestParseCard/parse_two @@ -151,7 +786,7 @@ go test -v -race -covermode=atomic blackjack === RUN TestParseCard/parse_queen === RUN TestParseCard/parse_king === RUN TestParseCard/parse_other ---- PASS: TestParseCard (0.01s) +--- PASS: TestParseCard (0.00s) --- PASS: TestParseCard/parse_ace (0.00s) --- PASS: TestParseCard/parse_two (0.00s) --- PASS: TestParseCard/parse_three (0.00s) @@ -238,78 +873,156 @@ go test -v -race -covermode=atomic blackjack --- PASS: ExampleFirstTurn (0.00s) PASS coverage: 100.0% of statements -ok blackjack 0.053s coverage: 100.0% of statements - -real 0m0.683s -user 0m0.774s -sys 0m0.430s +ok blackjack 1.035s coverage: 100.0% of statements -=============================================================================== +real 0m1.272s +user 0m0.292s +sys 0m0.193s -go test --bench . --benchmem -PASS -ok blackjack 0.032s -real 0m0.650s -user 0m0.764s -sys 0m0.413s + ============================================================================== -=============================================================================== +Exit code: 0 -go test -tags bonus -PASS -ok blackjack 0.005s +real 0m1.561s +user 0m0.533s +sys 0m0.452s -real 0m0.544s -user 0m0.659s -sys 0m0.461s +real 0m1.563s +user 0m0.535s +sys 0m0.452s =============================================================================== -go vet blackjack +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok blackjack 0.002s -real 0m0.350s -user 0m0.477s -sys 0m0.311s +real 0m0.158s +user 0m0.206s +sys 0m0.163s =============================================================================== -go fix blackjack +gotest -v -tags bonus +=== RUN TestParseCard +=== RUN TestParseCard/parse_ace +=== RUN TestParseCard/parse_two +=== RUN TestParseCard/parse_three +=== RUN TestParseCard/parse_four +=== RUN TestParseCard/parse_five +=== RUN TestParseCard/parse_six +=== RUN TestParseCard/parse_seven +=== RUN TestParseCard/parse_eight +=== RUN TestParseCard/parse_nine +=== RUN TestParseCard/parse_ten +=== RUN TestParseCard/parse_jack +=== RUN TestParseCard/parse_queen +=== RUN TestParseCard/parse_king +=== RUN TestParseCard/parse_other +--- PASS: TestParseCard (0.00s) + --- PASS: TestParseCard/parse_ace (0.00s) + --- PASS: TestParseCard/parse_two (0.00s) + --- PASS: TestParseCard/parse_three (0.00s) + --- PASS: TestParseCard/parse_four (0.00s) + --- PASS: TestParseCard/parse_five (0.00s) + --- PASS: TestParseCard/parse_six (0.00s) + --- PASS: TestParseCard/parse_seven (0.00s) + --- PASS: TestParseCard/parse_eight (0.00s) + --- PASS: TestParseCard/parse_nine (0.00s) + --- PASS: TestParseCard/parse_ten (0.00s) + --- PASS: TestParseCard/parse_jack (0.00s) + --- PASS: TestParseCard/parse_queen (0.00s) + --- PASS: TestParseCard/parse_king (0.00s) + --- PASS: TestParseCard/parse_other (0.00s) +=== RUN TestFirstTurn +=== RUN TestFirstTurn/pair_of_aces +=== RUN TestFirstTurn/pair_of_jacks +=== RUN TestFirstTurn/pair_of_kings +=== RUN TestFirstTurn/pair_of_twos +=== RUN TestFirstTurn/pair_of_fives +=== RUN TestFirstTurn/blackjack_with_ace_for_dealer +=== RUN TestFirstTurn/blackjack_with_queen_for_dealer +=== RUN TestFirstTurn/blackjack_with_five_for_dealer +=== RUN TestFirstTurn/blackjack_with_nine_for_dealer +=== RUN TestFirstTurn/score_of_20 +=== RUN TestFirstTurn/score_of_19 +=== RUN TestFirstTurn/score_of_18 +=== RUN TestFirstTurn/score_of_17 +=== RUN TestFirstTurn/score_of_16_with_six_for_dealer +=== RUN TestFirstTurn/score_of_16_with_seven_for_dealer +=== RUN TestFirstTurn/score_of_16_with_ace_for_dealer +=== RUN TestFirstTurn/score_of_15_with_six_for_dealer +=== RUN TestFirstTurn/score_of_15_with_seven_for_dealer +=== RUN TestFirstTurn/score_of_15_with_king_for_dealer +=== RUN TestFirstTurn/score_of_14_with_six_for_dealer +=== RUN TestFirstTurn/score_of_14_with_seven_for_dealer +=== RUN TestFirstTurn/score_of_14_with_queen_for_dealer +=== RUN TestFirstTurn/score_of_13_with_six_for_dealer +=== RUN TestFirstTurn/score_of_13_with_seven_for_dealer +=== RUN TestFirstTurn/score_of_13_with_queen_for_dealer +=== RUN TestFirstTurn/score_of_12_with_six_for_dealer +=== RUN TestFirstTurn/score_of_12_with_seven_for_dealer +=== RUN TestFirstTurn/score_of_12_with_queen_for_dealer +=== RUN TestFirstTurn/score_of_11_with_queen_for_dealer +=== RUN TestFirstTurn/score_of_10_with_two_for_dealer +=== RUN TestFirstTurn/score_of_5_with_queen_for_dealer +=== RUN TestFirstTurn/score_of_4_with_five_for_dealer +--- PASS: TestFirstTurn (0.00s) + --- PASS: TestFirstTurn/pair_of_aces (0.00s) + --- PASS: TestFirstTurn/pair_of_jacks (0.00s) + --- PASS: TestFirstTurn/pair_of_kings (0.00s) + --- PASS: TestFirstTurn/pair_of_twos (0.00s) + --- PASS: TestFirstTurn/pair_of_fives (0.00s) + --- PASS: TestFirstTurn/blackjack_with_ace_for_dealer (0.00s) + --- PASS: TestFirstTurn/blackjack_with_queen_for_dealer (0.00s) + --- PASS: TestFirstTurn/blackjack_with_five_for_dealer (0.00s) + --- PASS: TestFirstTurn/blackjack_with_nine_for_dealer (0.00s) + --- PASS: TestFirstTurn/score_of_20 (0.00s) + --- PASS: TestFirstTurn/score_of_19 (0.00s) + --- PASS: TestFirstTurn/score_of_18 (0.00s) + --- PASS: TestFirstTurn/score_of_17 (0.00s) + --- PASS: TestFirstTurn/score_of_16_with_six_for_dealer (0.00s) + --- PASS: TestFirstTurn/score_of_16_with_seven_for_dealer (0.00s) + --- PASS: TestFirstTurn/score_of_16_with_ace_for_dealer (0.00s) + --- PASS: TestFirstTurn/score_of_15_with_six_for_dealer (0.00s) + --- PASS: TestFirstTurn/score_of_15_with_seven_for_dealer (0.00s) + --- PASS: TestFirstTurn/score_of_15_with_king_for_dealer (0.00s) + --- PASS: TestFirstTurn/score_of_14_with_six_for_dealer (0.00s) + --- PASS: TestFirstTurn/score_of_14_with_seven_for_dealer (0.00s) + --- PASS: TestFirstTurn/score_of_14_with_queen_for_dealer (0.00s) + --- PASS: TestFirstTurn/score_of_13_with_six_for_dealer (0.00s) + --- PASS: TestFirstTurn/score_of_13_with_seven_for_dealer (0.00s) + --- PASS: TestFirstTurn/score_of_13_with_queen_for_dealer (0.00s) + --- PASS: TestFirstTurn/score_of_12_with_six_for_dealer (0.00s) + --- PASS: TestFirstTurn/score_of_12_with_seven_for_dealer (0.00s) + --- PASS: TestFirstTurn/score_of_12_with_queen_for_dealer (0.00s) + --- PASS: TestFirstTurn/score_of_11_with_queen_for_dealer (0.00s) + --- PASS: TestFirstTurn/score_of_10_with_two_for_dealer (0.00s) + --- PASS: TestFirstTurn/score_of_5_with_queen_for_dealer (0.00s) + --- PASS: TestFirstTurn/score_of_4_with_five_for_dealer (0.00s) +=== RUN ExampleParseCard +--- PASS: ExampleParseCard (0.00s) +=== RUN ExampleFirstTurn +--- PASS: ExampleFirstTurn (0.00s) +PASS +ok blackjack 0.006s -real 0m0.062s -user 0m0.031s -sys 0m0.053s +real 0m0.122s +user 0m0.160s +sys 0m0.115s =============================================================================== -gosec ./blackjack -[gosec] 2022/06/20 22:58:31 Including rules: default -[gosec] 2022/06/20 22:58:31 Excluding rules: default -[gosec] 2022/06/20 22:58:31 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/blackjack -[gosec] 2022/06/20 22:58:32 Checking package: blackjack -[gosec] 2022/06/20 22:58:32 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/blackjack/blackjack.go -Results: - - -Summary: - Gosec : dev - Files : 1 - Lines : 67 - Nosec : 0 - Issues : 0 - - -real 0m0.369s -user 0m0.391s -sys 0m0.259s +No old benchmarks to run benchstat against. =============================================================================== gomarkdoc --output blackjack-doc.md -real 0m0.063s -user 0m0.035s -sys 0m0.034s +real 0m0.014s +user 0m0.006s +sys 0m0.009s =============================================================================== @@ -327,9 +1040,9 @@ func ParseCard(card string) int ParseCard returns the integer value of a card following blackjack ruleset. -real 0m0.149s -user 0m0.043s -sys 0m0.150s +real 0m0.042s +user 0m0.018s +sys 0m0.035s =============================================================================== diff --git a/go/bob/benchstat-new.txt b/go/bob/benchstat-new.txt index 59adf64d..5cc22df6 100644 --- a/go/bob/benchstat-new.txt +++ b/go/bob/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: bob -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkHey-4 507 3073033 ns/op 451717 B/op 5947 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkHey +BenchmarkHey-8 2659 419768 ns/op 453253 B/op 5947 allocs/op PASS -ok bob 1.879s +ok bob 1.167s diff --git a/go/bob/benchstat-old.txt b/go/bob/benchstat-old.txt index 1327643c..59adf64d 100644 --- a/go/bob/benchstat-old.txt +++ b/go/bob/benchstat-old.txt @@ -2,6 +2,6 @@ goos: linux goarch: amd64 pkg: bob cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkHey-4 1046 1327137 ns/op 452361 B/op 5947 allocs/op +BenchmarkHey-4 507 3073033 ns/op 451717 B/op 5947 allocs/op PASS -ok bob 1.533s +ok bob 1.879s diff --git a/go/bob/bob-doc.md b/go/bob/bob-doc.md index 93c91e3f..531a91bf 100755 --- a/go/bob/bob-doc.md +++ b/go/bob/bob-doc.md @@ -6,7 +6,7 @@ import "bob" ``` -Package bob is a lackadaisical teenage AI\. +Package bob is a lackadaisical teenage AI. ## Index @@ -19,7 +19,7 @@ Package bob is a lackadaisical teenage AI\. func Hey(remark string) string ``` -Hey returns a response from the simulated teenager\. +Hey returns a response from the simulated teenager.
Example

diff --git a/go/bob/coverage-annotations.txt b/go/bob/coverage-annotations.txt new file mode 100644 index 00000000..b37ea03a --- /dev/null +++ b/go/bob/coverage-annotations.txt @@ -0,0 +1,65 @@ + +10 func Hey(remark string) string { +11 // The extra whitespace just gets in the way. +12 remark = strings.TrimSpace(remark) +13 +14 var reStr string +15 +16 // Question without letters. +17 reStr = `^([[:punct:]|[[:space:]])+[?]$` +18 if m, e := regexp.MatchString(reStr, remark); m { +19 if e != nil { +20 MISS panic(e) +21 } +22 return "Sure." +23 } +24 +25 // Yelling a question. +26 reStr = `^([[:upper:]]|[[:punct:]|[[:space:]])+[?]$` +27 if m, e := regexp.MatchString(reStr, remark); m { +28 if e != nil { +29 MISS panic(e) +30 } +31 return "Calm down, I know what I'm doing!" +32 } +33 +34 // Any normal question. +35 reStr = `^([[:alpha:]]|[[:digit:]]|[[:punct:]])([[:alpha:]]|[[:digit:]]|[[:punct:]]|[[:space:]])*[?]$` +36 if m, e := regexp.MatchString(reStr, remark); m { +37 if e != nil { +38 MISS panic(e) +39 } +40 return "Sure." +41 } +42 +43 // Letterless statement. +44 reStr = `^([[:digit:]]|[[:punct:]|[[:space:]])+$` +45 if m, e := regexp.MatchString(reStr, remark); m { +46 if e != nil { +47 MISS panic(e) +48 } +49 return "Whatever." +50 } +51 +52 // Yelling statement. +53 reStr = `^([[:upper:]]|[[:digit:]]|[[:punct:]|[[:space:]])+$` +54 if m, e := regexp.MatchString(reStr, remark); m { +55 if e != nil { +56 MISS panic(e) +57 } +58 return "Whoa, chill out!" +59 } +60 +61 // Silence +62 reStr = `^[[:space:]]*$` +63 if m, e := regexp.MatchString(reStr, remark); m { +64 if e != nil { +65 MISS panic(e) +66 } +67 return "Fine. Be that way!" +68 } +69 +70 // Default response. +71 return "Whatever." +72 } + diff --git a/go/bob/coverage.out b/go/bob/coverage.out index ccc58114..fc0eb4a6 100644 --- a/go/bob/coverage.out +++ b/go/bob/coverage.out @@ -1,26 +1,26 @@ mode: count bob/bob.go:10.32,18.50 4 30 -bob/bob.go:26.2,27.50 2 29 -bob/bob.go:35.2,36.50 2 27 -bob/bob.go:44.2,45.50 2 20 -bob/bob.go:53.2,54.50 2 19 -bob/bob.go:62.2,63.50 2 13 -bob/bob.go:71.2,71.20 1 8 bob/bob.go:18.50,19.15 1 1 -bob/bob.go:22.3,22.17 1 1 bob/bob.go:19.15,20.12 1 0 +bob/bob.go:22.3,22.17 1 1 +bob/bob.go:26.2,27.50 2 29 bob/bob.go:27.50,28.15 1 2 -bob/bob.go:31.3,31.45 1 2 bob/bob.go:28.15,29.12 1 0 +bob/bob.go:31.3,31.45 1 2 +bob/bob.go:35.2,36.50 2 27 bob/bob.go:36.50,37.15 1 7 -bob/bob.go:40.3,40.17 1 7 bob/bob.go:37.15,38.12 1 0 +bob/bob.go:40.3,40.17 1 7 +bob/bob.go:44.2,45.50 2 20 bob/bob.go:45.50,46.15 1 1 -bob/bob.go:49.3,49.21 1 1 bob/bob.go:46.15,47.12 1 0 +bob/bob.go:49.3,49.21 1 1 +bob/bob.go:53.2,54.50 2 19 bob/bob.go:54.50,55.15 1 6 -bob/bob.go:58.3,58.28 1 6 bob/bob.go:55.15,56.12 1 0 +bob/bob.go:58.3,58.28 1 6 +bob/bob.go:62.2,63.50 2 13 bob/bob.go:63.50,64.15 1 5 -bob/bob.go:67.3,67.30 1 5 bob/bob.go:64.15,65.12 1 0 +bob/bob.go:67.3,67.30 1 5 +bob/bob.go:71.2,71.20 1 8 diff --git a/go/bob/run-tests-go.txt b/go/bob/run-tests-go.txt index 60ddd3b0..a2f8bb05 100644 --- a/go/bob/run-tests-go.txt +++ b/go/bob/run-tests-go.txt @@ -5,15 +5,573 @@ Go packages: bob =============================================================================== -golint bob +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.018s +sys 0m0.028s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +bob.go:10: Function 'Hey' is too long (61 > 60) (funlen) +func Hey(remark string) string { +bob_test.go:8:18: Using the variable on range scope `tc` in function literal (scopelint) + actual := Hey(tc.input) + ^ +bob_test.go:9:17: Using the variable on range scope `tc` in function literal (scopelint) + if actual != tc.expected { + ^ +bob_test.go:10:40: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("Hey(%q) = %q, want: %q", tc.input, actual, tc.expected) + ^ +bob.go:22:3: return statements should not be cuddled if block has more than two lines (wsl) + return "Sure." + ^ +bob.go:31:3: return statements should not be cuddled if block has more than two lines (wsl) + return "Calm down, I know what I'm doing!" + ^ +bob.go:40:3: return statements should not be cuddled if block has more than two lines (wsl) + return "Sure." + ^ +bob_test.go:20:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +bob_test.go:5:1: Function TestHey missing the call to method parallel (paralleltest) +func TestHey(t *testing.T) { +^ +bob_test.go:6:2: Range statement for test TestHey missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +bob_examples_test.go:1:9: package should be `bob_test` instead of `bob` (testpackage) +package bob + ^ +bob_test.go:1:9: package should be `bob_test` instead of `bob` (testpackage) +package bob + ^ +cases_test.go:1:9: package should be `bob_test` instead of `bob` (testpackage) +package bob + ^ + +real 0m0.594s +user 0m0.817s +sys 0m0.563s + + + ============================================================================== + +Exit code: -1 + +real 0m0.635s +user 0m0.841s +sys 0m0.601s + +real 0m0.637s +user 0m0.842s +sys 0m0.603s -real 0m0.344s -user 0m0.258s -sys 0m0.285s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.038s +user 0m0.029s +sys 0m0.030s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.063s +user 0m0.033s +sys 0m0.045s + + + ============================================================================== + +Exit code: 0 + +real 0m0.115s +user 0m0.066s +sys 0m0.089s + +real 0m0.118s +user 0m0.068s +sys 0m0.091s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out bob +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.015s +sys 0m0.015s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "regexp" without types was imported from "bob" + +real 0m0.085s +user 0m0.095s +sys 0m0.105s + + + ============================================================================== + +Exit code: -1 + +real 0m0.116s +user 0m0.116s +sys 0m0.130s + +real 0m0.118s +user 0m0.116s +sys 0m0.132s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.014s +sys 0m0.023s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.191s +user 0m0.234s +sys 0m0.123s + + + ============================================================================== + +Exit code: 0 + +real 0m0.224s +user 0m0.253s +sys 0m0.157s + +real 0m0.226s +user 0m0.254s +sys 0m0.157s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.017s +sys 0m0.026s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.783s +user 0m1.959s +sys 0m0.283s + + + ============================================================================== + +Exit code: 0 + +real 0m0.831s +user 0m1.989s +sys 0m0.324s + +real 0m0.834s +user 0m1.992s +sys 0m0.324s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.015s +sys 0m0.017s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.078s +user 0m0.124s +sys 0m0.128s + + + ============================================================================== + +Exit code: 0 + +real 0m0.110s +user 0m0.141s +sys 0m0.158s + +real 0m0.112s +user 0m0.142s +sys 0m0.158s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.020s +sys 0m0.021s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.025s +user 0m0.018s +sys 0m0.015s + + + ============================================================================== + +Exit code: 0 + +real 0m0.063s +user 0m0.045s +sys 0m0.045s + +real 0m0.065s +user 0m0.046s +sys 0m0.046s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.026s +sys 0m0.022s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.460s +user 0m1.371s +sys 0m0.269s + + + ============================================================================== + +Exit code: 0 + +real 0m0.506s +user 0m1.407s +sys 0m0.301s + +real 0m0.508s +user 0m1.408s +sys 0m0.302s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.016s +sys 0m0.015s + + + ============================================================================== + +Running: gocyclo . + +13 bob Hey bob.go:10:1 +4 bob BenchmarkHey bob_test.go:16:1 +3 bob TestHey bob_test.go:5:1 +1 bob ExampleHey bob_examples_test.go:5:1 + +real 0m0.002s +user 0m0.000s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.031s +user 0m0.023s +sys 0m0.024s + +real 0m0.033s +user 0m0.025s +sys 0m0.024s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.031s +user 0m0.036s +sys 0m0.014s + + + ============================================================================== + +Exit code: 0 + +real 0m0.045s +user 0m0.041s +sys 0m0.026s + +real 0m0.047s +user 0m0.042s +sys 0m0.027s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.018s +sys 0m0.033s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:21:05 Including rules: default +[gosec] 2023/09/07 00:21:05 Excluding rules: default +[gosec] 2023/09/07 00:21:05 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/bob +[gosec] 2023/09/07 00:21:05 Checking package: bob +[gosec] 2023/09/07 00:21:05 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/bob/bob.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 72 + Nosec : 0 + Issues : 0 + + +real 0m0.108s +user 0m0.130s +sys 0m0.103s + + + ============================================================================== + +Exit code: 0 + +real 0m0.154s +user 0m0.154s +sys 0m0.150s + +real 0m0.157s +user 0m0.156s +sys 0m0.152s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.017s +sys 0m0.018s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestHey === RUN TestHey/stating_something === RUN TestHey/shouting @@ -40,7 +598,7 @@ go test -v -covermode=count -coverprofile coverage.out bob === RUN TestHey/ending_with_whitespace === RUN TestHey/other_whitespace === RUN TestHey/non-question_ending_with_whitespace ---- PASS: TestHey (0.01s) +--- PASS: TestHey (0.00s) --- PASS: TestHey/stating_something (0.00s) --- PASS: TestHey/shouting (0.00s) --- PASS: TestHey/shouting_gibberish (0.00s) @@ -70,33 +628,119 @@ go test -v -covermode=count -coverprofile coverage.out bob --- PASS: ExampleHey (0.00s) PASS coverage: 81.8% of statements -ok bob 0.013s coverage: 81.8% of statements +ok bob 0.005s coverage: 81.8% of statements -real 0m1.134s -user 0m1.539s -sys 0m0.828s +real 0m0.173s +user 0m0.217s +sys 0m0.134s -=============================================================================== -go tool cover -func=coverage.out -bob/bob.go:10: Hey 81.8% -total: (statements) 81.8% - -real 0m0.427s -user 0m0.417s -sys 0m0.349s - -=============================================================================== + ============================================================================== -go tool cover -html coverage.out -o coverage.html +Running: go tool cover -func=coverage.out -real 0m0.402s -user 0m0.463s -sys 0m0.378s +bob/bob.go:10: Hey 81.8% +total: (statements) 81.8% -=============================================================================== +real 0m0.053s +user 0m0.064s +sys 0m0.072s + + + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.052s +user 0m0.056s +sys 0m0.078s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +10 func Hey(remark string) string { +11 // The extra whitespace just gets in the way. +12 remark = strings.TrimSpace(remark) +13 +14 var reStr string +15 +16 // Question without letters. +17 reStr = `^([[:punct:]|[[:space:]])+[?]$` +18 if m, e := regexp.MatchString(reStr, remark); m { +19 if e != nil { +20 MISS panic(e) +21 } +22 return "Sure." +23 } +24 +25 // Yelling a question. +26 reStr = `^([[:upper:]]|[[:punct:]|[[:space:]])+[?]$` +27 if m, e := regexp.MatchString(reStr, remark); m { +28 if e != nil { +29 MISS panic(e) +30 } +31 return "Calm down, I know what I'm doing!" +32 } +33 +34 // Any normal question. +35 reStr = `^([[:alpha:]]|[[:digit:]]|[[:punct:]])([[:alpha:]]|[[:digit:]]|[[:punct:]]|[[:space:]])*[?]$` +36 if m, e := regexp.MatchString(reStr, remark); m { +37 if e != nil { +38 MISS panic(e) +39 } +40 return "Sure." +41 } +42 +43 // Letterless statement. +44 reStr = `^([[:digit:]]|[[:punct:]|[[:space:]])+$` +45 if m, e := regexp.MatchString(reStr, remark); m { +46 if e != nil { +47 MISS panic(e) +48 } +49 return "Whatever." +50 } +51 +52 // Yelling statement. +53 reStr = `^([[:upper:]]|[[:digit:]]|[[:punct:]|[[:space:]])+$` +54 if m, e := regexp.MatchString(reStr, remark); m { +55 if e != nil { +56 MISS panic(e) +57 } +58 return "Whoa, chill out!" +59 } +60 +61 // Silence +62 reStr = `^[[:space:]]*$` +63 if m, e := regexp.MatchString(reStr, remark); m { +64 if e != nil { +65 MISS panic(e) +66 } +67 return "Fine. Be that way!" +68 } +69 +70 // Default response. +71 return "Whatever." +72 } + + +real 0m0.017s +user 0m0.013s +sys 0m0.017s + +real 0m0.017s +user 0m0.013s +sys 0m0.017s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -go test -v -race -covermode=atomic bob === RUN TestHey === RUN TestHey/stating_something === RUN TestHey/shouting @@ -123,7 +767,7 @@ go test -v -race -covermode=atomic bob === RUN TestHey/ending_with_whitespace === RUN TestHey/other_whitespace === RUN TestHey/non-question_ending_with_whitespace ---- PASS: TestHey (0.09s) +--- PASS: TestHey (0.01s) --- PASS: TestHey/stating_something (0.00s) --- PASS: TestHey/shouting (0.00s) --- PASS: TestHey/shouting_gibberish (0.00s) @@ -150,100 +794,161 @@ go test -v -race -covermode=atomic bob --- PASS: TestHey/other_whitespace (0.00s) --- PASS: TestHey/non-question_ending_with_whitespace (0.00s) === RUN ExampleHey ---- PASS: ExampleHey (0.02s) +--- PASS: ExampleHey (0.00s) PASS coverage: 81.8% of statements -ok bob 0.140s coverage: 81.8% of statements +ok bob 1.029s coverage: 81.8% of statements + +real 0m1.281s +user 0m0.337s +sys 0m0.169s + + + ============================================================================== + +Exit code: 0 -real 0m1.229s -user 0m1.467s -sys 0m0.809s +real 0m1.609s +user 0m0.711s +sys 0m0.496s + +real 0m1.611s +user 0m0.712s +sys 0m0.497s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: bob -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkHey-4 507 3073033 ns/op 451717 B/op 5947 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkHey +BenchmarkHey-8 2659 419768 ns/op 453253 B/op 5947 allocs/op PASS -ok bob 1.879s +ok bob 1.167s -real 0m2.771s -user 0m4.582s -sys 0m1.023s +real 0m1.314s +user 0m1.407s +sys 0m0.172s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestHey +=== RUN TestHey/stating_something +=== RUN TestHey/shouting +=== RUN TestHey/shouting_gibberish +=== RUN TestHey/asking_a_question +=== RUN TestHey/asking_a_numeric_question +=== RUN TestHey/asking_gibberish +=== RUN TestHey/talking_forcefully +=== RUN TestHey/using_acronyms_in_regular_speech +=== RUN TestHey/forceful_question +=== RUN TestHey/shouting_numbers +=== RUN TestHey/no_letters +=== RUN TestHey/question_with_no_letters +=== RUN TestHey/shouting_with_special_characters +=== RUN TestHey/shouting_with_no_exclamation_mark +=== RUN TestHey/statement_containing_question_mark +=== RUN TestHey/non-letters_with_question +=== RUN TestHey/prattling_on +=== RUN TestHey/silence +=== RUN TestHey/prolonged_silence +=== RUN TestHey/alternate_silence +=== RUN TestHey/multiple_line_question +=== RUN TestHey/starting_with_whitespace +=== RUN TestHey/ending_with_whitespace +=== RUN TestHey/other_whitespace +=== RUN TestHey/non-question_ending_with_whitespace +--- PASS: TestHey (0.00s) + --- PASS: TestHey/stating_something (0.00s) + --- PASS: TestHey/shouting (0.00s) + --- PASS: TestHey/shouting_gibberish (0.00s) + --- PASS: TestHey/asking_a_question (0.00s) + --- PASS: TestHey/asking_a_numeric_question (0.00s) + --- PASS: TestHey/asking_gibberish (0.00s) + --- PASS: TestHey/talking_forcefully (0.00s) + --- PASS: TestHey/using_acronyms_in_regular_speech (0.00s) + --- PASS: TestHey/forceful_question (0.00s) + --- PASS: TestHey/shouting_numbers (0.00s) + --- PASS: TestHey/no_letters (0.00s) + --- PASS: TestHey/question_with_no_letters (0.00s) + --- PASS: TestHey/shouting_with_special_characters (0.00s) + --- PASS: TestHey/shouting_with_no_exclamation_mark (0.00s) + --- PASS: TestHey/statement_containing_question_mark (0.00s) + --- PASS: TestHey/non-letters_with_question (0.00s) + --- PASS: TestHey/prattling_on (0.00s) + --- PASS: TestHey/silence (0.00s) + --- PASS: TestHey/prolonged_silence (0.00s) + --- PASS: TestHey/alternate_silence (0.00s) + --- PASS: TestHey/multiple_line_question (0.00s) + --- PASS: TestHey/starting_with_whitespace (0.00s) + --- PASS: TestHey/ending_with_whitespace (0.00s) + --- PASS: TestHey/other_whitespace (0.00s) + --- PASS: TestHey/non-question_ending_with_whitespace (0.00s) +=== RUN ExampleHey +--- PASS: ExampleHey (0.00s) PASS -ok bob 0.009s +ok bob 0.007s -real 0m0.912s -user 0m1.151s -sys 0m0.646s +real 0m0.139s +user 0m0.185s +sys 0m0.133s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m0.848s -user 0m0.916s -sys 0m0.516s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -Hey-4 1.33ms ± 0% 3.07ms ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -Hey-4 452kB ± 0% 452kB ± 0% ~ (p=1.000 n=1+1) - -name old allocs/op new allocs/op delta -Hey-4 5.95k ± 0% 5.95k ± 0% ~ (all equal) - -real 0m0.023s -user 0m0.005s -sys 0m0.010s - -=============================================================================== - -go vet bob - -real 0m1.768s -user 0m2.906s -sys 0m0.515s - -=============================================================================== - -go fix bob +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: bob +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Hey-8 419.8µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Hey-8 442.6Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Hey-8 5.947k ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.315s -user 0m0.258s -sys 0m0.272s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Hey-4 3.073m ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +Hey-4 441.1Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./bob -[gosec] 2022/07/28 08:00:05 Including rules: default -[gosec] 2022/07/28 08:00:05 Excluding rules: default -[gosec] 2022/07/28 08:00:05 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/bob -2022/07/28 08:00:05 internal error: package "regexp" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +Hey-4 5.947k ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.726s -user 0m0.910s -sys 0m0.586s +real 0m0.004s +user 0m0.002s +sys 0m0.003s =============================================================================== gomarkdoc --output bob-doc.md -real 0m0.068s -user 0m0.040s -sys 0m0.035s +real 0m0.014s +user 0m0.006s +sys 0m0.008s =============================================================================== @@ -258,9 +963,9 @@ func Hey(remark string) string Hey returns a response from the simulated teenager. -real 0m0.385s -user 0m0.290s -sys 0m0.277s +real 0m0.041s +user 0m0.024s +sys 0m0.037s =============================================================================== diff --git a/go/booking-up-for-beauty/benchstat-old.txt b/go/booking-up-for-beauty/benchstat-old.txt new file mode 100644 index 00000000..cd6b1147 --- /dev/null +++ b/go/booking-up-for-beauty/benchstat-old.txt @@ -0,0 +1,2 @@ +PASS +ok booking 0.002s diff --git a/go/booking-up-for-beauty/run-tests-go.txt b/go/booking-up-for-beauty/run-tests-go.txt index f4ead94a..2c740b7b 100644 --- a/go/booking-up-for-beauty/run-tests-go.txt +++ b/go/booking-up-for-beauty/run-tests-go.txt @@ -5,87 +5,469 @@ Go packages: booking =============================================================================== -golangci-lint run ./... - -real 0m0.295s -user 0m0.528s -sys 0m0.210s +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.021s +sys 0m0.021s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +booking_up_for_beauty.go:9:64: Comment should end in a period (godot) +// Schedule returns a time.Time from a string containing a date + ^ +booking_up_for_beauty.go:33:69: Comment should end in a period (godot) +// IsAfternoonAppointment returns whether a time is in the afternoon + ^ +booking_up_for_beauty.go:55:66: Comment should end in a period (godot) +// Description returns a formatted string of the appointment time + ^ +booking_up_for_beauty_test.go:77: File is not `gofumpt`-ed (gofumpt) +} +booking_up_for_beauty_test.go:19:23: Using the variable on range scope `tc` in function literal (scopelint) + if got := Schedule(tc.in); !got.Equal(tc.want) { + ^ +booking_up_for_beauty_test.go:20:48: Using the variable on range scope `tc` in function literal (scopelint) + t.Errorf("Schedule(%s) = '%v', want '%v'", tc.in, got, tc.want) + ^ +booking_up_for_beauty_test.go:37:24: Using the variable on range scope `tc` in function literal (scopelint) + if got := HasPassed(tc.in); got != tc.want { + ^ +booking_up_for_beauty.go:58:2: declarations should never be cuddled (wsl) + const outputLayout = "Monday, January 2, 2006, at 15:04:05" + ^ +booking_up_for_beauty_test.go:8:1: Function TestSchedule missing the call to method parallel (paralleltest) +func TestSchedule(t *testing.T) { +^ +booking_up_for_beauty_test.go:17:2: Range statement for test TestSchedule missing the call to method parallel in test Run (paralleltest) + for name, tc := range tests { + ^ +booking_up_for_beauty_test.go:26:1: Function TestHasPassed missing the call to method parallel (paralleltest) +func TestHasPassed(t *testing.T) { +^ +booking_up_for_beauty_test.go:35:2: Range statement for test TestHasPassed missing the call to method parallel in test Run (paralleltest) + for name, tc := range tests { + ^ +booking_up_for_beauty_test.go:44:1: Function TestIsAfternoonAppointment missing the call to method parallel (paralleltest) +func TestIsAfternoonAppointment(t *testing.T) { +^ +booking_up_for_beauty_test.go:53:2: Range statement for test TestIsAfternoonAppointment missing the call to method parallel in test Run (paralleltest) + for name, tc := range tests { + ^ +booking_up_for_beauty_test.go:62:1: Function TestDescription missing the call to method parallel (paralleltest) +func TestDescription(t *testing.T) { +^ +booking_up_for_beauty_test.go:70:2: Range statement for test TestDescription missing the call to method parallel in test Run (paralleltest) + for name, tc := range tests { + ^ +booking_up_for_beauty_test.go:78:1: Function TestAnniversaryDate missing the call to method parallel (paralleltest) +func TestAnniversaryDate(t *testing.T) { +^ +booking_up_for_beauty_test.go:85:2: Range statement for test TestAnniversaryDate missing the call to method parallel in test Run (paralleltest) + for name, tc := range tests { + ^ +booking_up_for_beauty_examples_test.go:1:9: package should be `booking_test` instead of `booking` (testpackage) +package booking + ^ +booking_up_for_beauty_test.go:1:9: package should be `booking_test` instead of `booking` (testpackage) +package booking + ^ +booking_up_for_beauty.go:24:2: variable name 't' is too short for the scope of its usage (varnamelen) + t, e := time.Parse(layout, date) + ^ +booking_up_for_beauty.go:60:2: variable name 't' is too short for the scope of its usage (varnamelen) + t, e := time.Parse(inputLayout, date) + ^ +booking_up_for_beauty.go:38:2: variable name 't' is too short for the scope of its usage (varnamelen) + t, e := time.Parse(layout, date) + ^ + +real 0m0.541s +user 0m0.848s +sys 0m0.530s + + + ============================================================================== + +Exit code: -1 + +real 0m0.570s +user 0m0.873s +sys 0m0.561s + +real 0m0.573s +user 0m0.874s +sys 0m0.562s =============================================================================== -golint ./... +Running: ../../.github/citools/go/go-lint-revive -real 0m0.027s -user 0m0.013s -sys 0m0.005s +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... -=============================================================================== -revive -formatter=stylish ./... +real 0m0.030s +user 0m0.026s +sys 0m0.028s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + booking_up_for_beauty.go (1, 1) https://revive.run/r#package-comments should have a package comment ✖ 1 problem (0 errors) (1 warnings) -real 0m0.011s -user 0m0.005s -sys 0m0.006s +real 0m0.075s +user 0m0.039s +sys 0m0.055s + + + ============================================================================== + +Exit code: 0 + +real 0m0.118s +user 0m0.072s +sys 0m0.093s + +real 0m0.120s +user 0m0.074s +sys 0m0.093s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.088s -user 0m0.143s -sys 0m0.107s +real 0m0.001s +user 0m0.001s +sys 0m0.000s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.019s +sys 0m0.025s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." internal error: package "fmt" without types was imported from "booking" -real 0m0.102s -user 0m0.168s -sys 0m0.148s +real 0m0.088s +user 0m0.099s +sys 0m0.113s + + + ============================================================================== + +Exit code: -1 + +real 0m0.123s +user 0m0.129s +sys 0m0.147s + +real 0m0.126s +user 0m0.129s +sys 0m0.149s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + -real 0m0.141s -user 0m0.223s -sys 0m0.152s +real 0m0.023s +user 0m0.024s +sys 0m0.028s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +booking_up_for_beauty.go:1:1: at least one file in a package should have a package comment (ST1000) + +real 0m0.177s +user 0m0.227s +sys 0m0.134s + + + ============================================================================== + +Exit code: -1 + +real 0m0.211s +user 0m0.256s +sys 0m0.172s + +real 0m0.213s +user 0m0.256s +sys 0m0.173s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.019s +sys 0m0.030s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + ./booking_up_for_beauty.go:68:27: regexpSimplify: can re-write `(.*[0-9][0-9]:[0-9][0-9]):[0-9][0-9]$` as `(.*\d{2}:\d{2}):\d{2}$` -real 0m0.755s -user 0m2.626s -sys 0m0.439s +real 0m0.806s +user 0m1.925s +sys 0m0.315s + + + ============================================================================== + +Exit code: -1 + +real 0m0.841s +user 0m1.953s +sys 0m0.353s + +real 0m0.843s +user 0m1.955s +sys 0m0.353s =============================================================================== -go vet ./... +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.025s +sys 0m0.034s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.070s +user 0m0.100s +sys 0m0.090s + -real 0m0.090s -user 0m0.187s -sys 0m0.189s + ============================================================================== + +Exit code: 0 + +real 0m0.108s +user 0m0.132s +sys 0m0.134s + +real 0m0.110s +user 0m0.133s +sys 0m0.136s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-fixer-go_fix -real 0m0.023s -user 0m0.023s -sys 0m0.030s +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.020s +sys 0m0.021s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.027s +user 0m0.027s +sys 0m0.027s + + + ============================================================================== + +Exit code: 0 + +real 0m0.058s +user 0m0.053s +sys 0m0.055s + +real 0m0.060s +user 0m0.054s +sys 0m0.056s =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.039s +user 0m0.039s +sys 0m0.041s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.469s +user 0m1.418s +sys 0m0.266s + + + ============================================================================== + +Exit code: 0 + +real 0m0.527s +user 0m1.470s +sys 0m0.319s + +real 0m0.529s +user 0m1.471s +sys 0m0.319s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.025s +sys 0m0.025s + + + ============================================================================== + +Running: gocyclo . + 4 booking IsAfternoonAppointment booking_up_for_beauty.go:34:1 3 booking TestAnniversaryDate booking_up_for_beauty_test.go:78:1 3 booking TestDescription booking_up_for_beauty_test.go:62:1 @@ -102,41 +484,147 @@ gocyclo . 1 booking ExampleSchedule booking_up_for_beauty_examples_test.go:9:1 1 booking AnniversaryDate booking_up_for_beauty.go:76:1 -real 0m0.002s +real 0m0.003s user 0m0.001s sys 0m0.001s + + ============================================================================== + +Exit code: 0 + +real 0m0.038s +user 0m0.035s +sys 0m0.031s + +real 0m0.040s +user 0m0.037s +sys 0m0.032s + =============================================================================== -misspell . +Running: ../../.github/citools/go/go-lint-misspell -real 0m0.032s -user 0m0.025s -sys 0m0.011s +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.026s +user 0m0.036s +sys 0m0.014s + + + ============================================================================== + +Exit code: 0 + +real 0m0.035s +user 0m0.043s +sys 0m0.021s + +real 0m0.038s +user 0m0.044s +sys 0m0.022s =============================================================================== -gosec ./... -[gosec] 2023/03/04 21:52:20 Including rules: default -[gosec] 2023/03/04 21:52:20 Excluding rules: default -[gosec] 2023/03/04 21:52:20 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/booking-up-for-beauty -2023/03/04 21:52:20 internal error: package "fmt" without types was imported from "command-line-arguments" +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.022s +sys 0m0.045s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:21:11 Including rules: default +[gosec] 2023/09/07 00:21:11 Excluding rules: default +[gosec] 2023/09/07 00:21:11 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/booking-up-for-beauty +[gosec] 2023/09/07 00:21:11 Checking package: booking +[gosec] 2023/09/07 00:21:11 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/booking-up-for-beauty/booking_up_for_beauty.go +Results: + -real 0m0.127s -user 0m0.196s -sys 0m0.114s +Summary: + Gosec : dev + Files : 1 + Lines : 82 + Nosec : 0 + Issues : 0 + + +real 0m0.131s +user 0m0.138s +sys 0m0.106s + + + ============================================================================== + +Exit code: 0 + +real 0m0.174s +user 0m0.169s +sys 0m0.158s + +real 0m0.176s +user 0m0.169s +sys 0m0.160s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.031s +sys 0m0.036s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestSchedule -=== RUN TestSchedule/Schedule_3 === RUN TestSchedule/Schedule_1 === RUN TestSchedule/Schedule_2 +=== RUN TestSchedule/Schedule_3 --- PASS: TestSchedule (0.00s) - --- PASS: TestSchedule/Schedule_3 (0.00s) --- PASS: TestSchedule/Schedule_1 (0.00s) --- PASS: TestSchedule/Schedule_2 (0.00s) + --- PASS: TestSchedule/Schedule_3 (0.00s) === RUN TestHasPassed === RUN TestHasPassed/HasPassed_1 === RUN TestHasPassed/HasPassed_2 @@ -146,13 +634,13 @@ gotest -v -covermode=count -coverprofile coverage.out ./... --- PASS: TestHasPassed/HasPassed_2 (0.00s) --- PASS: TestHasPassed/HasPassed_3 (0.00s) === RUN TestIsAfternoonAppointment -=== RUN TestIsAfternoonAppointment/IsAfternoonAppointment_2 === RUN TestIsAfternoonAppointment/IsAfternoonAppointment_3 === RUN TestIsAfternoonAppointment/IsAfternoonAppointment_1 +=== RUN TestIsAfternoonAppointment/IsAfternoonAppointment_2 --- PASS: TestIsAfternoonAppointment (0.00s) - --- PASS: TestIsAfternoonAppointment/IsAfternoonAppointment_2 (0.00s) --- PASS: TestIsAfternoonAppointment/IsAfternoonAppointment_3 (0.00s) --- PASS: TestIsAfternoonAppointment/IsAfternoonAppointment_1 (0.00s) + --- PASS: TestIsAfternoonAppointment/IsAfternoonAppointment_2 (0.00s) === RUN TestDescription === RUN TestDescription/Description_1 === RUN TestDescription/Description_2 @@ -176,16 +664,18 @@ gotest -v -covermode=count -coverprofile coverage.out ./... === RUN ExampleAnniversaryDate --- PASS: ExampleAnniversaryDate (0.00s) PASS - booking coverage: 87.5% of statements +coverage: 87.5% of statements ok booking 0.002s coverage: 87.5% of statements -real 0m0.200s -user 0m0.303s -sys 0m0.229s +real 0m0.207s +user 0m0.272s +sys 0m0.183s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + booking/booking_up_for_beauty.go:10: Schedule 80.0% booking/booking_up_for_beauty.go:22: HasPassed 80.0% booking/booking_up_for_beauty.go:34: IsAfternoonAppointment 90.0% @@ -193,21 +683,26 @@ booking/booking_up_for_beauty.go:56: Description 88.9% booking/booking_up_for_beauty.go:76: AnniversaryDate 100.0% total: (statements) 87.5% -real 0m0.066s -user 0m0.084s -sys 0m0.085s +real 0m0.056s +user 0m0.062s +sys 0m0.067s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.068s -user 0m0.102s -sys 0m0.094s +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.049s +user 0m0.065s +sys 0m0.070s -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt 56 func Description(date string) string { 57 const inputLayout = "1/2/2006 15:04:05" @@ -275,13 +770,19 @@ gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annota 19 } -real 0m0.027s -user 0m0.023s -sys 0m0.030s +real 0m0.020s +user 0m0.022s +sys 0m0.033s -=============================================================================== +real 0m0.020s +user 0m0.022s +sys 0m0.033s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestSchedule === RUN TestSchedule/Schedule_1 === RUN TestSchedule/Schedule_2 @@ -291,13 +792,13 @@ gotest -v -race -covermode=atomic ./... --- PASS: TestSchedule/Schedule_2 (0.00s) --- PASS: TestSchedule/Schedule_3 (0.00s) === RUN TestHasPassed +=== RUN TestHasPassed/HasPassed_2 === RUN TestHasPassed/HasPassed_3 === RUN TestHasPassed/HasPassed_1 -=== RUN TestHasPassed/HasPassed_2 --- PASS: TestHasPassed (0.00s) + --- PASS: TestHasPassed/HasPassed_2 (0.00s) --- PASS: TestHasPassed/HasPassed_3 (0.00s) --- PASS: TestHasPassed/HasPassed_1 (0.00s) - --- PASS: TestHasPassed/HasPassed_2 (0.00s) === RUN TestIsAfternoonAppointment === RUN TestIsAfternoonAppointment/IsAfternoonAppointment_1 === RUN TestIsAfternoonAppointment/IsAfternoonAppointment_2 @@ -329,22 +830,38 @@ gotest -v -race -covermode=atomic ./... === RUN ExampleAnniversaryDate --- PASS: ExampleAnniversaryDate (0.00s) PASS - booking coverage: 87.5% of statements -ok booking 0.035s coverage: 87.5% of statements +coverage: 87.5% of statements +ok booking 1.019s coverage: 87.5% of statements + +real 0m1.246s +user 0m0.283s +sys 0m0.176s + + + ============================================================================== -real 0m0.292s -user 0m0.434s -sys 0m0.247s +Exit code: 0 + +real 0m1.631s +user 0m0.748s +sys 0m0.580s + +real 0m1.634s +user 0m0.749s +sys 0m0.581s =============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt PASS ok booking 0.002s -real 0m0.144s -user 0m0.245s -sys 0m0.152s +real 0m0.156s +user 0m0.193s +sys 0m0.151s =============================================================================== @@ -398,21 +915,25 @@ gotest -v -tags bonus PASS ok booking 0.002s -real 0m0.156s -user 0m0.312s -sys 0m0.250s +real 0m0.125s +user 0m0.174s +sys 0m0.129s =============================================================================== -No old benchmarks to run benchstat against. +benchstat benchstat-old.txt benchstat-new.txt + +real 0m0.002s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output booking-doc.md -real 0m0.010s -user 0m0.004s -sys 0m0.006s +real 0m0.011s +user 0m0.009s +sys 0m0.002s =============================================================================== @@ -439,8 +960,8 @@ func Schedule(date string) time.Time real 0m0.037s -user 0m0.025s -sys 0m0.045s +user 0m0.031s +sys 0m0.029s =============================================================================== diff --git a/go/bottle-song/benchstat-new.txt b/go/bottle-song/benchstat-new.txt index 86928cc2..6bcfef28 100644 --- a/go/bottle-song/benchstat-new.txt +++ b/go/bottle-song/benchstat-new.txt @@ -1,2 +1,2 @@ PASS -ok bottlesong 0.003s +ok bottlesong 0.002s diff --git a/go/bottle-song/benchstat-old.txt b/go/bottle-song/benchstat-old.txt new file mode 100644 index 00000000..86928cc2 --- /dev/null +++ b/go/bottle-song/benchstat-old.txt @@ -0,0 +1,2 @@ +PASS +ok bottlesong 0.003s diff --git a/go/bottle-song/run-tests-go.txt b/go/bottle-song/run-tests-go.txt index 218886d0..fffd8aaa 100644 --- a/go/bottle-song/run-tests-go.txt +++ b/go/bottle-song/run-tests-go.txt @@ -5,81 +5,483 @@ Go packages: bottlesong =============================================================================== -golangci-lint run ./... +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.251s -user 0m0.445s -sys 0m0.259s +Running GoLangCi-Lint -=============================================================================== +Go version: -golint ./... + go version go1.21.0 linux/amd64 -real 0m0.005s -user 0m0.003s -sys 0m0.002s + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.028s +sys 0m0.030s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[linters_context] rowserrcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649." +level=warning msg="[linters_context] structcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649." +level=warning msg="[linters_context] wastedassign is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649." +cases_test.go:18: File is not `gofumpt`-ed (gofumpt) + +bottle_song_examples_test.go:124: line is 185 characters (lll) + // [Ten green bottles hanging on the wall, Ten green bottles hanging on the wall, And if one green bottle should accidentally fall, There'll be nine green bottles hanging on the wall.] +bottle_song_examples_test.go:126: line is 188 characters (lll) + // [Nine green bottles hanging on the wall, Nine green bottles hanging on the wall, And if one green bottle should accidentally fall, There'll be eight green bottles hanging on the wall.] +bottle_song_examples_test.go:128: line is 190 characters (lll) + // [Eight green bottles hanging on the wall, Eight green bottles hanging on the wall, And if one green bottle should accidentally fall, There'll be seven green bottles hanging on the wall.] +bottle_song_examples_test.go:130: line is 188 characters (lll) + // [Seven green bottles hanging on the wall, Seven green bottles hanging on the wall, And if one green bottle should accidentally fall, There'll be six green bottles hanging on the wall.] +bottle_song_examples_test.go:132: line is 185 characters (lll) + // [Six green bottles hanging on the wall, Six green bottles hanging on the wall, And if one green bottle should accidentally fall, There'll be five green bottles hanging on the wall.] +bottle_song_examples_test.go:134: line is 187 characters (lll) + // [Five green bottles hanging on the wall, Five green bottles hanging on the wall, And if one green bottle should accidentally fall, There'll be four green bottles hanging on the wall.] +bottle_song_examples_test.go:136: line is 188 characters (lll) + // [Four green bottles hanging on the wall, Four green bottles hanging on the wall, And if one green bottle should accidentally fall, There'll be three green bottles hanging on the wall.] +bottle_song_examples_test.go:140: line is 183 characters (lll) + // [Two green bottles hanging on the wall, Two green bottles hanging on the wall, And if one green bottle should accidentally fall, There'll be one green bottle hanging on the wall.] +bottle_song_examples_test.go:142: line is 181 characters (lll) + // [One green bottle hanging on the wall, One green bottle hanging on the wall, And if one green bottle should accidentally fall, There'll be no green bottles hanging on the wall.] +bottle_song_test.go:13:21: Using the variable on range scope `tc` in function literal (scopelint) + actual := Recite(tc.input.startBottles, tc.input.takeDown) + ^ +bottle_song_test.go:14:22: Using the variable on range scope `tc` in function literal (scopelint) + if !equal(actual, tc.expected) { + ^ +bottle_song_test.go:15:47: Using the variable on range scope `tc` in function literal (scopelint) + t.Errorf("Recite(%d, %d) = %q, want: %q", tc.input.startBottles, tc.input.takeDown, actual, tc.expected) + ^ +bottle_song_test.go:44:2: return statements should not be cuddled if block has more than two lines (wsl) + return strings.Map( + ^ +bottle_song_test.go:70:3: return statements should not be cuddled if block has more than two lines (wsl) + return true + ^ +bottle_song_test.go:57:1: calculated cyclomatic complexity for function isSeparator is 11, max is 10 (cyclop) +func isSeparator(r rune) bool { +^ +bottle_song.go:115:3: Duplicate words (because) found (dupword) + // This can't return an error because because of the other fast fails are making sure line is valid here. + ^ +bottle_song.go:36:5: NumberNames is a global variable (gochecknoglobals) +var NumberNames = map[Number]string{ + ^ +cases_test.go:13:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +bottle_song.go:69:14: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"you can't have zero or less bottles\")" (goerr113) + return "", errors.New("you can't have zero or less bottles") + ^ +bottle_song.go:73:14: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"you can't have more than 10 bottles\")" (goerr113) + return "", errors.New("you can't have more than 10 bottles") + ^ +bottle_song.go:111:14: err113: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"not enough bottles %[1]d to take down %[2]d\", start, takeDown)" (goerr113) + return "", fmt.Errorf("not enough bottles %[1]d to take down %[2]d", start, takeDown) + ^ +bottle_song_test.go:51:4: return with no blank line before (nlreturn) + return r + ^ +bottle_song_test.go:48:5: return with no blank line before (nlreturn) + return unicode.ToTitle(r) + ^ +bottle_song_test.go:10:1: Function TestRecite missing the call to method parallel (paralleltest) +func TestRecite(t *testing.T) { +^ +bottle_song_test.go:11:2: Range statement for test TestRecite missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +bottle_song_examples_test.go:1:9: package should be `bottlesong_test` instead of `bottlesong` (testpackage) +package bottlesong + ^ +bottle_song_test.go:1:9: package should be `bottlesong_test` instead of `bottlesong` (testpackage) +package bottlesong + ^ +cases_test.go:1:9: package should be `bottlesong_test` instead of `bottlesong` (testpackage) +package bottlesong + ^ +bottle_song_test.go:21:12: parameter name 'b' is too short for the scope of its usage (varnamelen) +func equal(a, b []string) bool { + ^ +bottle_song_test.go:45:8: parameter name 'r' is too short for the scope of its usage (varnamelen) + func(r rune) rune { + ^ +bottle_song_test.go:39:12: parameter name 's' is too short for the scope of its usage (varnamelen) +func Title(s string) string { + ^ + +real 0m1.871s +user 0m5.301s +sys 0m0.814s + + + ============================================================================== + +Exit code: -1 + +real 0m1.918s +user 0m5.338s +sys 0m0.856s + +real 0m1.921s +user 0m5.341s +sys 0m0.856s =============================================================================== -revive -formatter=stylish ./... +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.019s +sys 0m0.026s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.061s +user 0m0.028s +sys 0m0.049s + + + ============================================================================== + +Exit code: 0 -real 0m0.239s -user 0m0.349s -sys 0m0.346s +real 0m0.096s +user 0m0.054s +sys 0m0.087s + +real 0m0.098s +user 0m0.055s +sys 0m0.088s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.086s -user 0m0.158s -sys 0m0.117s +real 0m0.001s +user 0m0.000s +sys 0m0.001s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.024s +sys 0m0.038s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." internal error: package "errors" without types was imported from "bottlesong" -real 0m0.096s -user 0m0.195s -sys 0m0.169s +real 0m0.108s +user 0m0.127s +sys 0m0.151s + + + ============================================================================== + +Exit code: -1 + +real 0m0.148s +user 0m0.159s +sys 0m0.198s + +real 0m0.150s +user 0m0.159s +sys 0m0.200s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.021s +sys 0m0.015s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m1.252s +user 0m3.544s +sys 0m0.356s + + + ============================================================================== -real 0m0.149s -user 0m0.204s -sys 0m0.164s +Exit code: 0 + +real 0m1.285s +user 0m3.572s +sys 0m0.380s + +real 0m1.287s +user 0m3.573s +sys 0m0.381s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== -real 0m0.731s -user 0m2.281s -sys 0m0.458s +Running: go clean ./... + + +real 0m0.028s +user 0m0.022s +sys 0m0.035s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.857s +user 0m2.070s +sys 0m0.339s + + + ============================================================================== + +Exit code: 0 + +real 0m0.900s +user 0m2.101s +sys 0m0.387s + +real 0m0.903s +user 0m2.102s +sys 0m0.388s =============================================================================== -go vet ./... +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: -real 0m0.089s -user 0m0.185s -sys 0m0.155s + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.027s +sys 0m0.034s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.079s +user 0m0.117s +sys 0m0.109s + + + ============================================================================== + +Exit code: 0 + +real 0m0.123s +user 0m0.152s +sys 0m0.151s + +real 0m0.125s +user 0m0.153s +sys 0m0.152s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-fixer-go_fix -real 0m0.026s +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s user 0m0.019s -sys 0m0.030s +sys 0m0.020s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.023s +user 0m0.021s +sys 0m0.024s + + + ============================================================================== + +Exit code: 0 + +real 0m0.054s +user 0m0.044s +sys 0m0.055s + +real 0m0.055s +user 0m0.045s +sys 0m0.055s =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.012s +sys 0m0.024s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.478s +user 0m1.563s +sys 0m0.259s + + + ============================================================================== + +Exit code: 0 + +real 0m0.510s +user 0m1.582s +sys 0m0.291s + +real 0m0.512s +user 0m1.583s +sys 0m0.292s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.031s +sys 0m0.032s + + + ============================================================================== + +Running: gocyclo . + 11 bottlesong isSeparator bottle_song_test.go:57:1 7 bottlesong Verse bottle_song.go:61:1 5 bottlesong Recite bottle_song.go:129:1 @@ -94,25 +496,85 @@ gocyclo . 1 bottlesong (Number).String bottle_song.go:51:1 real 0m0.002s -user 0m0.001s -sys 0m0.001s +user 0m0.000s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.050s +user 0m0.038s +sys 0m0.050s + +real 0m0.053s +user 0m0.039s +sys 0m0.052s =============================================================================== -misspell . +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.047s +user 0m0.027s +sys 0m0.027s + + + ============================================================================== + +Exit code: 0 + +real 0m0.058s +user 0m0.034s +sys 0m0.034s -real 0m0.024s -user 0m0.029s -sys 0m0.016s +real 0m0.059s +user 0m0.035s +sys 0m0.035s =============================================================================== -gosec ./... -[gosec] 2023/03/06 22:06:22 Including rules: default -[gosec] 2023/03/06 22:06:22 Excluding rules: default -[gosec] 2023/03/06 22:06:22 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/bottle-song -[gosec] 2023/03/06 22:06:22 Checking package: bottlesong -[gosec] 2023/03/06 22:06:22 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/bottle-song/bottle_song.go +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.018s +sys 0m0.026s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:21:18 Including rules: default +[gosec] 2023/09/07 00:21:18 Excluding rules: default +[gosec] 2023/09/07 00:21:18 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/bottle-song +[gosec] 2023/09/07 00:21:18 Checking package: bottlesong +[gosec] 2023/09/07 00:21:18 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/bottle-song/bottle_song.go Results: @@ -124,13 +586,48 @@ Results: Issues : 0 -real 0m0.140s -user 0m0.155s -sys 0m0.116s +real 0m0.119s +user 0m0.133s +sys 0m0.099s + + + ============================================================================== + +Exit code: 0 + +real 0m0.161s +user 0m0.160s +sys 0m0.138s + +real 0m0.163s +user 0m0.161s +sys 0m0.139s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.021s +sys 0m0.024s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestRecite === RUN TestRecite/first_generic_verse === RUN TestRecite/last_generic_verse @@ -154,16 +651,18 @@ gotest -v -covermode=count -coverprofile coverage.out ./... === RUN ExampleRecite --- PASS: ExampleRecite (0.00s) PASS - bottlesong coverage: 100.0% of statements -ok bottlesong 0.004s coverage: 100.0% of statements +coverage: 100.0% of statements +ok bottlesong 0.003s coverage: 100.0% of statements -real 0m0.206s -user 0m0.339s -sys 0m0.255s +real 0m0.166s +user 0m0.224s +sys 0m0.131s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + bottlesong/bottle_song.go:51: String 100.0% bottlesong/bottle_song.go:56: Int 100.0% bottlesong/bottle_song.go:61: Verse 100.0% @@ -171,29 +670,40 @@ bottlesong/bottle_song.go:107: Verses 100.0% bottlesong/bottle_song.go:129: Recite 100.0% total: (statements) 100.0% -real 0m0.077s -user 0m0.160s -sys 0m0.123s +real 0m0.054s +user 0m0.071s +sys 0m0.073s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.072s -user 0m0.133s -sys 0m0.116s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +real 0m0.058s +user 0m0.086s +sys 0m0.072s -real 0m0.020s -user 0m0.020s -sys 0m0.025s -=============================================================================== + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.019s +user 0m0.015s +sys 0m0.023s + +real 0m0.019s +user 0m0.015s +sys 0m0.024s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestRecite === RUN TestRecite/first_generic_verse === RUN TestRecite/last_generic_verse @@ -217,22 +727,38 @@ gotest -v -race -covermode=atomic ./... === RUN ExampleRecite --- PASS: ExampleRecite (0.00s) PASS - bottlesong coverage: 100.0% of statements -ok bottlesong 0.036s coverage: 100.0% of statements +coverage: 100.0% of statements +ok bottlesong 1.016s coverage: 100.0% of statements + +real 0m1.240s +user 0m0.273s +sys 0m0.165s + + + ============================================================================== -real 0m0.310s -user 0m0.504s -sys 0m0.329s +Exit code: 0 + +real 0m1.573s +user 0m0.693s +sys 0m0.499s + +real 0m1.575s +user 0m0.693s +sys 0m0.501s =============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt PASS -ok bottlesong 0.003s +ok bottlesong 0.002s -real 0m0.196s -user 0m0.339s -sys 0m0.268s +real 0m0.151s +user 0m0.206s +sys 0m0.119s =============================================================================== @@ -262,21 +788,25 @@ gotest -v -tags bonus PASS ok bottlesong 0.002s -real 0m0.155s -user 0m0.299s -sys 0m0.208s +real 0m0.133s +user 0m0.197s +sys 0m0.125s =============================================================================== -No old benchmarks to run benchstat against. +benchstat benchstat-old.txt benchstat-new.txt + +real 0m0.005s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output bottlesong-doc.md -real 0m0.012s -user 0m0.005s -sys 0m0.007s +real 0m0.010s +user 0m0.004s +sys 0m0.006s =============================================================================== @@ -353,9 +883,9 @@ func (n Number) String() string String implements the Stringer interface for a Number. -real 0m0.042s -user 0m0.029s -sys 0m0.053s +real 0m0.038s +user 0m0.030s +sys 0m0.032s =============================================================================== diff --git a/go/card-tricks/benchstat-new.txt b/go/card-tricks/benchstat-new.txt new file mode 100644 index 00000000..92e374f2 --- /dev/null +++ b/go/card-tricks/benchstat-new.txt @@ -0,0 +1,2 @@ +PASS +ok cards 0.002s diff --git a/go/card-tricks/cards-doc.md b/go/card-tricks/cards-doc.md index b4e24e7e..9acd670b 100755 --- a/go/card-tricks/cards-doc.md +++ b/go/card-tricks/cards-doc.md @@ -21,7 +21,7 @@ import "cards" func FavoriteCards() []int ``` -FavoriteCards returns a slice with the cards 2\, 6 and 9 in that order\. +FavoriteCards returns a slice with the cards 2, 6 and 9 in that order.

Example

@@ -48,7 +48,7 @@ FavoriteCards returns a slice with the cards 2\, 6 and 9 in that order\. func GetItem(slice []int, index int) int ``` -GetItem retrieves an item from a slice at given position\. If the index is out of range\, we want it to return \-1\. +GetItem retrieves an item from a slice at given position. If the index is out of range, we want it to return \-1.

Example

@@ -80,7 +80,7 @@ GetItem retrieves an item from a slice at given position\. If the index is out o func PrependItems(slice []int, value ...int) []int ``` -PrependItems adds an arbitrary number of values at the front of a slice\. +PrependItems adds an arbitrary number of values at the front of a slice.

Example

@@ -112,7 +112,7 @@ PrependItems adds an arbitrary number of values at the front of a slice\. func RemoveItem(slice []int, index int) []int ``` -RemoveItem removes an item from a slice by modifying the existing slice\. +RemoveItem removes an item from a slice by modifying the existing slice.

Example

@@ -144,7 +144,7 @@ RemoveItem removes an item from a slice by modifying the existing slice\. func SetItem(slice []int, index, value int) []int ``` -SetItem writes an item to a slice at given position overwriting an existing value\. If the index is out of range the value needs to be appended\. +SetItem writes an item to a slice at given position overwriting an existing value. If the index is out of range the value needs to be appended.

Example

diff --git a/go/card-tricks/coverage-annotations.txt b/go/card-tricks/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/card-tricks/coverage.html b/go/card-tricks/coverage.html new file mode 100644 index 00000000..27b3beb0 --- /dev/null +++ b/go/card-tricks/coverage.html @@ -0,0 +1,169 @@ + + + + + + cards: Go Coverage Report + + + +

+ +
+ not tracked + + no coverage + low coverage + * + * + * + * + * + * + * + * + high coverage + +
+
+
+ + + +
+ + + diff --git a/go/card-tricks/coverage.out b/go/card-tricks/coverage.out index f2a22607..57faa9e4 100644 --- a/go/card-tricks/coverage.out +++ b/go/card-tricks/coverage.out @@ -1,17 +1,17 @@ mode: count cards/card_tricks.go:4.28,6.2 1 2 cards/card_tricks.go:10.42,13.38 2 7 -cards/card_tricks.go:19.2,19.15 1 7 cards/card_tricks.go:13.38,15.3 1 4 cards/card_tricks.go:15.8,17.3 1 3 +cards/card_tricks.go:19.2,19.15 1 7 cards/card_tricks.go:24.51,25.38 1 10 -cards/card_tricks.go:31.2,31.14 1 10 cards/card_tricks.go:25.38,27.3 1 7 cards/card_tricks.go:27.8,29.3 1 3 +cards/card_tricks.go:31.2,31.14 1 10 cards/card_tricks.go:35.52,39.18 3 7 -cards/card_tricks.go:43.2,43.17 1 7 cards/card_tricks.go:39.18,41.3 1 5 +cards/card_tricks.go:43.2,43.17 1 7 cards/card_tricks.go:47.47,50.38 2 7 -cards/card_tricks.go:56.2,56.17 1 7 cards/card_tricks.go:50.38,52.3 1 4 cards/card_tricks.go:52.8,54.3 1 3 +cards/card_tricks.go:56.2,56.17 1 7 diff --git a/go/card-tricks/run-tests-go.txt b/go/card-tricks/run-tests-go.txt index b628eec9..c29de3a2 100644 --- a/go/card-tricks/run-tests-go.txt +++ b/go/card-tricks/run-tests-go.txt @@ -5,15 +5,636 @@ Go packages: cards =============================================================================== -golint cards +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.003s +sys 0m0.012s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +card_tricks_test.go:77: Function 'TestSetItem' is too long (74 > 60) (funlen) +func TestSetItem(t *testing.T) { +card_tricks.go:40:14: appendAssign: append result not assigned to the same slice (gocritic) + newSlice = append(value, slice...) + ^ +card_tricks.go:51:14: appendAssign: append result not assigned to the same slice (gocritic) + newSlice = append(slice[:index], slice[index+1:]...) + ^ +card_tricks_test.go:296: File is not `gofumpt`-ed (gofumpt) + var slice = make([]int, len(s)) +card_tricks.go:36:15: var-declaration: should omit type []int from declaration of var newSlice; it will be inferred from the right-hand side (revive) + var newSlice []int = []int{} + ^ +card_tricks.go:48:15: var-declaration: should omit type []int from declaration of var newSlice; it will be inferred from the right-hand side (revive) + var newSlice []int = []int{} + ^ +card_tricks_test.go:69:19: Using the variable on range scope `tt` in function literal (scopelint) + got := GetItem(tt.args.slice, tt.args.index) + ^ +card_tricks_test.go:70:14: Using the variable on range scope `tt` in function literal (scopelint) + if got != tt.want { + ^ +card_tricks_test.go:71:63: Using the variable on range scope `tt` in function literal (scopelint) + t.Errorf("GetItem(slice:%v, index:%v) got = %v, want %v", tt.args.slice, tt.args.index, got, tt.want) + ^ +card_tricks_test.go:11:2: only one cuddle assignment allowed before if statement (wsl) + if !slicesEqual(got, want) { + ^ +card_tricks_test.go:21:2: assignments should only be cuddled with other assignments (wsl) + tests := []struct { + ^ +card_tricks_test.go:67:2: only one cuddle assignment allowed before range statement (wsl) + for _, tt := range tests { + ^ +card_tricks_test.go:83:2: assignments should only be cuddled with other assignments (wsl) + tests := []struct { + ^ +card_tricks_test.go:134:2: only one cuddle assignment allowed before range statement (wsl) + for _, tt := range tests { + ^ +card_tricks_test.go:159:2: assignments should only be cuddled with other assignments (wsl) + tests := []struct { + ^ +card_tricks_test.go:205:2: only one cuddle assignment allowed before range statement (wsl) + for _, tt := range tests { + ^ +card_tricks_test.go:297:2: expressions should not be cuddled with declarations or returns (wsl) + copy(slice, s) + ^ +card_tricks_test.go:298:2: return statements should not be cuddled if block has more than two lines (wsl) + return slice + ^ +card_tricks_test.go:9:2: variable 'got' is only used in the if-statement (card_tricks_test.go:11:2); consider using short syntax (ifshort) + got := FavoriteCards() + ^ +card_tricks_test.go:10:2: variable 'want' is only used in the if-statement (card_tricks_test.go:11:2); consider using short syntax (ifshort) + want := []int{2, 6, 9} + ^ +card_tricks_test.go:8:1: Function TestFavoriteCards missing the call to method parallel (paralleltest) +func TestFavoriteCards(t *testing.T) { +^ +card_tricks_test.go:16:1: Function TestGetItem missing the call to method parallel (paralleltest) +func TestGetItem(t *testing.T) { +^ +card_tricks_test.go:154:1: Function TestPrependItems missing the call to method parallel (paralleltest) +func TestPrependItems(t *testing.T) { +^ +card_tricks_test.go:216:1: Function TestRemoveItem missing the call to method parallel (paralleltest) +func TestRemoveItem(t *testing.T) { +^ +card_tricks_examples_test.go:1:9: package should be `cards_test` instead of `cards` (testpackage) +package cards + ^ +card_tricks_test.go:1:9: package should be `cards_test` instead of `cards` (testpackage) +package cards + ^ +card_tricks_test.go:276:18: parameter name 'b' is too short for the scope of its usage (varnamelen) +func slicesEqual(a, b []int) bool { + ^ + +real 0m0.512s +user 0m0.784s +sys 0m0.448s + + + ============================================================================== + +Exit code: -1 + +real 0m0.536s +user 0m0.794s +sys 0m0.470s + +real 0m0.538s +user 0m0.795s +sys 0m0.472s -real 0m0.210s -user 0m0.189s -sys 0m0.173s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.005s +sys 0m0.008s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +card_tricks.go + (1, 1) https://revive.run/r#package-comments should have a package comment + (36, 15) https://revive.run/r#var-declaration should omit type []int from declaration of var newSlice; it will be inferred from the right-hand side + (48, 15) https://revive.run/r#var-declaration should omit type []int from declaration of var newSlice; it will be inferred from the right-hand side + + + ✖ 3 problems (0 errors) (3 warnings) + +real 0m0.040s +user 0m0.017s +sys 0m0.033s + + + ============================================================================== + +Exit code: 0 + +real 0m0.063s +user 0m0.029s +sys 0m0.052s + +real 0m0.065s +user 0m0.030s +sys 0m0.053s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.000s +user 0m0.001s +sys 0m0.000s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out cards +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.005s +sys 0m0.012s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "cards [cards.test]" + +real 0m0.103s +user 0m0.127s +sys 0m0.116s + + + ============================================================================== + +Exit code: -1 + +real 0m0.128s +user 0m0.135s +sys 0m0.139s + +real 0m0.129s +user 0m0.136s +sys 0m0.140s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.010s +user 0m0.004s +sys 0m0.008s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +card_tricks.go:1:1: at least one file in a package should have a package comment (ST1000) +card_tricks.go:36:15: should omit type []int from declaration; it will be inferred from the right-hand side (ST1023) +card_tricks.go:48:15: should omit type []int from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.186s +user 0m0.234s +sys 0m0.149s + + + ============================================================================== + +Exit code: -1 + +real 0m0.207s +user 0m0.245s +sys 0m0.166s + +real 0m0.209s +user 0m0.247s +sys 0m0.166s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.009s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./card_tricks.go:40:14: appendAssign: append result not assigned to the same slice +./card_tricks.go:51:14: appendAssign: append result not assigned to the same slice + +real 0m0.831s +user 0m2.051s +sys 0m0.273s + + + ============================================================================== + +Exit code: -1 + +real 0m0.854s +user 0m2.061s +sys 0m0.293s + +real 0m0.855s +user 0m2.063s +sys 0m0.293s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.010s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.083s +user 0m0.114s +sys 0m0.112s + + + ============================================================================== + +Exit code: 0 + +real 0m0.108s +user 0m0.126s +sys 0m0.132s + +real 0m0.110s +user 0m0.128s +sys 0m0.132s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.006s +sys 0m0.010s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.018s +user 0m0.007s +sys 0m0.015s + + + ============================================================================== + +Exit code: 0 + +real 0m0.043s +user 0m0.019s +sys 0m0.032s + +real 0m0.045s +user 0m0.019s +sys 0m0.034s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.008s +sys 0m0.008s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.460s +user 0m1.279s +sys 0m0.233s + + + ============================================================================== + +Exit code: 0 + +real 0m0.484s +user 0m1.291s +sys 0m0.253s + +real 0m0.486s +user 0m1.293s +sys 0m0.253s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.007s +sys 0m0.010s + + + ============================================================================== + +Running: gocyclo . + +6 cards TestSetItem card_tricks_test.go:77:1 +5 cards slicesEqual card_tricks_test.go:276:1 +3 cards TestRemoveItem card_tricks_test.go:216:1 +3 cards TestPrependItems card_tricks_test.go:154:1 +3 cards TestGetItem card_tricks_test.go:16:1 +3 cards RemoveItem card_tricks.go:47:1 +3 cards SetItem card_tricks.go:24:1 +3 cards GetItem card_tricks.go:10:1 +2 cards TestFavoriteCards card_tricks_test.go:8:1 +2 cards PrependItems card_tricks.go:35:1 +1 cards copySlice card_tricks_test.go:295:1 +1 cards ExampleRemoveItem card_tricks_examples_test.go:62:1 +1 cards ExamplePrependItems card_tricks_examples_test.go:51:1 +1 cards ExampleSetItem card_tricks_examples_test.go:23:1 +1 cards ExampleGetItem card_tricks_examples_test.go:12:1 +1 cards ExampleFavoriteCards card_tricks_examples_test.go:7:1 +1 cards FavoriteCards card_tricks.go:4:1 + +real 0m0.002s +user 0m0.001s +sys 0m0.001s + + + ============================================================================== + +Exit code: 0 + +real 0m0.035s +user 0m0.015s +sys 0m0.030s + +real 0m0.037s +user 0m0.015s +sys 0m0.031s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.030s +user 0m0.028s +sys 0m0.016s + + + ============================================================================== + +Exit code: 0 + +real 0m0.044s +user 0m0.037s +sys 0m0.024s + +real 0m0.047s +user 0m0.038s +sys 0m0.027s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.006s +sys 0m0.013s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:21:23 Including rules: default +[gosec] 2023/09/07 00:21:23 Excluding rules: default +[gosec] 2023/09/07 00:21:23 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/card-tricks +[gosec] 2023/09/07 00:21:23 Checking package: cards +[gosec] 2023/09/07 00:21:23 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/card-tricks/card_tricks.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 57 + Nosec : 0 + Issues : 0 + + +real 0m0.087s +user 0m0.066s +sys 0m0.061s + + + ============================================================================== + +Exit code: 0 + +real 0m0.112s +user 0m0.078s +sys 0m0.082s + +real 0m0.114s +user 0m0.080s +sys 0m0.082s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.014s +sys 0m0.028s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestFavoriteCards --- PASS: TestFavoriteCards (0.00s) === RUN TestGetItem @@ -76,15 +697,17 @@ go test -v -covermode=count -coverprofile coverage.out cards --- PASS: ExampleRemoveItem (0.00s) PASS coverage: 100.0% of statements -ok cards 0.020s coverage: 100.0% of statements +ok cards 0.003s coverage: 100.0% of statements -real 0m0.663s -user 0m0.732s -sys 0m0.502s +real 0m0.194s +user 0m0.245s +sys 0m0.163s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + cards/card_tricks.go:4: FavoriteCards 100.0% cards/card_tricks.go:10: GetItem 100.0% cards/card_tricks.go:24: SetItem 100.0% @@ -92,13 +715,40 @@ cards/card_tricks.go:35: PrependItems 100.0% cards/card_tricks.go:47: RemoveItem 100.0% total: (statements) 100.0% -real 0m0.095s -user 0m0.044s -sys 0m0.108s +real 0m0.032s +user 0m0.015s +sys 0m0.035s -=============================================================================== -go test -v -race -covermode=atomic cards + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.022s +user 0m0.009s +sys 0m0.017s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.009s +user 0m0.004s +sys 0m0.012s + +real 0m0.009s +user 0m0.004s +sys 0m0.012s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestFavoriteCards --- PASS: TestFavoriteCards (0.00s) === RUN TestGetItem @@ -107,7 +757,7 @@ go test -v -race -covermode=atomic cards === RUN TestGetItem/Get_last_item_from_slice === RUN TestGetItem/Index_out_of_bounds === RUN TestGetItem/Negative_index ---- PASS: TestGetItem (0.02s) +--- PASS: TestGetItem (0.00s) --- PASS: TestGetItem/Retrieve_item_from_slice_by_index (0.00s) --- PASS: TestGetItem/Get_first_item_from_slice (0.00s) --- PASS: TestGetItem/Get_last_item_from_slice (0.00s) @@ -131,7 +781,7 @@ go test -v -race -covermode=atomic cards === RUN TestPrependItems/prepend_nil === RUN TestPrependItems/prepend_zero_items === RUN TestPrependItems/Prepend_slice_to_itself ---- PASS: TestPrependItems (0.01s) +--- PASS: TestPrependItems (0.00s) --- PASS: TestPrependItems/Prepend_one_item (0.00s) --- PASS: TestPrependItems/Prepend_two_items (0.00s) --- PASS: TestPrependItems/prepend_nil (0.00s) @@ -161,78 +811,116 @@ go test -v -race -covermode=atomic cards --- PASS: ExampleRemoveItem (0.00s) PASS coverage: 100.0% of statements -ok cards 0.077s coverage: 100.0% of statements +ok cards 1.020s coverage: 100.0% of statements -real 0m0.804s -user 0m0.852s -sys 0m0.519s +real 0m1.294s +user 0m0.312s +sys 0m0.173s -=============================================================================== -go test --bench . --benchmem -PASS -ok cards 0.014s + ============================================================================== -real 0m0.794s -user 0m0.979s -sys 0m0.616s +Exit code: 0 -=============================================================================== +real 0m1.587s +user 0m0.606s +sys 0m0.440s -go test -tags bonus -PASS -ok cards 0.008s - -real 0m0.626s -user 0m0.746s -sys 0m0.535s +real 0m1.590s +user 0m0.608s +sys 0m0.441s =============================================================================== -go vet cards +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok cards 0.002s -real 0m0.367s -user 0m0.479s -sys 0m0.385s +real 0m0.154s +user 0m0.228s +sys 0m0.165s =============================================================================== -go fix cards +gotest -v -tags bonus +=== RUN TestFavoriteCards +--- PASS: TestFavoriteCards (0.00s) +=== RUN TestGetItem +=== RUN TestGetItem/Retrieve_item_from_slice_by_index +=== RUN TestGetItem/Get_first_item_from_slice +=== RUN TestGetItem/Get_last_item_from_slice +=== RUN TestGetItem/Index_out_of_bounds +=== RUN TestGetItem/Negative_index +--- PASS: TestGetItem (0.00s) + --- PASS: TestGetItem/Retrieve_item_from_slice_by_index (0.00s) + --- PASS: TestGetItem/Get_first_item_from_slice (0.00s) + --- PASS: TestGetItem/Get_last_item_from_slice (0.00s) + --- PASS: TestGetItem/Index_out_of_bounds (0.00s) + --- PASS: TestGetItem/Negative_index (0.00s) +=== RUN TestSetItem +=== RUN TestSetItem/Overwrite_an_existing_item +=== RUN TestSetItem/Overwrite_first_item +=== RUN TestSetItem/Overwrite_last_item +=== RUN TestSetItem/Index_out_of_bounds +=== RUN TestSetItem/Negative_index +--- PASS: TestSetItem (0.00s) + --- PASS: TestSetItem/Overwrite_an_existing_item (0.00s) + --- PASS: TestSetItem/Overwrite_first_item (0.00s) + --- PASS: TestSetItem/Overwrite_last_item (0.00s) + --- PASS: TestSetItem/Index_out_of_bounds (0.00s) + --- PASS: TestSetItem/Negative_index (0.00s) +=== RUN TestPrependItems +=== RUN TestPrependItems/Prepend_one_item +=== RUN TestPrependItems/Prepend_two_items +=== RUN TestPrependItems/prepend_nil +=== RUN TestPrependItems/prepend_zero_items +=== RUN TestPrependItems/Prepend_slice_to_itself +--- PASS: TestPrependItems (0.00s) + --- PASS: TestPrependItems/Prepend_one_item (0.00s) + --- PASS: TestPrependItems/Prepend_two_items (0.00s) + --- PASS: TestPrependItems/prepend_nil (0.00s) + --- PASS: TestPrependItems/prepend_zero_items (0.00s) + --- PASS: TestPrependItems/Prepend_slice_to_itself (0.00s) +=== RUN TestRemoveItem +=== RUN TestRemoveItem/Remove_an_item +=== RUN TestRemoveItem/Remove_the_first_item +=== RUN TestRemoveItem/Remove_the_last_item +=== RUN TestRemoveItem/Remove_out_of_bounds_index +=== RUN TestRemoveItem/Remove_negative_index +--- PASS: TestRemoveItem (0.00s) + --- PASS: TestRemoveItem/Remove_an_item (0.00s) + --- PASS: TestRemoveItem/Remove_the_first_item (0.00s) + --- PASS: TestRemoveItem/Remove_the_last_item (0.00s) + --- PASS: TestRemoveItem/Remove_out_of_bounds_index (0.00s) + --- PASS: TestRemoveItem/Remove_negative_index (0.00s) +=== RUN ExampleFavoriteCards +--- PASS: ExampleFavoriteCards (0.00s) +=== RUN ExampleGetItem +--- PASS: ExampleGetItem (0.00s) +=== RUN ExampleSetItem +--- PASS: ExampleSetItem (0.00s) +=== RUN ExamplePrependItems +--- PASS: ExamplePrependItems (0.00s) +=== RUN ExampleRemoveItem +--- PASS: ExampleRemoveItem (0.00s) +PASS +ok cards 0.002s -real 0m0.045s -user 0m0.026s -sys 0m0.033s +real 0m0.130s +user 0m0.163s +sys 0m0.128s =============================================================================== -gosec ./card-tricks -[gosec] 2022/06/20 23:44:56 Including rules: default -[gosec] 2022/06/20 23:44:56 Excluding rules: default -[gosec] 2022/06/20 23:44:56 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/card-tricks -[gosec] 2022/06/20 23:44:57 Checking package: cards -[gosec] 2022/06/20 23:44:57 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/card-tricks/card_tricks.go -Results: - - -Summary: - Gosec : dev - Files : 1 - Lines : 57 - Nosec : 0 - Issues : 0 - - -real 0m0.265s -user 0m0.257s -sys 0m0.182s +No old benchmarks to run benchstat against. =============================================================================== gomarkdoc --output cards-doc.md -real 0m0.017s -user 0m0.010s -sys 0m0.022s +real 0m0.012s +user 0m0.006s +sys 0m0.006s =============================================================================== @@ -260,9 +948,9 @@ func SetItem(slice []int, index, value int) []int value. If the index is out of range the value needs to be appended. -real 0m0.132s -user 0m0.074s -sys 0m0.125s +real 0m0.026s +user 0m0.010s +sys 0m0.021s =============================================================================== diff --git a/go/cars-assemble/benchstat-new.txt b/go/cars-assemble/benchstat-new.txt new file mode 100644 index 00000000..89857811 --- /dev/null +++ b/go/cars-assemble/benchstat-new.txt @@ -0,0 +1,2 @@ +PASS +ok cars 0.002s diff --git a/go/cars-assemble/coverage-annotations.txt b/go/cars-assemble/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/cars-assemble/coverage.html b/go/cars-assemble/coverage.html new file mode 100644 index 00000000..95b3fef8 --- /dev/null +++ b/go/cars-assemble/coverage.html @@ -0,0 +1,136 @@ + + + + + + cars: Go Coverage Report + + + +
+ +
+ not tracked + + no coverage + low coverage + * + * + * + * + * + * + * + * + high coverage + +
+
+
+ + + +
+ + + diff --git a/go/cars-assemble/run-tests-go.txt b/go/cars-assemble/run-tests-go.txt index 1af8ad5d..081194e8 100644 --- a/go/cars-assemble/run-tests-go.txt +++ b/go/cars-assemble/run-tests-go.txt @@ -5,15 +5,603 @@ Go packages: cars =============================================================================== -golint cars +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.012s +sys 0m0.013s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +cars_assemble_test.go:126: Function 'TestCalculateCost' is too long (70 > 60) (funlen) +func TestCalculateCost(t *testing.T) { +cars_assemble.go:4:44: Comment should end in a period (godot) +// produced by the assembly line every hour + ^ +cars_assemble.go:10:46: Comment should end in a period (godot) +// produced by the assembly line every minute + ^ +cars_assemble.go:15:74: Comment should end in a period (godot) +// CalculateCost works out the cost of producing the given number of cars + ^ +cars_assemble_test.go:57:39: Using the variable on range scope `tt` in function literal (scopelint) + got := CalculateWorkingCarsPerHour(tt.productionRate, tt.successRate) + ^ +cars_assemble_test.go:58:33: Using the variable on range scope `tt` in function literal (scopelint) + if !floatingPointEquals(got, tt.want) { + ^ +cars_assemble_test.go:61:6: Using the variable on range scope `tt` in function literal (scopelint) + tt.productionRate, + ^ +cars_assemble.go:18:2: declarations should never be cuddled (wsl) + var individualCars int + ^ +cars_assemble_test.go:13:2: return statements should not be cuddled if block has more than two lines (wsl) + return absoluteDifferenceBelowThreshold || relativeDifferenceBelowThreshold + ^ +cars_assemble.go:12:63: mnd: Magic number: 60.0, in detected (gomnd) + return int(float64(productionRate) * (successRate / 100.0) / 60.0) + ^ +cars_assemble.go:6:50: mnd: Magic number: 100.0, in detected (gomnd) + return float64(productionRate) * (successRate / 100.0) + ^ +cars_assemble.go:20:28: mnd: Magic number: 10, in detected (gomnd) + groupsOfTen = carsCount / 10 + ^ +cars_assemble.go:21:31: mnd: Magic number: 10, in detected (gomnd) + individualCars = carsCount % 10 + ^ +cars_assemble_test.go:16:1: Function TestCalculateWorkingCarsPerHour missing the call to method parallel (paralleltest) +func TestCalculateWorkingCarsPerHour(t *testing.T) { +^ +cars_assemble_test.go:55:2: Range statement for test TestCalculateWorkingCarsPerHour missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +cars_assemble_test.go:71:1: Function TestCalculateWorkingCarsPerMinute missing the call to method parallel (paralleltest) +func TestCalculateWorkingCarsPerMinute(t *testing.T) { +^ +cars_assemble_test.go:110:2: Range statement for test TestCalculateWorkingCarsPerMinute missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +cars_assemble_test.go:184:2: Range statement for test TestCalculateCost missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +cars_assemble_examples_test.go:1:9: package should be `cars_test` instead of `cars` (testpackage) +package cars + ^ +cars_assemble_test.go:1:9: package should be `cars_test` instead of `cars` (testpackage) +package cars + ^ + +real 0m0.462s +user 0m0.650s +sys 0m0.390s + + + ============================================================================== + +Exit code: -1 + +real 0m0.500s +user 0m0.671s +sys 0m0.422s + +real 0m0.503s +user 0m0.671s +sys 0m0.425s -real 0m0.077s -user 0m0.045s -sys 0m0.080s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.005s +sys 0m0.008s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +cars_assemble.go + (1, 1) https://revive.run/r#package-comments should have a package comment + + + ✖ 1 problem (0 errors) (1 warnings) + +real 0m0.045s +user 0m0.027s +sys 0m0.030s + + + ============================================================================== + +Exit code: 0 + +real 0m0.068s +user 0m0.038s +sys 0m0.047s + +real 0m0.070s +user 0m0.040s +sys 0m0.048s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.006s +sys 0m0.007s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "cars [cars.test]" + +real 0m0.101s +user 0m0.124s +sys 0m0.107s + + + ============================================================================== + +Exit code: -1 + +real 0m0.124s +user 0m0.134s +sys 0m0.127s + +real 0m0.126s +user 0m0.135s +sys 0m0.128s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.006s +sys 0m0.008s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +cars_assemble.go:1:1: at least one file in a package should have a package comment (ST1000) + +real 0m0.162s +user 0m0.196s +sys 0m0.126s + + + ============================================================================== + +Exit code: -1 + +real 0m0.184s +user 0m0.211s +sys 0m0.140s + +real 0m0.186s +user 0m0.211s +sys 0m0.142s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.010s +sys 0m0.008s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.779s +user 0m1.851s +sys 0m0.248s + + + ============================================================================== + +Exit code: 0 + +real 0m0.804s +user 0m1.864s +sys 0m0.268s + +real 0m0.806s +user 0m1.866s +sys 0m0.268s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.008s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.078s +user 0m0.109s +sys 0m0.106s + + + ============================================================================== + +Exit code: 0 + +real 0m0.100s +user 0m0.122s +sys 0m0.121s + +real 0m0.102s +user 0m0.122s +sys 0m0.123s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.004s +sys 0m0.013s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.016s +user 0m0.008s +sys 0m0.011s + + + ============================================================================== + +Exit code: 0 + +real 0m0.041s +user 0m0.018s +sys 0m0.034s + +real 0m0.043s +user 0m0.018s +sys 0m0.036s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.006s +sys 0m0.015s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.477s +user 0m1.497s +sys 0m0.275s + + + ============================================================================== + +Exit code: 0 + +real 0m0.506s +user 0m1.509s +sys 0m0.300s + +real 0m0.508s +user 0m1.510s +sys 0m0.301s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.009s + + + ============================================================================== + +Running: gocyclo . + +3 cars TestCalculateCost cars_assemble_test.go:126:1 +3 cars TestCalculateWorkingCarsPerMinute cars_assemble_test.go:71:1 +3 cars TestCalculateWorkingCarsPerHour cars_assemble_test.go:16:1 +2 cars floatingPointEquals cars_assemble_test.go:10:1 +1 cars ExampleCalculateCost cars_assemble_examples_test.go:19:1 +1 cars ExampleCalculateWorkingCarsPerMinute cars_assemble_examples_test.go:13:1 +1 cars ExampleCalculateWorkingCarsPerHour cars_assemble_examples_test.go:7:1 +1 cars CalculateCost cars_assemble.go:16:1 +1 cars CalculateWorkingCarsPerMinute cars_assemble.go:11:1 +1 cars CalculateWorkingCarsPerHour cars_assemble.go:5:1 + +real 0m0.003s +user 0m0.003s +sys 0m0.000s + + + ============================================================================== + +Exit code: 0 + +real 0m0.024s +user 0m0.013s +sys 0m0.017s + +real 0m0.025s +user 0m0.014s +sys 0m0.019s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out cars +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.043s +user 0m0.068s +sys 0m0.018s + + + ============================================================================== + +Exit code: 0 + +real 0m0.063s +user 0m0.075s +sys 0m0.034s + +real 0m0.065s +user 0m0.076s +sys 0m0.036s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.008s +sys 0m0.016s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:21:27 Including rules: default +[gosec] 2023/09/07 00:21:27 Excluding rules: default +[gosec] 2023/09/07 00:21:27 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/cars-assemble +[gosec] 2023/09/07 00:21:27 Checking package: cars +[gosec] 2023/09/07 00:21:27 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/cars-assemble/cars_assemble.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 24 + Nosec : 0 + Issues : 0 + + +real 0m0.080s +user 0m0.068s +sys 0m0.044s + + + ============================================================================== + +Exit code: 0 + +real 0m0.114s +user 0m0.087s +sys 0m0.071s + +real 0m0.117s +user 0m0.090s +sys 0m0.072s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.005s +sys 0m0.009s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestCalculateWorkingCarsPerHour === RUN TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_production_rate_0 === RUN TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_100%_success_rate @@ -68,34 +656,63 @@ go test -v -covermode=count -coverprofile coverage.out cars --- PASS: ExampleCalculateCost (0.00s) PASS coverage: 100.0% of statements -ok cars 0.022s coverage: 100.0% of statements +ok cars 0.005s coverage: 100.0% of statements -real 0m0.691s -user 0m0.747s -sys 0m0.527s +real 0m0.192s +user 0m0.259s +sys 0m0.206s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + cars/cars_assemble.go:5: CalculateWorkingCarsPerHour 100.0% cars/cars_assemble.go:11: CalculateWorkingCarsPerMinute 100.0% cars/cars_assemble.go:16: CalculateCost 100.0% total: (statements) 100.0% -real 0m0.100s -user 0m0.062s -sys 0m0.069s +real 0m0.023s +user 0m0.011s +sys 0m0.018s -=============================================================================== -go test -v -race -covermode=atomic cars + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.022s +user 0m0.009s +sys 0m0.019s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.009s +user 0m0.005s +sys 0m0.009s + +real 0m0.009s +user 0m0.005s +sys 0m0.009s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestCalculateWorkingCarsPerHour === RUN TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_production_rate_0 === RUN TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_100%_success_rate === RUN TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_80%_success_rate === RUN TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_20.5%_success_rate === RUN TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_0%_success_rate ---- PASS: TestCalculateWorkingCarsPerHour (0.01s) +--- PASS: TestCalculateWorkingCarsPerHour (0.00s) --- PASS: TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_production_rate_0 (0.00s) --- PASS: TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_100%_success_rate (0.00s) --- PASS: TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_80%_success_rate (0.00s) @@ -143,78 +760,108 @@ go test -v -race -covermode=atomic cars --- PASS: ExampleCalculateCost (0.00s) PASS coverage: 100.0% of statements -ok cars 0.051s coverage: 100.0% of statements +ok cars 1.034s coverage: 100.0% of statements -real 0m0.823s -user 0m0.889s -sys 0m0.594s +real 0m1.271s +user 0m0.317s +sys 0m0.169s -=============================================================================== -go test --bench . --benchmem -PASS -ok cars 0.016s + ============================================================================== -real 0m0.725s -user 0m0.770s -sys 0m0.615s +Exit code: 0 -=============================================================================== +real 0m1.540s +user 0m0.612s +sys 0m0.439s -go test -tags bonus -PASS -ok cars 0.010s - -real 0m0.573s -user 0m0.681s -sys 0m0.450s +real 0m1.542s +user 0m0.613s +sys 0m0.440s =============================================================================== -go vet cars +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok cars 0.002s -real 0m0.392s -user 0m0.427s -sys 0m0.352s +real 0m0.141s +user 0m0.183s +sys 0m0.137s =============================================================================== -go fix cars +gotest -v -tags bonus +=== RUN TestCalculateWorkingCarsPerHour +=== RUN TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_production_rate_0 +=== RUN TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_100%_success_rate +=== RUN TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_80%_success_rate +=== RUN TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_20.5%_success_rate +=== RUN TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_0%_success_rate +--- PASS: TestCalculateWorkingCarsPerHour (0.00s) + --- PASS: TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_production_rate_0 (0.00s) + --- PASS: TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_100%_success_rate (0.00s) + --- PASS: TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_80%_success_rate (0.00s) + --- PASS: TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_20.5%_success_rate (0.00s) + --- PASS: TestCalculateWorkingCarsPerHour/calculate_working_cars_per_hour_for_0%_success_rate (0.00s) +=== RUN TestCalculateWorkingCarsPerMinute +=== RUN TestCalculateWorkingCarsPerMinute/calculate_working_cars_per_minute_for_production_rate_0 +=== RUN TestCalculateWorkingCarsPerMinute/calculate_working_cars_per_minute_for_100%_success_rate +=== RUN TestCalculateWorkingCarsPerMinute/calculate_working_cars_per_minute_for_80%_success_rate +=== RUN TestCalculateWorkingCarsPerMinute/calculate_working_cars_per_minute_for_20.5%_success_rate +=== RUN TestCalculateWorkingCarsPerMinute/calculate_working_cars_per_minute_for_0%_success_rate +--- PASS: TestCalculateWorkingCarsPerMinute (0.00s) + --- PASS: TestCalculateWorkingCarsPerMinute/calculate_working_cars_per_minute_for_production_rate_0 (0.00s) + --- PASS: TestCalculateWorkingCarsPerMinute/calculate_working_cars_per_minute_for_100%_success_rate (0.00s) + --- PASS: TestCalculateWorkingCarsPerMinute/calculate_working_cars_per_minute_for_80%_success_rate (0.00s) + --- PASS: TestCalculateWorkingCarsPerMinute/calculate_working_cars_per_minute_for_20.5%_success_rate (0.00s) + --- PASS: TestCalculateWorkingCarsPerMinute/calculate_working_cars_per_minute_for_0%_success_rate (0.00s) +=== RUN TestCalculateCost +=== RUN TestCalculateCost/calculate_cost_to_produce_0_cars +=== RUN TestCalculateCost/calculate_the_cost_of_materials_to_produce_1_car +=== RUN TestCalculateCost/calculate_cost_to_produce_2_cars +=== RUN TestCalculateCost/calculate_cost_to_produce_9_cars +=== RUN TestCalculateCost/calculate_cost_to_produce_10_cars +=== RUN TestCalculateCost/calculate_cost_to_produce_100_cars +=== RUN TestCalculateCost/calculate_cost_to_produce_21_cars +=== RUN TestCalculateCost/calculate_cost_to_produce_37_cars +=== RUN TestCalculateCost/calculate_cost_to_produce_56_cars +=== RUN TestCalculateCost/calculate_cost_to_produce_148_cars +--- PASS: TestCalculateCost (0.00s) + --- PASS: TestCalculateCost/calculate_cost_to_produce_0_cars (0.00s) + --- PASS: TestCalculateCost/calculate_the_cost_of_materials_to_produce_1_car (0.00s) + --- PASS: TestCalculateCost/calculate_cost_to_produce_2_cars (0.00s) + --- PASS: TestCalculateCost/calculate_cost_to_produce_9_cars (0.00s) + --- PASS: TestCalculateCost/calculate_cost_to_produce_10_cars (0.00s) + --- PASS: TestCalculateCost/calculate_cost_to_produce_100_cars (0.00s) + --- PASS: TestCalculateCost/calculate_cost_to_produce_21_cars (0.00s) + --- PASS: TestCalculateCost/calculate_cost_to_produce_37_cars (0.00s) + --- PASS: TestCalculateCost/calculate_cost_to_produce_56_cars (0.00s) + --- PASS: TestCalculateCost/calculate_cost_to_produce_148_cars (0.00s) +=== RUN ExampleCalculateWorkingCarsPerHour +--- PASS: ExampleCalculateWorkingCarsPerHour (0.00s) +=== RUN ExampleCalculateWorkingCarsPerMinute +--- PASS: ExampleCalculateWorkingCarsPerMinute (0.00s) +=== RUN ExampleCalculateCost +--- PASS: ExampleCalculateCost (0.00s) +PASS +ok cars 0.002s -real 0m0.054s -user 0m0.031s -sys 0m0.058s +real 0m0.144s +user 0m0.208s +sys 0m0.147s =============================================================================== -gosec ./cars-assemble -[gosec] 2022/06/20 23:18:18 Including rules: default -[gosec] 2022/06/20 23:18:18 Excluding rules: default -[gosec] 2022/06/20 23:18:18 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/cars-assemble -[gosec] 2022/06/20 23:18:19 Checking package: cars -[gosec] 2022/06/20 23:18:19 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/cars-assemble/cars_assemble.go -Results: - - -Summary: - Gosec : dev - Files : 1 - Lines : 24 - Nosec : 0 - Issues : 0 - - -real 0m0.283s -user 0m0.252s -sys 0m0.216s +No old benchmarks to run benchstat against. =============================================================================== gomarkdoc --output cars-doc.md -real 0m0.067s -user 0m0.041s -sys 0m0.044s +real 0m0.019s +user 0m0.011s +sys 0m0.008s =============================================================================== @@ -236,9 +883,9 @@ func CalculateWorkingCarsPerMinute(productionRate int, successRate float64) int by the assembly line every minute -real 0m0.161s -user 0m0.082s -sys 0m0.135s +real 0m0.031s +user 0m0.013s +sys 0m0.026s =============================================================================== diff --git a/go/census/benchstat-old.txt b/go/census/benchstat-old.txt index 08e5fddd..2ede99d9 100644 --- a/go/census/benchstat-old.txt +++ b/go/census/benchstat-old.txt @@ -1,2 +1,2 @@ PASS -ok census 0.033s +ok census 0.002s diff --git a/go/census/run-tests-go.txt b/go/census/run-tests-go.txt index 2bf96285..9c5223dc 100644 --- a/go/census/run-tests-go.txt +++ b/go/census/run-tests-go.txt @@ -5,17 +5,39 @@ Go packages: census =============================================================================== -golangci-lint run --enable-all ./... -level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." -level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." -level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.005s +sys 0m0.010s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." -level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." -level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " census_test.go:43: Function 'TestHasRequiredInfo' is too long (92 > 60) (funlen) func TestHasRequiredInfo(t *testing.T) { census_test.go:185: Function 'TestCount' is too long (72 > 60) (funlen) @@ -99,97 +121,367 @@ census_test.go:2:9: package should be `census_test` instead of `census` (testpac package census ^ -real 0m1.544s -user 0m3.426s -sys 0m0.560s +real 0m0.346s +user 0m0.383s +sys 0m0.300s -=============================================================================== -golint ./... + ============================================================================== -real 0m0.027s -user 0m0.003s -sys 0m0.006s +Exit code: -1 + +real 0m0.367s +user 0m0.394s +sys 0m0.319s + +real 0m0.369s +user 0m0.396s +sys 0m0.319s =============================================================================== -revive -formatter=stylish ./... +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.008s +sys 0m0.015s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + census.go (24, 13) https://revive.run/r#var-declaration should omit type bool from declaration of var result; it will be inferred from the right-hand side ✖ 1 problem (0 errors) (1 warnings) +real 0m0.065s +user 0m0.035s +sys 0m0.050s + + + ============================================================================== + +Exit code: 0 + real 0m0.099s -user 0m0.037s -sys 0m0.053s +user 0m0.050s +sys 0m0.080s + +real 0m0.100s +user 0m0.050s +sys 0m0.081s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.109s -user 0m0.140s -sys 0m0.104s +real 0m0.001s +user 0m0.001s +sys 0m0.000s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.010s +sys 0m0.022s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." internal error: package "fmt" without types was imported from "census [census.test]" -real 0m0.108s -user 0m0.153s -sys 0m0.130s +real 0m0.107s +user 0m0.184s +sys 0m0.159s -=============================================================================== -staticcheck ./... + ============================================================================== + +Exit code: -1 -real 0m1.273s -user 0m3.803s -sys 0m0.380s +real 0m0.151s +user 0m0.204s +sys 0m0.198s + +real 0m0.154s +user 0m0.205s +sys 0m0.200s =============================================================================== -gocritic check -enableAll ./... -panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt +Running: ../../.github/citools/go/go-lint-staticcheck -goroutine 1 [running]: -main.main() - /home/vpayno/go/pkg/mod/github.com/go-critic/go-critic@v0.6.7/cmd/gocritic/main.go:13 +0x52 +Running Go StaticCheck -real 0m0.064s -user 0m0.017s -sys 0m0.036s +Go version: -=============================================================================== + go version go1.21.0 linux/amd64 -go vet ./... -real 0m0.102s -user 0m0.150s -sys 0m0.143s + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.006s +sys 0m0.011s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +census.go:24:13: should omit type bool from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.141s +user 0m0.168s +sys 0m0.112s + + + ============================================================================== + +Exit code: -1 + +real 0m0.166s +user 0m0.181s +sys 0m0.131s + +real 0m0.168s +user 0m0.181s +sys 0m0.134s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + real 0m0.015s user 0m0.004s sys 0m0.014s + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./census.go:26:2: commentedOutCode: may want to remove commented-out code + +real 0m0.815s +user 0m2.004s +sys 0m0.287s + + + ============================================================================== + +Exit code: -1 + +real 0m0.843s +user 0m2.013s +sys 0m0.312s + +real 0m0.845s +user 0m2.013s +sys 0m0.314s + =============================================================================== -errcheck ./... +Running: ../../.github/citools/go/go-lint-go_vet -real 0m0.470s -user 0m1.235s -sys 0m0.267s +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.007s +sys 0m0.008s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.078s +user 0m0.109s +sys 0m0.083s + + + ============================================================================== + +Exit code: 0 + +real 0m0.103s +user 0m0.121s +sys 0m0.102s + +real 0m0.105s +user 0m0.122s +sys 0m0.103s =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.007s +sys 0m0.011s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.027s +user 0m0.015s +sys 0m0.019s + + + ============================================================================== + +Exit code: 0 + +real 0m0.053s +user 0m0.025s +sys 0m0.042s + +real 0m0.055s +user 0m0.026s +sys 0m0.043s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.010s +sys 0m0.020s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.460s +user 0m1.382s +sys 0m0.310s + + + ============================================================================== + +Exit code: 0 + +real 0m0.503s +user 0m1.402s +sys 0m0.347s + +real 0m0.506s +user 0m1.403s +sys 0m0.348s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.008s +sys 0m0.016s + + + ============================================================================== + +Running: gocyclo . + 5 census TestDelete census_test.go:139:1 4 census (*Resident).HasRequiredInfo census.go:23:1 3 census TestCount census_test.go:185:1 @@ -203,26 +495,86 @@ gocyclo . 1 census (*Resident).Delete census.go:40:1 1 census NewResident census.go:12:1 -real 0m0.022s +real 0m0.002s user 0m0.001s -sys 0m0.005s +sys 0m0.001s -=============================================================================== -misspell . + ============================================================================== + +Exit code: 0 real 0m0.033s -user 0m0.027s -sys 0m0.019s +user 0m0.015s +sys 0m0.027s + +real 0m0.035s +user 0m0.015s +sys 0m0.028s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.023s +user 0m0.028s +sys 0m0.011s + + + ============================================================================== + +Exit code: 0 + +real 0m0.037s +user 0m0.031s +sys 0m0.025s + +real 0m0.039s +user 0m0.031s +sys 0m0.028s =============================================================================== -gosec ./... -[gosec] 2023/09/03 17:20:25 Including rules: default -[gosec] 2023/09/03 17:20:25 Excluding rules: default -[gosec] 2023/09/03 17:20:25 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/census -[gosec] 2023/09/03 17:20:25 Checking package: census -[gosec] 2023/09/03 17:20:25 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/census/census.go +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.004s +sys 0m0.011s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:21:32 Including rules: default +[gosec] 2023/09/07 00:21:32 Excluding rules: default +[gosec] 2023/09/07 00:21:32 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/census +[gosec] 2023/09/07 00:21:32 Checking package: census +[gosec] 2023/09/07 00:21:32 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/census/census.go Results: @@ -234,13 +586,48 @@ Results: Issues : 0 -real 0m0.085s -user 0m0.066s -sys 0m0.039s +real 0m0.070s +user 0m0.070s +sys 0m0.035s + + + ============================================================================== + +Exit code: 0 + +real 0m0.094s +user 0m0.077s +sys 0m0.058s + +real 0m0.096s +user 0m0.078s +sys 0m0.059s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.009s +sys 0m0.012s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestNewResident === RUN TestNewResident/no_data_collected === RUN TestNewResident/all_data_collected @@ -293,42 +680,55 @@ PASS coverage: 100.0% of statements ok census 0.002s coverage: 100.0% of statements -real 0m0.276s -user 0m0.676s -sys 0m0.279s +real 0m0.161s +user 0m0.233s +sys 0m0.165s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + census/census.go:12: NewResident 100.0% census/census.go:23: HasRequiredInfo 100.0% census/census.go:40: Delete 100.0% census/census.go:47: Count 100.0% total: (statements) 100.0% -real 0m0.019s -user 0m0.008s -sys 0m0.016s +real 0m0.024s +user 0m0.005s +sys 0m0.025s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.022s -user 0m0.012s -sys 0m0.015s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +real 0m0.024s +user 0m0.011s +sys 0m0.019s + -real 0m0.069s -user 0m0.006s -sys 0m0.023s + ============================================================================== -=============================================================================== +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.011s +user 0m0.005s +sys 0m0.011s + +real 0m0.011s +user 0m0.005s +sys 0m0.011s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestNewResident === RUN TestNewResident/no_data_collected === RUN TestNewResident/all_data_collected @@ -379,11 +779,24 @@ gotest -v -race -covermode=atomic ./... --- PASS: ExampleCount (0.00s) PASS coverage: 100.0% of statements -ok census 1.015s coverage: 100.0% of statements +ok census (cached) coverage: 100.0% of statements + +real 0m0.089s +user 0m0.160s +sys 0m0.113s + -real 0m6.179s -user 0m13.133s -sys 0m1.732s + ============================================================================== + +Exit code: 0 + +real 0m0.340s +user 0m0.434s +sys 0m0.354s + +real 0m0.341s +user 0m0.434s +sys 0m0.356s =============================================================================== @@ -394,9 +807,9 @@ gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt PASS ok census 0.002s -real 0m0.134s -user 0m0.192s -sys 0m0.138s +real 0m0.154s +user 0m0.215s +sys 0m0.159s =============================================================================== @@ -450,17 +863,17 @@ gotest -v -tags bonus === RUN ExampleCount --- PASS: ExampleCount (0.00s) PASS -ok census 0.002s +ok census 0.003s -real 0m0.113s -user 0m0.159s +real 0m0.124s +user 0m0.184s sys 0m0.117s =============================================================================== benchstat benchstat-old.txt benchstat-new.txt -real 0m0.018s +real 0m0.002s user 0m0.000s sys 0m0.002s @@ -468,8 +881,8 @@ sys 0m0.002s gomarkdoc --output census-doc.md -real 0m0.042s -user 0m0.011s +real 0m0.025s +user 0m0.017s sys 0m0.009s =============================================================================== @@ -505,9 +918,9 @@ func (r *Resident) HasRequiredInfo() bool information. -real 0m0.033s -user 0m0.018s -sys 0m0.024s +real 0m0.037s +user 0m0.014s +sys 0m0.032s =============================================================================== diff --git a/go/chessboard/benchstat-new.txt b/go/chessboard/benchstat-new.txt index 8d76e2ed..aef89f88 100644 --- a/go/chessboard/benchstat-new.txt +++ b/go/chessboard/benchstat-new.txt @@ -1,2 +1,2 @@ PASS -ok chessboard 0.013s +ok chessboard 0.002s diff --git a/go/chessboard/benchstat-old.txt b/go/chessboard/benchstat-old.txt index e7fead3a..8d76e2ed 100644 --- a/go/chessboard/benchstat-old.txt +++ b/go/chessboard/benchstat-old.txt @@ -1,2 +1,2 @@ PASS -ok chessboard 0.012s +ok chessboard 0.013s diff --git a/go/chessboard/coverage.out b/go/chessboard/coverage.out index 683f916d..2b3961f9 100644 --- a/go/chessboard/coverage.out +++ b/go/chessboard/coverage.out @@ -1,18 +1,18 @@ mode: count chessboard/chessboard.go:12.50,15.33 2 10 -chessboard/chessboard.go:21.2,21.14 1 10 chessboard/chessboard.go:15.33,16.12 1 72 chessboard/chessboard.go:16.12,18.4 1 18 +chessboard/chessboard.go:21.2,21.14 1 10 chessboard/chessboard.go:26.47,29.22 2 13 -chessboard/chessboard.go:35.2,35.14 1 13 chessboard/chessboard.go:29.22,30.49 1 104 chessboard/chessboard.go:30.49,32.4 1 16 +chessboard/chessboard.go:35.2,35.14 1 13 chessboard/chessboard.go:39.34,42.22 2 2 -chessboard/chessboard.go:48.2,48.14 1 2 chessboard/chessboard.go:42.22,43.21 1 16 chessboard/chessboard.go:43.21,45.4 1 128 +chessboard/chessboard.go:48.2,48.14 1 2 chessboard/chessboard.go:52.39,55.22 2 2 -chessboard/chessboard.go:63.2,63.14 1 2 chessboard/chessboard.go:55.22,56.33 1 16 chessboard/chessboard.go:56.33,57.13 1 128 chessboard/chessboard.go:57.13,59.5 1 30 +chessboard/chessboard.go:63.2,63.14 1 2 diff --git a/go/chessboard/run-tests-go.txt b/go/chessboard/run-tests-go.txt index a11637c7..5110ca02 100644 --- a/go/chessboard/run-tests-go.txt +++ b/go/chessboard/run-tests-go.txt @@ -5,56 +5,601 @@ Go packages: chessboard =============================================================================== -golint ./... +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.194s -user 0m0.225s -sys 0m0.138s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.009s +sys 0m0.018s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +chessboard.go:4:82: Comment should end in a period (godot) +// File stores if a square is occupied by a piece - this will be a slice of bools + ^ +chessboard.go:7:80: Comment should end in a period (godot) +// Chessboard contains a map of eight Files, accessed with keys from "A" to "H" + ^ +chessboard.go:11:25: Comment should end in a period (godot) +// within the given rank + ^ +chessboard_test.go:52:30: Using the variable on range scope `test` in function literal (scopelint) + if got := CountInFile(cb, test.in); got != test.expected { + ^ +chessboard_test.go:53:60: Using the variable on range scope `test` in function literal (scopelint) + t.Errorf("CountInFile(chessboard, %q) = %d, want: %d", test.in, got, test.expected) + ^ +chessboard_test.go:81:30: Using the variable on range scope `test` in function literal (scopelint) + if got := CountInRank(cb, test.in); got != test.expected { + ^ +chessboard_test.go:50:2: only one cuddle assignment allowed before range statement (wsl) + for _, test := range testCases { + ^ +chessboard_test.go:79:2: only one cuddle assignment allowed before range statement (wsl) + for _, test := range testCases { + ^ +chessboard_test.go:91:2: only one cuddle assignment allowed before if statement (wsl) + if got := CountAll(cb); got != expected { + ^ +chessboard_test.go:99:2: only one cuddle assignment allowed before if statement (wsl) + if got := CountOccupied(cb); got != expected { + ^ +chessboard_test.go:90:2: variable 'expected' is only used in the if-statement (chessboard_test.go:91:2); consider using short syntax (ifshort) + expected := 64 + ^ +chessboard_test.go:98:2: variable 'expected' is only used in the if-statement (chessboard_test.go:99:2); consider using short syntax (ifshort) + expected := 15 + ^ +chessboard_test.go:34:1: Function TestCountInFile missing the call to method parallel (paralleltest) +func TestCountInFile(t *testing.T) { +^ +chessboard_test.go:59:1: Function TestCountInRank missing the call to method parallel (paralleltest) +func TestCountInRank(t *testing.T) { +^ +chessboard_test.go:88:1: Function TestCountAll missing the call to method parallel (paralleltest) +func TestCountAll(t *testing.T) { +^ +chessboard_test.go:96:1: Function TestCountOccupied missing the call to method parallel (paralleltest) +func TestCountOccupied(t *testing.T) { +^ +chessboard_examples_test.go:1:9: package should be `chessboard_test` instead of `chessboard` (testpackage) +package chessboard + ^ +chessboard_test.go:1:9: package should be `chessboard_test` instead of `chessboard` (testpackage) +package chessboard + ^ +chessboard_test.go:35:2: variable name 'cb' is too short for the scope of its usage (varnamelen) + cb := newChessboard() + ^ +chessboard_test.go:60:2: variable name 'cb' is too short for the scope of its usage (varnamelen) + cb := newChessboard() + ^ + +real 0m0.486s +user 0m0.845s +sys 0m0.429s + + + ============================================================================== + +Exit code: -1 + +real 0m0.525s +user 0m0.863s +sys 0m0.462s + +real 0m0.529s +user 0m0.866s +sys 0m0.464s =============================================================================== -revive ./... +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.004s +sys 0m0.011s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.043s +user 0m0.031s +sys 0m0.024s + -real 0m0.052s -user 0m0.014s -sys 0m0.035s + ============================================================================== + +Exit code: 0 + +real 0m0.075s +user 0m0.049s +sys 0m0.048s + +real 0m0.078s +user 0m0.050s +sys 0m0.050s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.310s -user 0m0.311s -sys 0m0.328s +real 0m0.001s +user 0m0.001s +sys 0m0.000s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.010s +sys 0m0.013s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." +internal error: package "fmt" without types was imported from "chessboard [chessboard.test]" + +real 0m0.096s +user 0m0.148s +sys 0m0.135s + -real 0m0.356s -user 0m0.382s -sys 0m0.345s + ============================================================================== + +Exit code: -1 + +real 0m0.128s +user 0m0.162s +sys 0m0.163s + +real 0m0.130s +user 0m0.163s +sys 0m0.164s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: -real 0m0.462s -user 0m0.402s -sys 0m0.514s + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.008s +sys 0m0.019s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.157s +user 0m0.188s +sys 0m0.103s + + + ============================================================================== + +Exit code: 0 + +real 0m0.189s +user 0m0.202s +sys 0m0.131s + +real 0m0.191s +user 0m0.204s +sys 0m0.131s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... -real 0m2.643s -user 0m4.263s -sys 0m1.302s + +real 0m0.021s +user 0m0.009s +sys 0m0.017s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.856s +user 0m1.930s +sys 0m0.323s + + + ============================================================================== + +Exit code: 0 + +real 0m0.894s +user 0m1.948s +sys 0m0.352s + +real 0m0.896s +user 0m1.949s +sys 0m0.353s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.004s +sys 0m0.010s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.085s +user 0m0.138s +sys 0m0.094s + + + ============================================================================== + +Exit code: 0 + +real 0m0.108s +user 0m0.145s +sys 0m0.117s + +real 0m0.110s +user 0m0.146s +sys 0m0.118s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.010s +user 0m0.006s +sys 0m0.006s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.017s +user 0m0.007s +sys 0m0.013s + + + ============================================================================== + +Exit code: 0 + +real 0m0.038s +user 0m0.016s +sys 0m0.032s + +real 0m0.039s +user 0m0.017s +sys 0m0.032s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.013s +sys 0m0.012s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.454s +user 0m1.301s +sys 0m0.295s + + + ============================================================================== + +Exit code: 0 + +real 0m0.487s +user 0m1.320s +sys 0m0.321s + +real 0m0.489s +user 0m1.320s +sys 0m0.323s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.002s +sys 0m0.013s + + + ============================================================================== + +Running: gocyclo . + +5 chessboard CountInRank chessboard.go:26:1 +4 chessboard CountOccupied chessboard.go:52:1 +3 chessboard TestCountInRank chessboard_test.go:59:1 +3 chessboard TestCountInFile chessboard_test.go:34:1 +3 chessboard CountAll chessboard.go:39:1 +3 chessboard CountInFile chessboard.go:12:1 +2 chessboard TestCountOccupied chessboard_test.go:96:1 +2 chessboard TestCountAll chessboard_test.go:88:1 +1 chessboard newChessboard chessboard_test.go:21:1 +1 chessboard ExampleCountOccupied chessboard_examples_test.go:28:1 +1 chessboard ExampleCountAll chessboard_examples_test.go:21:1 +1 chessboard ExampleCountInRank chessboard_examples_test.go:14:1 +1 chessboard ExampleCountInFile chessboard_examples_test.go:7:1 + +real 0m0.002s +user 0m0.002s +sys 0m0.000s + + + ============================================================================== + +Exit code: 0 + +real 0m0.036s +user 0m0.015s +sys 0m0.031s + +real 0m0.038s +user 0m0.017s +sys 0m0.031s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.027s +user 0m0.035s +sys 0m0.010s + + + ============================================================================== + +Exit code: 0 + +real 0m0.036s +user 0m0.041s +sys 0m0.018s + +real 0m0.038s +user 0m0.041s +sys 0m0.019s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.009s +sys 0m0.012s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:21:35 Including rules: default +[gosec] 2023/09/07 00:21:35 Excluding rules: default +[gosec] 2023/09/07 00:21:35 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/chessboard +[gosec] 2023/09/07 00:21:35 Checking package: chessboard +[gosec] 2023/09/07 00:21:35 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/chessboard/chessboard.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 64 + Nosec : 0 + Issues : 0 + + +real 0m0.092s +user 0m0.079s +sys 0m0.056s + + + ============================================================================== + +Exit code: 0 + +real 0m0.121s +user 0m0.092s +sys 0m0.080s + +real 0m0.123s +user 0m0.092s +sys 0m0.082s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.006s +sys 0m0.019s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestCountInFile === RUN TestCountInFile/Count_of_occupied_squares_in_file_A === RUN TestCountInFile/Count_of_occupied_squares_in_file_B @@ -115,44 +660,57 @@ gotest -v -covermode=count -coverprofile coverage.out ./... --- PASS: ExampleCountOccupied (0.00s) PASS coverage: 100.0% of statements -ok chessboard 0.030s coverage: 100.0% of statements +ok chessboard 0.003s coverage: 100.0% of statements -real 0m0.736s -user 0m0.754s -sys 0m0.581s +real 0m0.188s +user 0m0.250s +sys 0m0.168s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + chessboard/chessboard.go:12: CountInFile 100.0% chessboard/chessboard.go:26: CountInRank 100.0% chessboard/chessboard.go:39: CountAll 100.0% chessboard/chessboard.go:52: CountOccupied 100.0% total: (statements) 100.0% -real 0m0.145s -user 0m0.071s -sys 0m0.133s +real 0m0.024s +user 0m0.010s +sys 0m0.021s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.092s -user 0m0.042s -sys 0m0.088s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 -color - | tee coverage-annotations.txt +real 0m0.040s +user 0m0.020s +sys 0m0.031s -real 0m0.038s -user 0m0.016s -sys 0m0.048s -=============================================================================== + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.016s +user 0m0.005s +sys 0m0.016s + +real 0m0.016s +user 0m0.005s +sys 0m0.016s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestCountInFile === RUN TestCountInFile/Count_of_occupied_squares_in_file_A === RUN TestCountInFile/Count_of_occupied_squares_in_file_B @@ -213,117 +771,121 @@ gotest -v -race -covermode=atomic ./... --- PASS: ExampleCountOccupied (0.00s) PASS coverage: 100.0% of statements -ok chessboard 0.047s coverage: 100.0% of statements - -real 0m1.001s -user 0m0.884s -sys 0m0.595s - -=============================================================================== - -mv -v benchstat-new.txt benchstat-old.txt -renamed 'benchstat-new.txt' -> 'benchstat-old.txt' - -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -PASS -ok chessboard 0.013s +ok chessboard 1.022s coverage: 100.0% of statements -real 0m0.634s -user 0m0.740s -sys 0m0.475s +real 0m1.254s +user 0m0.256s +sys 0m0.196s -=============================================================================== - -go test -tags bonus -PASS -ok chessboard 0.011s - -real 0m0.495s -user 0m0.561s -sys 0m0.410s - -=============================================================================== - -benchstat benchstat-old.txt benchstat-new.txt -real 0m0.021s -user 0m0.009s -sys 0m0.014s + ============================================================================== -=============================================================================== +Exit code: 0 -go vet ./... +real 0m1.562s +user 0m0.555s +sys 0m0.470s -real 0m0.389s -user 0m0.366s -sys 0m0.370s +real 0m1.565s +user 0m0.558s +sys 0m0.470s =============================================================================== -go fix ./... +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -real 0m0.076s -user 0m0.038s -sys 0m0.060s +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok chessboard 0.002s -=============================================================================== - -gocyclo . -5 chessboard CountInRank chessboard.go:26:1 -4 chessboard CountOccupied chessboard.go:52:1 -3 chessboard TestCountInRank chessboard_test.go:59:1 -3 chessboard TestCountInFile chessboard_test.go:34:1 -3 chessboard CountAll chessboard.go:39:1 -3 chessboard CountInFile chessboard.go:12:1 -2 chessboard TestCountOccupied chessboard_test.go:96:1 -2 chessboard TestCountAll chessboard_test.go:88:1 -1 chessboard newChessboard chessboard_test.go:21:1 -1 chessboard ExampleCountOccupied chessboard_examples_test.go:28:1 -1 chessboard ExampleCountAll chessboard_examples_test.go:21:1 -1 chessboard ExampleCountInRank chessboard_examples_test.go:14:1 -1 chessboard ExampleCountInFile chessboard_examples_test.go:7:1 - -real 0m0.012s -user 0m0.008s -sys 0m0.003s +real 0m0.163s +user 0m0.211s +sys 0m0.146s =============================================================================== -misspell . +gotest -v -tags bonus +=== RUN TestCountInFile +=== RUN TestCountInFile/Count_of_occupied_squares_in_file_A +=== RUN TestCountInFile/Count_of_occupied_squares_in_file_B +=== RUN TestCountInFile/Count_of_occupied_squares_in_file_C +=== RUN TestCountInFile/Count_of_occupied_squares_in_file_D +=== RUN TestCountInFile/Count_of_occupied_squares_in_file_E +=== RUN TestCountInFile/Count_of_occupied_squares_in_file_F +=== RUN TestCountInFile/Count_of_occupied_squares_in_file_G +=== RUN TestCountInFile/Count_of_occupied_squares_in_file_H +=== RUN TestCountInFile/Count_of_occupied_squares_in_file_Z +--- PASS: TestCountInFile (0.00s) + --- PASS: TestCountInFile/Count_of_occupied_squares_in_file_A (0.00s) + --- PASS: TestCountInFile/Count_of_occupied_squares_in_file_B (0.00s) + --- PASS: TestCountInFile/Count_of_occupied_squares_in_file_C (0.00s) + --- PASS: TestCountInFile/Count_of_occupied_squares_in_file_D (0.00s) + --- PASS: TestCountInFile/Count_of_occupied_squares_in_file_E (0.00s) + --- PASS: TestCountInFile/Count_of_occupied_squares_in_file_F (0.00s) + --- PASS: TestCountInFile/Count_of_occupied_squares_in_file_G (0.00s) + --- PASS: TestCountInFile/Count_of_occupied_squares_in_file_H (0.00s) + --- PASS: TestCountInFile/Count_of_occupied_squares_in_file_Z (0.00s) +=== RUN TestCountInRank +=== RUN TestCountInRank/Count_of_occupied_squares_in_rank_1 +=== RUN TestCountInRank/Count_of_occupied_squares_in_rank_2 +=== RUN TestCountInRank/Count_of_occupied_squares_in_rank_3 +=== RUN TestCountInRank/Count_of_occupied_squares_in_rank_4 +=== RUN TestCountInRank/Count_of_occupied_squares_in_rank_5 +=== RUN TestCountInRank/Count_of_occupied_squares_in_rank_6 +=== RUN TestCountInRank/Count_of_occupied_squares_in_rank_7 +=== RUN TestCountInRank/Count_of_occupied_squares_in_rank_8 +=== RUN TestCountInRank/Count_of_occupied_squares_in_rank_100 +=== RUN TestCountInRank/Count_of_occupied_squares_in_rank_0 +=== RUN TestCountInRank/Count_of_occupied_squares_in_rank_-1 +=== RUN TestCountInRank/Count_of_occupied_squares_in_rank_-100 +--- PASS: TestCountInRank (0.00s) + --- PASS: TestCountInRank/Count_of_occupied_squares_in_rank_1 (0.00s) + --- PASS: TestCountInRank/Count_of_occupied_squares_in_rank_2 (0.00s) + --- PASS: TestCountInRank/Count_of_occupied_squares_in_rank_3 (0.00s) + --- PASS: TestCountInRank/Count_of_occupied_squares_in_rank_4 (0.00s) + --- PASS: TestCountInRank/Count_of_occupied_squares_in_rank_5 (0.00s) + --- PASS: TestCountInRank/Count_of_occupied_squares_in_rank_6 (0.00s) + --- PASS: TestCountInRank/Count_of_occupied_squares_in_rank_7 (0.00s) + --- PASS: TestCountInRank/Count_of_occupied_squares_in_rank_8 (0.00s) + --- PASS: TestCountInRank/Count_of_occupied_squares_in_rank_100 (0.00s) + --- PASS: TestCountInRank/Count_of_occupied_squares_in_rank_0 (0.00s) + --- PASS: TestCountInRank/Count_of_occupied_squares_in_rank_-1 (0.00s) + --- PASS: TestCountInRank/Count_of_occupied_squares_in_rank_-100 (0.00s) +=== RUN TestCountAll +--- PASS: TestCountAll (0.00s) +=== RUN TestCountOccupied +--- PASS: TestCountOccupied (0.00s) +=== RUN ExampleCountInFile +--- PASS: ExampleCountInFile (0.00s) +=== RUN ExampleCountInRank +--- PASS: ExampleCountInRank (0.00s) +=== RUN ExampleCountAll +--- PASS: ExampleCountAll (0.00s) +=== RUN ExampleCountOccupied +--- PASS: ExampleCountOccupied (0.00s) +PASS +ok chessboard 0.003s -real 0m0.077s -user 0m0.081s -sys 0m0.037s +real 0m0.167s +user 0m0.262s +sys 0m0.189s =============================================================================== -gosec ./... -[gosec] 2022/08/24 21:34:05 Including rules: default -[gosec] 2022/08/24 21:34:05 Excluding rules: default -[gosec] 2022/08/24 21:34:05 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/chessboard -[gosec] 2022/08/24 21:34:06 Checking package: chessboard -[gosec] 2022/08/24 21:34:06 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/chessboard/chessboard.go -Results: - - -Summary: - Files: 1 - Lines: 64 - Nosec: 0 - Issues: 0 - +benchstat benchstat-old.txt benchstat-new.txt -real 0m0.446s -user 0m0.510s -sys 0m0.279s +real 0m0.001s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output chessboard-doc.md -real 0m0.092s -user 0m0.052s -sys 0m0.055s +real 0m0.014s +user 0m0.008s +sys 0m0.006s =============================================================================== @@ -359,9 +921,9 @@ type File []bool bools -real 0m0.179s -user 0m0.090s -sys 0m0.179s +real 0m0.043s +user 0m0.017s +sys 0m0.038s =============================================================================== diff --git a/go/clock/benchstat-new.txt b/go/clock/benchstat-new.txt index ae9c33e5..ac76151a 100644 --- a/go/clock/benchstat-new.txt +++ b/go/clock/benchstat-new.txt @@ -1,9 +1,12 @@ goos: linux goarch: amd64 pkg: clock -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkAddMinutes-4 32747145 46.53 ns/op 0 B/op 0 allocs/op -BenchmarkSubtractMinutes-4 11690691 122.2 ns/op 0 B/op 0 allocs/op -BenchmarkCreateClocks-4 4752541 292.1 ns/op 0 B/op 0 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkAddMinutes +BenchmarkAddMinutes-8 98044280 10.95 ns/op 0 B/op 0 allocs/op +BenchmarkSubtractMinutes +BenchmarkSubtractMinutes-8 19512818 68.80 ns/op 0 B/op 0 allocs/op +BenchmarkCreateClocks +BenchmarkCreateClocks-8 8946037 147.5 ns/op 0 B/op 0 allocs/op PASS -ok clock 5.872s +ok clock 4.751s diff --git a/go/clock/benchstat-old.txt b/go/clock/benchstat-old.txt index db3cff05..ae9c33e5 100644 --- a/go/clock/benchstat-old.txt +++ b/go/clock/benchstat-old.txt @@ -2,8 +2,8 @@ goos: linux goarch: amd64 pkg: clock cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkAddMinutes-4 34995236 32.33 ns/op 0 B/op 0 allocs/op -BenchmarkSubtractMinutes-4 16155007 87.23 ns/op 0 B/op 0 allocs/op -BenchmarkCreateClocks-4 5566652 192.9 ns/op 0 B/op 0 allocs/op +BenchmarkAddMinutes-4 32747145 46.53 ns/op 0 B/op 0 allocs/op +BenchmarkSubtractMinutes-4 11690691 122.2 ns/op 0 B/op 0 allocs/op +BenchmarkCreateClocks-4 4752541 292.1 ns/op 0 B/op 0 allocs/op PASS -ok clock 4.871s +ok clock 5.872s diff --git a/go/clock/clock-doc.md b/go/clock/clock-doc.md index 1b5bbf6c..f887e3e3 100755 --- a/go/clock/clock-doc.md +++ b/go/clock/clock-doc.md @@ -6,7 +6,7 @@ import "clock" ``` -Package clock that handles times without dates\. +Package clock that handles times without dates. ## Index @@ -19,7 +19,7 @@ Package clock that handles times without dates\. ## type [Clock]() -Clock struct that uses hours and minutes to represent time\. +Clock struct that uses hours and minutes to represent time. ```go type Clock struct { @@ -33,7 +33,7 @@ type Clock struct { func New(h, m int) Clock ``` -New returns a new clock with the normalized given hours and minutes\. +New returns a new clock with the normalized given hours and minutes. ### func \(Clock\) [Add]() @@ -41,7 +41,7 @@ New returns a new clock with the normalized given hours and minutes\. func (c Clock) Add(m int) Clock ``` -Add returns a clock with the added minutes\. +Add returns a clock with the added minutes. ### func \(Clock\) [String]() @@ -49,7 +49,7 @@ Add returns a clock with the added minutes\. func (c Clock) String() string ``` -String retruns a string representation of the clock struct\. +String retruns a string representation of the clock struct. ### func \(Clock\) [Subtract]() @@ -57,7 +57,7 @@ String retruns a string representation of the clock struct\. func (c Clock) Subtract(m int) Clock ``` -Subtract returns a clock with the subtracted minutes\. +Subtract returns a clock with the subtracted minutes. diff --git a/go/clock/coverage-annotations.txt b/go/clock/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/clock/coverage.out b/go/clock/coverage.out index cc4fa319..9c2ae023 100644 --- a/go/clock/coverage.out +++ b/go/clock/coverage.out @@ -1,11 +1,11 @@ mode: count clock/clock.go:13.37,14.12 1 136 -clock/clock.go:19.2,19.12 1 136 -clock/clock.go:23.2,25.18 2 136 -clock/clock.go:30.2,30.13 1 136 clock/clock.go:14.12,17.3 2 652 +clock/clock.go:19.2,19.12 1 136 clock/clock.go:19.12,21.3 1 57 +clock/clock.go:23.2,25.18 2 136 clock/clock.go:25.18,28.3 2 120 +clock/clock.go:30.2,30.13 1 136 clock/clock.go:34.26,41.2 2 100 clock/clock.go:44.33,48.2 2 18 clock/clock.go:51.38,55.2 2 18 diff --git a/go/clock/run-tests-go.txt b/go/clock/run-tests-go.txt index b8448c21..162abd84 100644 --- a/go/clock/run-tests-go.txt +++ b/go/clock/run-tests-go.txt @@ -5,15 +5,681 @@ Go packages: clock =============================================================================== -golint clock +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.540s -user 0m0.522s -sys 0m0.485s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.020s +sys 0m0.026s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +cases_test.go:259:35: Comment should end in a period (godot) +// Compare two clocks for equality + ^ +cases_test.go:266: File is not `gofumpt`-ed (gofumpt) +}{{ + description: "clocks with same time", + c1: hm{15, 37}, + c2: hm{15, 37}, + expected: true, +}, +clock.go:12: line is 127 characters (lll) +// normalize returns hours and minutes after the hours have been normalized (it's late, that's the best name I could think of). +clock_examples_test.go:7:11: var-declaration: should omit type Clock from declaration of var clock; it will be inferred from the right-hand side (revive) +var clock Clock = Clock{ + ^ +clock.go:23:14: var-declaration: should omit type int from declaration of var minutes; it will be inferred from the right-hand side (revive) + var minutes int = h*60 + m + ^ +clock_test.go:13:21: Using the variable on range scope `tc` in function literal (scopelint) + if actual := New(tc.h, tc.m); tc.expected != actual.String() { + ^ +clock_test.go:14:43: Using the variable on range scope `tc` in function literal (scopelint) + t.Errorf("New(%d, %d) = %q, want %q", tc.h, tc.m, actual, tc.expected) + ^ +clock_test.go:23:21: Using the variable on range scope `tc` in function literal (scopelint) + if actual := New(tc.h, tc.m).Add(tc.addedValue); tc.expected != actual.String() { + ^ +clock_test.go:96:2: assignments should only be cuddled with other assignments (wsl) + c := New(12, 0) + ^ +clock_test.go:97:2: only cuddled expressions if assigning variable or using from line above (wsl) + b.ResetTimer() + ^ +clock_test.go:98:2: only one cuddle assignment allowed before for statement (wsl) + for i := 0; i < b.N; i++ { + ^ +clock_test.go:109:2: assignments should only be cuddled with other assignments (wsl) + c := New(12, 0) + ^ +clock_test.go:110:2: only cuddled expressions if assigning variable or using from line above (wsl) + b.ResetTimer() + ^ +clock_test.go:111:2: only one cuddle assignment allowed before for statement (wsl) + for i := 0; i < b.N; i++ { + ^ +clock_test.go:122:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:6:5: timeTestCases is a global variable (gochecknoglobals) +var timeTestCases = []struct { + ^ +cases_test.go:133:5: addTestCases is a global variable (gochecknoglobals) +var addTestCases = []struct { + ^ +cases_test.go:196:5: subtractTestCases is a global variable (gochecknoglobals) +var subtractTestCases = []struct { + ^ +cases_test.go:262:5: equalTestCases is a global variable (gochecknoglobals) +var equalTestCases = []struct { + ^ +clock.go:25:15: mnd: Magic number: 60, in detected (gomnd) + if minutes > 60 { + ^ +clock.go:26:24: mnd: Magic number: 24, in detected (gomnd) + h = (minutes / 60) % 24 + ^ +clock.go:27:17: mnd: Magic number: 60, in detected (gomnd) + m = minutes % 60 + ^ +clock_examples_test.go:12:1: tests: ExampleAdd refers to unknown identifier: Add (govet) +func ExampleAdd() { +^ +clock_examples_test.go:20:1: tests: ExampleSubtract refers to unknown identifier: Subtract (govet) +func ExampleSubtract() { +^ +clock_test.go:10:1: Function TestCreateClock missing the call to method parallel (paralleltest) +func TestCreateClock(t *testing.T) { +^ +clock_test.go:11:2: Range statement for test TestCreateClock missing the call to method parallel in test Run (paralleltest) + for _, tc := range timeTestCases { + ^ +clock_test.go:20:1: Function TestAddMinutes missing the call to method parallel (paralleltest) +func TestAddMinutes(t *testing.T) { +^ +clock_test.go:21:2: Range statement for test TestAddMinutes missing the call to method parallel in test Run (paralleltest) + for _, tc := range addTestCases { + ^ +clock_test.go:30:1: Function TestSubtractMinutes missing the call to method parallel (paralleltest) +func TestSubtractMinutes(t *testing.T) { +^ +clock_test.go:31:2: Range statement for test TestSubtractMinutes missing the call to method parallel in test Run (paralleltest) + for _, tc := range subtractTestCases { + ^ +clock_test.go:40:1: Function TestAddMinutesStringless missing the call to method parallel (paralleltest) +func TestAddMinutesStringless(t *testing.T) { +^ +clock_test.go:41:2: Range statement for test TestAddMinutesStringless missing the call to method parallel in test Run (paralleltest) + for _, tc := range addTestCases { + ^ +clock_test.go:58:1: Function TestSubtractMinutesStringless missing the call to method parallel (paralleltest) +func TestSubtractMinutesStringless(t *testing.T) { +^ +clock_test.go:59:2: Range statement for test TestSubtractMinutesStringless missing the call to method parallel in test Run (paralleltest) + for _, tc := range subtractTestCases { + ^ +clock_test.go:76:1: Function TestCompareClocks missing the call to method parallel (paralleltest) +func TestCompareClocks(t *testing.T) { +^ +clock_test.go:77:2: Range statement for test TestCompareClocks missing the call to method parallel in test Run (paralleltest) + for _, tc := range equalTestCases { + ^ +cases_test.go:1:9: package should be `clock_test` instead of `clock` (testpackage) +package clock + ^ +clock_examples_test.go:1:9: package should be `clock_test` instead of `clock` (testpackage) +package clock + ^ +clock_test.go:1:9: package should be `clock_test` instead of `clock` (testpackage) +package clock + ^ +clock.go:13:16: parameter name 'h' is too short for the scope of its usage (varnamelen) +func normalize(h, m int) (int, int) { + ^ + +real 0m0.647s +user 0m0.984s +sys 0m0.626s + + + ============================================================================== + +Exit code: -1 + +real 0m0.684s +user 0m1.007s +sys 0m0.667s + +real 0m0.686s +user 0m1.009s +sys 0m0.668s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.021s +sys 0m0.027s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +clock_examples_test.go + (7, 11) https://revive.run/r#var-declaration should omit type Clock from declaration of var clock; it will be inferred from the right-hand side + +clock.go + (23, 14) https://revive.run/r#var-declaration should omit type int from declaration of var minutes; it will be inferred from the right-hand side + + + ✖ 2 problems (0 errors) (2 warnings) + +real 0m0.072s +user 0m0.042s +sys 0m0.046s + + + ============================================================================== + +Exit code: 0 + +real 0m0.109s +user 0m0.068s +sys 0m0.083s + +real 0m0.111s +user 0m0.069s +sys 0m0.085s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.015s +sys 0m0.017s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "clock" + +real 0m0.098s +user 0m0.119s +sys 0m0.131s + + + ============================================================================== + +Exit code: -1 + +real 0m0.126s +user 0m0.143s +sys 0m0.152s + +real 0m0.128s +user 0m0.144s +sys 0m0.153s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.015s +sys 0m0.021s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +clock.go:23:14: should omit type int from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.231s +user 0m0.280s +sys 0m0.153s + + + ============================================================================== + +Exit code: -1 + +real 0m0.266s +user 0m0.304s +sys 0m0.180s + +real 0m0.268s +user 0m0.305s +sys 0m0.181s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.015s +sys 0m0.024s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./clock.go:13:1: unnamedResult: consider giving a name to these results + +real 0m0.842s +user 0m1.848s +sys 0m0.303s + + + ============================================================================== + +Exit code: -1 + +real 0m0.875s +user 0m1.871s +sys 0m0.333s + +real 0m0.877s +user 0m1.871s +sys 0m0.334s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.028s +sys 0m0.033s + + + ============================================================================== + +Running: go vet ./... + +# clock +./clock_examples_test.go:12:1: ExampleAdd refers to unknown identifier: Add +./clock_examples_test.go:20:1: ExampleSubtract refers to unknown identifier: Subtract + +real 0m0.070s +user 0m0.105s +sys 0m0.080s + + + ============================================================================== + +Exit code: -1 + +real 0m0.114s +user 0m0.138s +sys 0m0.122s + +real 0m0.115s +user 0m0.139s +sys 0m0.123s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.021s +sys 0m0.019s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.033s +user 0m0.024s +sys 0m0.034s + + + ============================================================================== + +Exit code: 0 + +real 0m0.069s +user 0m0.051s +sys 0m0.063s + +real 0m0.071s +user 0m0.053s +sys 0m0.064s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.037s +user 0m0.039s +sys 0m0.038s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.628s +user 0m1.627s +sys 0m0.318s + + + ============================================================================== + +Exit code: 0 + +real 0m0.685s +user 0m1.674s +sys 0m0.374s + +real 0m0.687s +user 0m1.674s +sys 0m0.375s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.023s +sys 0m0.033s + + + ============================================================================== + +Running: gocyclo . + +4 clock BenchmarkCreateClocks clock_test.go:118:1 +4 clock BenchmarkSubtractMinutes clock_test.go:105:1 +4 clock BenchmarkAddMinutes clock_test.go:92:1 +4 clock TestCompareClocks clock_test.go:76:1 +4 clock TestSubtractMinutesStringless clock_test.go:58:1 +4 clock TestAddMinutesStringless clock_test.go:40:1 +4 clock normalize clock.go:13:1 +3 clock TestSubtractMinutes clock_test.go:30:1 +3 clock TestAddMinutes clock_test.go:20:1 +3 clock TestCreateClock clock_test.go:10:1 +1 clock ExampleString clock_examples_test.go:28:1 +1 clock ExampleSubtract clock_examples_test.go:20:1 +1 clock ExampleAdd clock_examples_test.go:12:1 +1 clock (Clock).String clock.go:58:1 +1 clock (Clock).Subtract clock.go:51:1 +1 clock (Clock).Add clock.go:44:1 +1 clock New clock.go:34:1 + +real 0m0.007s +user 0m0.006s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.065s +user 0m0.046s +sys 0m0.060s + +real 0m0.068s +user 0m0.046s +sys 0m0.063s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.036s +user 0m0.040s +sys 0m0.018s + + + ============================================================================== + +Exit code: 0 + +real 0m0.048s +user 0m0.049s +sys 0m0.025s + +real 0m0.053s +user 0m0.050s +sys 0m0.029s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out clock +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.016s +sys 0m0.026s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:21:40 Including rules: default +[gosec] 2023/09/07 00:21:40 Excluding rules: default +[gosec] 2023/09/07 00:21:40 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/clock +[gosec] 2023/09/07 00:21:40 Checking package: clock +[gosec] 2023/09/07 00:21:40 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/clock/clock.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 60 + Nosec : 0 + Issues : 0 + + +real 0m0.141s +user 0m0.147s +sys 0m0.104s + + + ============================================================================== + +Exit code: 0 + +real 0m0.177s +user 0m0.165s +sys 0m0.143s + +real 0m0.179s +user 0m0.165s +sys 0m0.146s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.019s +sys 0m0.018s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestCreateClock === RUN TestCreateClock/on_the_hour === RUN TestCreateClock/past_the_hour @@ -145,7 +811,7 @@ go test -v -covermode=count -coverprofile coverage.out clock === RUN TestCompareClocks/clocks_with_negative_hours_and_minutes === RUN TestCompareClocks/clocks_with_negative_hours_and_minutes_that_wrap === RUN TestCompareClocks/full_clock_and_zeroed_clock ---- PASS: TestCompareClocks (0.01s) +--- PASS: TestCompareClocks (0.00s) --- PASS: TestCompareClocks/clocks_with_same_time (0.00s) --- PASS: TestCompareClocks/clocks_a_minute_apart (0.00s) --- PASS: TestCompareClocks/clocks_an_hour_apart (0.00s) @@ -170,15 +836,17 @@ go test -v -covermode=count -coverprofile coverage.out clock --- PASS: ExampleString (0.00s) PASS coverage: 100.0% of statements -ok clock 0.026s coverage: 100.0% of statements +ok clock 0.004s coverage: 100.0% of statements -real 0m1.333s -user 0m1.709s -sys 0m1.024s +real 0m0.219s +user 0m0.285s +sys 0m0.154s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + clock/clock.go:13: normalize 100.0% clock/clock.go:34: New 100.0% clock/clock.go:44: Add 100.0% @@ -186,21 +854,40 @@ clock/clock.go:51: Subtract 100.0% clock/clock.go:58: String 100.0% total: (statements) 100.0% -real 0m0.380s -user 0m0.393s -sys 0m0.348s +real 0m0.073s +user 0m0.094s +sys 0m0.101s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.450s -user 0m0.505s -sys 0m0.275s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic clock +real 0m0.046s +user 0m0.055s +sys 0m0.064s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.030s +user 0m0.036s +sys 0m0.024s + +real 0m0.030s +user 0m0.036s +sys 0m0.024s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestCreateClock === RUN TestCreateClock/on_the_hour === RUN TestCreateClock/past_the_hour @@ -222,7 +909,7 @@ go test -v -race -covermode=atomic clock === RUN TestCreateClock/negative_sixty_minutes_is_previous_hour === RUN TestCreateClock/negative_hour_and_minutes_both_roll_over === RUN TestCreateClock/negative_hour_and_minutes_both_roll_over_continuously ---- PASS: TestCreateClock (0.02s) +--- PASS: TestCreateClock (0.01s) --- PASS: TestCreateClock/on_the_hour (0.00s) --- PASS: TestCreateClock/past_the_hour (0.00s) --- PASS: TestCreateClock/midnight_is_zero_hours (0.00s) @@ -252,7 +939,7 @@ go test -v -race -covermode=atomic clock === RUN TestAddMinutes/add_across_midnight === RUN TestAddMinutes/add_more_than_one_day_(1500_min_=_25_hrs) === RUN TestAddMinutes/add_more_than_two_days ---- PASS: TestAddMinutes (0.01s) +--- PASS: TestAddMinutes (0.00s) --- PASS: TestAddMinutes/add_minutes (0.00s) --- PASS: TestAddMinutes/add_no_minutes (0.00s) --- PASS: TestAddMinutes/add_to_next_hour (0.00s) @@ -270,7 +957,7 @@ go test -v -race -covermode=atomic clock === RUN TestSubtractMinutes/subtract_more_than_two_hours_with_borrow === RUN TestSubtractMinutes/subtract_more_than_one_day_(1500_min_=_25_hrs) === RUN TestSubtractMinutes/subtract_more_than_two_days ---- PASS: TestSubtractMinutes (0.01s) +--- PASS: TestSubtractMinutes (0.00s) --- PASS: TestSubtractMinutes/subtract_minutes (0.00s) --- PASS: TestSubtractMinutes/subtract_to_previous_hour (0.00s) --- PASS: TestSubtractMinutes/subtract_more_than_an_hour (0.00s) @@ -288,7 +975,7 @@ go test -v -race -covermode=atomic clock === RUN TestAddMinutesStringless/add_across_midnight === RUN TestAddMinutesStringless/add_more_than_one_day_(1500_min_=_25_hrs) === RUN TestAddMinutesStringless/add_more_than_two_days ---- PASS: TestAddMinutesStringless (0.01s) +--- PASS: TestAddMinutesStringless (0.00s) --- PASS: TestAddMinutesStringless/add_minutes (0.00s) --- PASS: TestAddMinutesStringless/add_no_minutes (0.00s) --- PASS: TestAddMinutesStringless/add_to_next_hour (0.00s) @@ -332,7 +1019,7 @@ go test -v -race -covermode=atomic clock === RUN TestCompareClocks/clocks_with_negative_hours_and_minutes === RUN TestCompareClocks/clocks_with_negative_hours_and_minutes_that_wrap === RUN TestCompareClocks/full_clock_and_zeroed_clock ---- PASS: TestCompareClocks (0.01s) +--- PASS: TestCompareClocks (0.00s) --- PASS: TestCompareClocks/clocks_with_same_time (0.00s) --- PASS: TestCompareClocks/clocks_a_minute_apart (0.00s) --- PASS: TestCompareClocks/clocks_an_hour_apart (0.00s) @@ -357,108 +1044,286 @@ go test -v -race -covermode=atomic clock --- PASS: ExampleString (0.00s) PASS coverage: 100.0% of statements -ok clock 0.120s coverage: 100.0% of statements +ok clock 1.040s coverage: 100.0% of statements + +real 0m1.310s +user 0m0.361s +sys 0m0.191s + + + ============================================================================== + +Exit code: 0 + +real 0m1.712s +user 0m0.857s +sys 0m0.563s -real 0m1.569s -user 0m2.157s -sys 0m1.116s +real 0m1.714s +user 0m0.858s +sys 0m0.565s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: clock -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkAddMinutes-4 32747145 46.53 ns/op 0 B/op 0 allocs/op -BenchmarkSubtractMinutes-4 11690691 122.2 ns/op 0 B/op 0 allocs/op -BenchmarkCreateClocks-4 4752541 292.1 ns/op 0 B/op 0 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkAddMinutes +BenchmarkAddMinutes-8 98044280 10.95 ns/op 0 B/op 0 allocs/op +BenchmarkSubtractMinutes +BenchmarkSubtractMinutes-8 19512818 68.80 ns/op 0 B/op 0 allocs/op +BenchmarkCreateClocks +BenchmarkCreateClocks-8 8946037 147.5 ns/op 0 B/op 0 allocs/op PASS -ok clock 5.872s +ok clock 4.751s -real 0m6.718s -user 0m7.001s -sys 0m0.670s +real 0m4.979s +user 0m5.074s +sys 0m0.225s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestCreateClock +=== RUN TestCreateClock/on_the_hour +=== RUN TestCreateClock/past_the_hour +=== RUN TestCreateClock/midnight_is_zero_hours +=== RUN TestCreateClock/hour_rolls_over +=== RUN TestCreateClock/hour_rolls_over_continuously +=== RUN TestCreateClock/sixty_minutes_is_next_hour +=== RUN TestCreateClock/minutes_roll_over +=== RUN TestCreateClock/minutes_roll_over_continuously +=== RUN TestCreateClock/hour_and_minutes_roll_over +=== RUN TestCreateClock/hour_and_minutes_roll_over_continuously +=== RUN TestCreateClock/hour_and_minutes_roll_over_to_exactly_midnight +=== RUN TestCreateClock/negative_hour +=== RUN TestCreateClock/negative_hour_rolls_over +=== RUN TestCreateClock/negative_hour_rolls_over_continuously +=== RUN TestCreateClock/negative_minutes +=== RUN TestCreateClock/negative_minutes_roll_over +=== RUN TestCreateClock/negative_minutes_roll_over_continuously +=== RUN TestCreateClock/negative_sixty_minutes_is_previous_hour +=== RUN TestCreateClock/negative_hour_and_minutes_both_roll_over +=== RUN TestCreateClock/negative_hour_and_minutes_both_roll_over_continuously +--- PASS: TestCreateClock (0.00s) + --- PASS: TestCreateClock/on_the_hour (0.00s) + --- PASS: TestCreateClock/past_the_hour (0.00s) + --- PASS: TestCreateClock/midnight_is_zero_hours (0.00s) + --- PASS: TestCreateClock/hour_rolls_over (0.00s) + --- PASS: TestCreateClock/hour_rolls_over_continuously (0.00s) + --- PASS: TestCreateClock/sixty_minutes_is_next_hour (0.00s) + --- PASS: TestCreateClock/minutes_roll_over (0.00s) + --- PASS: TestCreateClock/minutes_roll_over_continuously (0.00s) + --- PASS: TestCreateClock/hour_and_minutes_roll_over (0.00s) + --- PASS: TestCreateClock/hour_and_minutes_roll_over_continuously (0.00s) + --- PASS: TestCreateClock/hour_and_minutes_roll_over_to_exactly_midnight (0.00s) + --- PASS: TestCreateClock/negative_hour (0.00s) + --- PASS: TestCreateClock/negative_hour_rolls_over (0.00s) + --- PASS: TestCreateClock/negative_hour_rolls_over_continuously (0.00s) + --- PASS: TestCreateClock/negative_minutes (0.00s) + --- PASS: TestCreateClock/negative_minutes_roll_over (0.00s) + --- PASS: TestCreateClock/negative_minutes_roll_over_continuously (0.00s) + --- PASS: TestCreateClock/negative_sixty_minutes_is_previous_hour (0.00s) + --- PASS: TestCreateClock/negative_hour_and_minutes_both_roll_over (0.00s) + --- PASS: TestCreateClock/negative_hour_and_minutes_both_roll_over_continuously (0.00s) +=== RUN TestAddMinutes +=== RUN TestAddMinutes/add_minutes +=== RUN TestAddMinutes/add_no_minutes +=== RUN TestAddMinutes/add_to_next_hour +=== RUN TestAddMinutes/add_more_than_one_hour +=== RUN TestAddMinutes/add_more_than_two_hours_with_carry +=== RUN TestAddMinutes/add_across_midnight +=== RUN TestAddMinutes/add_more_than_one_day_(1500_min_=_25_hrs) +=== RUN TestAddMinutes/add_more_than_two_days +--- PASS: TestAddMinutes (0.00s) + --- PASS: TestAddMinutes/add_minutes (0.00s) + --- PASS: TestAddMinutes/add_no_minutes (0.00s) + --- PASS: TestAddMinutes/add_to_next_hour (0.00s) + --- PASS: TestAddMinutes/add_more_than_one_hour (0.00s) + --- PASS: TestAddMinutes/add_more_than_two_hours_with_carry (0.00s) + --- PASS: TestAddMinutes/add_across_midnight (0.00s) + --- PASS: TestAddMinutes/add_more_than_one_day_(1500_min_=_25_hrs) (0.00s) + --- PASS: TestAddMinutes/add_more_than_two_days (0.00s) +=== RUN TestSubtractMinutes +=== RUN TestSubtractMinutes/subtract_minutes +=== RUN TestSubtractMinutes/subtract_to_previous_hour +=== RUN TestSubtractMinutes/subtract_more_than_an_hour +=== RUN TestSubtractMinutes/subtract_across_midnight +=== RUN TestSubtractMinutes/subtract_more_than_two_hours +=== RUN TestSubtractMinutes/subtract_more_than_two_hours_with_borrow +=== RUN TestSubtractMinutes/subtract_more_than_one_day_(1500_min_=_25_hrs) +=== RUN TestSubtractMinutes/subtract_more_than_two_days +--- PASS: TestSubtractMinutes (0.00s) + --- PASS: TestSubtractMinutes/subtract_minutes (0.00s) + --- PASS: TestSubtractMinutes/subtract_to_previous_hour (0.00s) + --- PASS: TestSubtractMinutes/subtract_more_than_an_hour (0.00s) + --- PASS: TestSubtractMinutes/subtract_across_midnight (0.00s) + --- PASS: TestSubtractMinutes/subtract_more_than_two_hours (0.00s) + --- PASS: TestSubtractMinutes/subtract_more_than_two_hours_with_borrow (0.00s) + --- PASS: TestSubtractMinutes/subtract_more_than_one_day_(1500_min_=_25_hrs) (0.00s) + --- PASS: TestSubtractMinutes/subtract_more_than_two_days (0.00s) +=== RUN TestAddMinutesStringless +=== RUN TestAddMinutesStringless/add_minutes +=== RUN TestAddMinutesStringless/add_no_minutes +=== RUN TestAddMinutesStringless/add_to_next_hour +=== RUN TestAddMinutesStringless/add_more_than_one_hour +=== RUN TestAddMinutesStringless/add_more_than_two_hours_with_carry +=== RUN TestAddMinutesStringless/add_across_midnight +=== RUN TestAddMinutesStringless/add_more_than_one_day_(1500_min_=_25_hrs) +=== RUN TestAddMinutesStringless/add_more_than_two_days +--- PASS: TestAddMinutesStringless (0.00s) + --- PASS: TestAddMinutesStringless/add_minutes (0.00s) + --- PASS: TestAddMinutesStringless/add_no_minutes (0.00s) + --- PASS: TestAddMinutesStringless/add_to_next_hour (0.00s) + --- PASS: TestAddMinutesStringless/add_more_than_one_hour (0.00s) + --- PASS: TestAddMinutesStringless/add_more_than_two_hours_with_carry (0.00s) + --- PASS: TestAddMinutesStringless/add_across_midnight (0.00s) + --- PASS: TestAddMinutesStringless/add_more_than_one_day_(1500_min_=_25_hrs) (0.00s) + --- PASS: TestAddMinutesStringless/add_more_than_two_days (0.00s) +=== RUN TestSubtractMinutesStringless +=== RUN TestSubtractMinutesStringless/subtract_minutes +=== RUN TestSubtractMinutesStringless/subtract_to_previous_hour +=== RUN TestSubtractMinutesStringless/subtract_more_than_an_hour +=== RUN TestSubtractMinutesStringless/subtract_across_midnight +=== RUN TestSubtractMinutesStringless/subtract_more_than_two_hours +=== RUN TestSubtractMinutesStringless/subtract_more_than_two_hours_with_borrow +=== RUN TestSubtractMinutesStringless/subtract_more_than_one_day_(1500_min_=_25_hrs) +=== RUN TestSubtractMinutesStringless/subtract_more_than_two_days +--- PASS: TestSubtractMinutesStringless (0.00s) + --- PASS: TestSubtractMinutesStringless/subtract_minutes (0.00s) + --- PASS: TestSubtractMinutesStringless/subtract_to_previous_hour (0.00s) + --- PASS: TestSubtractMinutesStringless/subtract_more_than_an_hour (0.00s) + --- PASS: TestSubtractMinutesStringless/subtract_across_midnight (0.00s) + --- PASS: TestSubtractMinutesStringless/subtract_more_than_two_hours (0.00s) + --- PASS: TestSubtractMinutesStringless/subtract_more_than_two_hours_with_borrow (0.00s) + --- PASS: TestSubtractMinutesStringless/subtract_more_than_one_day_(1500_min_=_25_hrs) (0.00s) + --- PASS: TestSubtractMinutesStringless/subtract_more_than_two_days (0.00s) +=== RUN TestCompareClocks +=== RUN TestCompareClocks/clocks_with_same_time +=== RUN TestCompareClocks/clocks_a_minute_apart +=== RUN TestCompareClocks/clocks_an_hour_apart +=== RUN TestCompareClocks/clocks_with_hour_overflow +=== RUN TestCompareClocks/clocks_with_hour_overflow_by_several_days +=== RUN TestCompareClocks/clocks_with_negative_hour +=== RUN TestCompareClocks/clocks_with_negative_hour_that_wraps +=== RUN TestCompareClocks/clocks_with_negative_hour_that_wraps_multiple_times +=== RUN TestCompareClocks/clocks_with_minute_overflow +=== RUN TestCompareClocks/clocks_with_minute_overflow_by_several_days +=== RUN TestCompareClocks/clocks_with_negative_minute +=== RUN TestCompareClocks/clocks_with_negative_minute_that_wraps +=== RUN TestCompareClocks/clocks_with_negative_minute_that_wraps_multiple_times +=== RUN TestCompareClocks/clocks_with_negative_hours_and_minutes +=== RUN TestCompareClocks/clocks_with_negative_hours_and_minutes_that_wrap +=== RUN TestCompareClocks/full_clock_and_zeroed_clock +--- PASS: TestCompareClocks (0.00s) + --- PASS: TestCompareClocks/clocks_with_same_time (0.00s) + --- PASS: TestCompareClocks/clocks_a_minute_apart (0.00s) + --- PASS: TestCompareClocks/clocks_an_hour_apart (0.00s) + --- PASS: TestCompareClocks/clocks_with_hour_overflow (0.00s) + --- PASS: TestCompareClocks/clocks_with_hour_overflow_by_several_days (0.00s) + --- PASS: TestCompareClocks/clocks_with_negative_hour (0.00s) + --- PASS: TestCompareClocks/clocks_with_negative_hour_that_wraps (0.00s) + --- PASS: TestCompareClocks/clocks_with_negative_hour_that_wraps_multiple_times (0.00s) + --- PASS: TestCompareClocks/clocks_with_minute_overflow (0.00s) + --- PASS: TestCompareClocks/clocks_with_minute_overflow_by_several_days (0.00s) + --- PASS: TestCompareClocks/clocks_with_negative_minute (0.00s) + --- PASS: TestCompareClocks/clocks_with_negative_minute_that_wraps (0.00s) + --- PASS: TestCompareClocks/clocks_with_negative_minute_that_wraps_multiple_times (0.00s) + --- PASS: TestCompareClocks/clocks_with_negative_hours_and_minutes (0.00s) + --- PASS: TestCompareClocks/clocks_with_negative_hours_and_minutes_that_wrap (0.00s) + --- PASS: TestCompareClocks/full_clock_and_zeroed_clock (0.00s) +=== RUN ExampleAdd +--- PASS: ExampleAdd (0.00s) +=== RUN ExampleSubtract +--- PASS: ExampleSubtract (0.00s) +=== RUN ExampleString +--- PASS: ExampleString (0.00s) PASS -ok clock 0.021s +ok clock 0.005s -real 0m0.861s -user 0m0.970s -sys 0m0.570s +real 0m0.160s +user 0m0.221s +sys 0m0.176s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m1.316s -user 0m1.247s -sys 0m0.720s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -AddMinutes-4 32.3ns ± 0% 46.5ns ± 0% ~ (p=1.000 n=1+1) -SubtractMinutes-4 87.2ns ± 0% 122.2ns ± 0% ~ (p=1.000 n=1+1) -CreateClocks-4 193ns ± 0% 292ns ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -AddMinutes-4 0.00B 0.00B ~ (all equal) -SubtractMinutes-4 0.00B 0.00B ~ (all equal) -CreateClocks-4 0.00B 0.00B ~ (all equal) - -name old allocs/op new allocs/op delta -AddMinutes-4 0.00 0.00 ~ (all equal) -SubtractMinutes-4 0.00 0.00 ~ (all equal) -CreateClocks-4 0.00 0.00 ~ (all equal) - -real 0m0.023s -user 0m0.012s -sys 0m0.016s - -=============================================================================== - -go vet clock -# clock -./clock_examples_test.go:12:1: ExampleAdd refers to unknown identifier: Add -./clock_examples_test.go:20:1: ExampleSubtract refers to unknown identifier: Subtract - -real 0m0.593s -user 0m0.828s -sys 0m0.616s +benchstat-new.txt:5: missing iteration count +benchstat-new.txt:7: missing iteration count +benchstat-new.txt:9: missing iteration count +goos: linux +goarch: amd64 +pkg: clock +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +AddMinutes-8 10.95n ± ∞ ¹ +SubtractMinutes-8 68.80n ± ∞ ¹ +CreateClocks-8 147.5n ± ∞ ¹ +geomean 48.08n +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-new.txt │ + │ B/op │ +AddMinutes-8 0.000 ± ∞ ¹ +SubtractMinutes-8 0.000 ± ∞ ¹ +CreateClocks-8 0.000 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean -go fix clock + │ benchstat-new.txt │ + │ allocs/op │ +AddMinutes-8 0.000 ± ∞ ¹ +SubtractMinutes-8 0.000 ± ∞ ¹ +CreateClocks-8 0.000 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean -real 0m0.236s -user 0m0.231s -sys 0m0.204s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +AddMinutes-4 46.53n ± ∞ ¹ +SubtractMinutes-4 122.2n ± ∞ ¹ +CreateClocks-4 292.1n ± ∞ ¹ +geomean 118.4n +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +AddMinutes-4 0.000 ± ∞ ¹ +SubtractMinutes-4 0.000 ± ∞ ¹ +CreateClocks-4 0.000 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean -gosec ./clock -[gosec] 2022/07/28 07:55:30 Including rules: default -[gosec] 2022/07/28 07:55:30 Excluding rules: default -[gosec] 2022/07/28 07:55:30 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/clock -2022/07/28 07:55:31 internal error: package "fmt" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +AddMinutes-4 0.000 ± ∞ ¹ +SubtractMinutes-4 0.000 ± ∞ ¹ +CreateClocks-4 0.000 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean -real 0m0.787s -user 0m0.993s -sys 0m0.553s +real 0m0.006s +user 0m0.002s +sys 0m0.003s =============================================================================== gomarkdoc --output clock-doc.md -real 0m0.043s -user 0m0.039s -sys 0m0.036s +real 0m0.022s +user 0m0.016s +sys 0m0.006s =============================================================================== @@ -487,9 +1352,9 @@ func (c Clock) Subtract(m int) Clock Subtract returns a clock with the subtracted minutes. -real 0m0.328s -user 0m0.369s -sys 0m0.324s +real 0m0.037s +user 0m0.031s +sys 0m0.026s =============================================================================== diff --git a/go/collatz-conjecture/benchstat-new.txt b/go/collatz-conjecture/benchstat-new.txt index 8ea3ba9f..e8f26c0b 100644 --- a/go/collatz-conjecture/benchstat-new.txt +++ b/go/collatz-conjecture/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: collatzconjecture -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkCollatzConjecture-4 1437994 957.2 ns/op 104 B/op 5 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkCollatzConjecture +BenchmarkCollatzConjecture-8 3042003 366.8 ns/op 104 B/op 5 allocs/op PASS -ok collatzconjecture 2.279s +ok collatzconjecture 1.520s diff --git a/go/collatz-conjecture/benchstat-old.txt b/go/collatz-conjecture/benchstat-old.txt new file mode 100644 index 00000000..8ea3ba9f --- /dev/null +++ b/go/collatz-conjecture/benchstat-old.txt @@ -0,0 +1,7 @@ +goos: linux +goarch: amd64 +pkg: collatzconjecture +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkCollatzConjecture-4 1437994 957.2 ns/op 104 B/op 5 allocs/op +PASS +ok collatzconjecture 2.279s diff --git a/go/collatz-conjecture/collatzconjecture-doc.md b/go/collatz-conjecture/collatzconjecture-doc.md index 6a6d168b..d4fd86ef 100755 --- a/go/collatz-conjecture/collatzconjecture-doc.md +++ b/go/collatz-conjecture/collatzconjecture-doc.md @@ -6,7 +6,7 @@ import "collatzconjecture" ``` -Package collatzconjecture states that the orbit of every number under f eventually reaches 1\. +Package collatzconjecture states that the orbit of every number under f eventually reaches 1. ## Index @@ -19,7 +19,7 @@ Package collatzconjecture states that the orbit of every number under f eventual func CollatzConjecture(n int) (int, error) ``` -CollatzConjecture returns the number of steps needed to reach 1 using The Collatz Conjecture\. +CollatzConjecture returns the number of steps needed to reach 1 using The Collatz Conjecture.
Example

diff --git a/go/collatz-conjecture/coverage-annotations.txt b/go/collatz-conjecture/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/collatz-conjecture/coverage.out b/go/collatz-conjecture/coverage.out index dfe832c6..ce0307be 100644 --- a/go/collatz-conjecture/coverage.out +++ b/go/collatz-conjecture/coverage.out @@ -1,10 +1,10 @@ mode: count collatzconjecture/collatz_conjecture.go:7.44,10.11 1 7 -collatzconjecture/collatz_conjecture.go:15.2,15.12 1 5 -collatzconjecture/collatz_conjecture.go:19.2,21.12 2 4 -collatzconjecture/collatz_conjecture.go:33.2,33.19 1 4 collatzconjecture/collatz_conjecture.go:10.11,12.3 1 2 +collatzconjecture/collatz_conjecture.go:15.2,15.12 1 5 collatzconjecture/collatz_conjecture.go:15.12,17.3 1 1 +collatzconjecture/collatz_conjecture.go:19.2,21.12 2 4 collatzconjecture/collatz_conjecture.go:21.12,24.15 2 174 collatzconjecture/collatz_conjecture.go:24.15,27.4 1 119 collatzconjecture/collatz_conjecture.go:27.9,30.4 1 55 +collatzconjecture/collatz_conjecture.go:33.2,33.19 1 4 diff --git a/go/collatz-conjecture/run-tests-go.txt b/go/collatz-conjecture/run-tests-go.txt index 5dc47658..eddc3c9e 100644 --- a/go/collatz-conjecture/run-tests-go.txt +++ b/go/collatz-conjecture/run-tests-go.txt @@ -5,15 +5,586 @@ Go packages: collatzconjecture =============================================================================== -golint collatzconjecture +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.204s -user 0m0.183s -sys 0m0.203s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.020s +sys 0m0.019s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +collatz_conjecture_test.go:32:21: Error return value is not checked (errcheck) + CollatzConjecture(testCase.input) + ^ +collatz_conjecture.go:8: File is not `gofumpt`-ed (gofumpt) + +collatz_conjecture_examples_test.go:8:8: var-declaration: should omit type int from declaration of var n; it will be inferred from the right-hand side (revive) + var n int = 12 + ^ +collatz_conjecture_test.go:10:37: Using the variable on range scope `testCase` in function literal (scopelint) + actual, err := CollatzConjecture(testCase.input) + ^ +collatz_conjecture_test.go:11:7: Using the variable on range scope `testCase` in function literal (scopelint) + if testCase.expectError { + ^ +collatz_conjecture_test.go:13:66: Using the variable on range scope `testCase` in function literal (scopelint) + t.Errorf("CollatzConjecture(%v) expected an error, got %v", testCase.input, actual) + ^ +collatz_conjecture.go:7: unnecessary leading newline (whitespace) +func CollatzConjecture(n int) (int, error) { + +collatz_conjecture_test.go:30:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +collatz_conjecture.go:11:13: err113: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"n, %d, isn't a positive number\", n)" (goerr113) + return 0, fmt.Errorf("n, %d, isn't a positive number", n) + ^ +collatz_conjecture.go:29:10: mnd: Magic number: 3, in detected (gomnd) + n = n*3 + 1 + ^ +collatz_conjecture_test.go:7:1: Function TestCollatzConjecture missing the call to method parallel (paralleltest) +func TestCollatzConjecture(t *testing.T) { +^ +collatz_conjecture_test.go:8:2: Range statement for test TestCollatzConjecture missing the call to method parallel in test Run (paralleltest) + for _, testCase := range testCases { + ^ +cases_test.go:1:9: package should be `collatzconjecture_test` instead of `collatzconjecture` (testpackage) +package collatzconjecture + ^ +collatz_conjecture_examples_test.go:1:9: package should be `collatzconjecture_test` instead of `collatzconjecture` (testpackage) +package collatzconjecture + ^ +collatz_conjecture_test.go:1:9: package should be `collatzconjecture_test` instead of `collatzconjecture` (testpackage) +package collatzconjecture + ^ + +real 0m0.452s +user 0m0.688s +sys 0m0.422s + + + ============================================================================== + +Exit code: -1 + +real 0m0.490s +user 0m0.717s +sys 0m0.452s + +real 0m0.493s +user 0m0.719s +sys 0m0.453s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.018s +sys 0m0.021s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +collatz_conjecture_examples_test.go + (8, 8) https://revive.run/r#var-declaration should omit type int from declaration of var n; it will be inferred from the right-hand side + + + ✖ 1 problem (0 errors) (1 warnings) + +real 0m0.029s +user 0m0.012s +sys 0m0.022s + + + ============================================================================== + +Exit code: 0 + +real 0m0.064s +user 0m0.040s +sys 0m0.048s + +real 0m0.066s +user 0m0.041s +sys 0m0.049s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.021s +sys 0m0.029s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "collatzconjecture" + +real 0m0.098s +user 0m0.116s +sys 0m0.135s + + + ============================================================================== + +Exit code: -1 + +real 0m0.139s +user 0m0.142s +sys 0m0.175s + +real 0m0.142s +user 0m0.143s +sys 0m0.177s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.016s +sys 0m0.019s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +collatz_conjecture_examples_test.go:8:8: should omit type int from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.159s +user 0m0.188s +sys 0m0.116s + + + ============================================================================== + +Exit code: -1 + +real 0m0.194s +user 0m0.212s +sys 0m0.144s + +real 0m0.195s +user 0m0.213s +sys 0m0.145s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.019s +sys 0m0.023s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.833s +user 0m1.968s +sys 0m0.291s + + + ============================================================================== + +Exit code: 0 + +real 0m0.867s +user 0m1.995s +sys 0m0.321s + +real 0m0.869s +user 0m1.995s +sys 0m0.324s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.035s +user 0m0.028s +sys 0m0.035s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.086s +user 0m0.097s +sys 0m0.106s + + + ============================================================================== + +Exit code: 0 + +real 0m0.134s +user 0m0.131s +sys 0m0.153s + +real 0m0.136s +user 0m0.132s +sys 0m0.153s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.021s +sys 0m0.027s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.025s +user 0m0.017s +sys 0m0.026s + + + ============================================================================== + +Exit code: 0 + +real 0m0.062s +user 0m0.044s +sys 0m0.065s + +real 0m0.064s +user 0m0.046s +sys 0m0.065s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out collatzconjecture +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.034s +user 0m0.028s +sys 0m0.032s + + + ============================================================================== + +Running: errcheck ./... + +collatz_conjecture_test.go:32:21: CollatzConjecture(testCase.input) + +real 0m0.466s +user 0m1.219s +sys 0m0.334s + + + ============================================================================== + +Exit code: -1 + +real 0m0.521s +user 0m1.256s +sys 0m0.384s + +real 0m0.522s +user 0m1.257s +sys 0m0.385s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.032s +sys 0m0.029s + + + ============================================================================== + +Running: gocyclo . + +6 collatzconjecture TestCollatzConjecture collatz_conjecture_test.go:7:1 +5 collatzconjecture CollatzConjecture collatz_conjecture.go:7:1 +4 collatzconjecture BenchmarkCollatzConjecture collatz_conjecture_test.go:26:1 +1 collatzconjecture ExampleCollatzConjecture collatz_conjecture_examples_test.go:7:1 + +real 0m0.003s +user 0m0.000s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.044s +user 0m0.036s +sys 0m0.041s + +real 0m0.047s +user 0m0.037s +sys 0m0.042s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.025s +user 0m0.022s +sys 0m0.017s + + + ============================================================================== + +Exit code: 0 + +real 0m0.046s +user 0m0.032s +sys 0m0.033s + +real 0m0.048s +user 0m0.034s +sys 0m0.033s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.038s +sys 0m0.027s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:21:50 Including rules: default +[gosec] 2023/09/07 00:21:50 Excluding rules: default +[gosec] 2023/09/07 00:21:50 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/collatz-conjecture +[gosec] 2023/09/07 00:21:50 Checking package: collatzconjecture +[gosec] 2023/09/07 00:21:50 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/collatz-conjecture/collatz_conjecture.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 34 + Nosec : 0 + Issues : 0 + + +real 0m0.142s +user 0m0.174s +sys 0m0.117s + + + ============================================================================== + +Exit code: 0 + +real 0m0.184s +user 0m0.218s +sys 0m0.152s + +real 0m0.186s +user 0m0.219s +sys 0m0.152s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.017s +sys 0m0.016s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestCollatzConjecture === RUN TestCollatzConjecture/zero_steps_for_one === RUN TestCollatzConjecture/divide_if_even @@ -32,33 +603,54 @@ go test -v -covermode=count -coverprofile coverage.out collatzconjecture --- PASS: ExampleCollatzConjecture (0.00s) PASS coverage: 100.0% of statements -ok collatzconjecture 0.008s coverage: 100.0% of statements +ok collatzconjecture 0.002s coverage: 100.0% of statements -real 0m0.766s -user 0m0.817s -sys 0m0.551s +real 0m0.222s +user 0m0.222s +sys 0m0.157s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + collatzconjecture/collatz_conjecture.go:7: CollatzConjecture 100.0% total: (statements) 100.0% -real 0m0.309s -user 0m0.265s -sys 0m0.226s +real 0m0.053s +user 0m0.048s +sys 0m0.087s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.330s -user 0m0.317s -sys 0m0.300s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic collatzconjecture +real 0m0.051s +user 0m0.057s +sys 0m0.065s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.018s +user 0m0.014s +sys 0m0.028s + +real 0m0.018s +user 0m0.014s +sys 0m0.028s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestCollatzConjecture === RUN TestCollatzConjecture/zero_steps_for_one === RUN TestCollatzConjecture/divide_if_even @@ -77,76 +669,120 @@ go test -v -race -covermode=atomic collatzconjecture --- PASS: ExampleCollatzConjecture (0.00s) PASS coverage: 100.0% of statements -ok collatzconjecture 0.028s coverage: 100.0% of statements +ok collatzconjecture 1.013s coverage: 100.0% of statements + +real 0m1.247s +user 0m0.263s +sys 0m0.189s + -real 0m1.116s -user 0m0.898s -sys 0m0.633s + ============================================================================== + +Exit code: 0 + +real 0m1.620s +user 0m0.626s +sys 0m0.550s + +real 0m1.622s +user 0m0.628s +sys 0m0.550s =============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: collatzconjecture -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkCollatzConjecture-4 1437994 957.2 ns/op 104 B/op 5 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkCollatzConjecture +BenchmarkCollatzConjecture-8 3042003 366.8 ns/op 104 B/op 5 allocs/op PASS -ok collatzconjecture 2.279s +ok collatzconjecture 1.520s -real 0m2.979s -user 0m3.512s -sys 0m0.577s +real 0m1.665s +user 0m1.727s +sys 0m0.163s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestCollatzConjecture +=== RUN TestCollatzConjecture/zero_steps_for_one +=== RUN TestCollatzConjecture/divide_if_even +=== RUN TestCollatzConjecture/even_and_odd_steps +=== RUN TestCollatzConjecture/large_number_of_even_and_odd_steps +=== RUN TestCollatzConjecture/zero_is_an_error +=== RUN TestCollatzConjecture/negative_value_is_an_error +--- PASS: TestCollatzConjecture (0.00s) + --- PASS: TestCollatzConjecture/zero_steps_for_one (0.00s) + --- PASS: TestCollatzConjecture/divide_if_even (0.00s) + --- PASS: TestCollatzConjecture/even_and_odd_steps (0.00s) + --- PASS: TestCollatzConjecture/large_number_of_even_and_odd_steps (0.00s) + --- PASS: TestCollatzConjecture/zero_is_an_error (0.00s) + --- PASS: TestCollatzConjecture/negative_value_is_an_error (0.00s) +=== RUN ExampleCollatzConjecture +--- PASS: ExampleCollatzConjecture (0.00s) PASS -ok collatzconjecture 0.021s +ok collatzconjecture 0.002s -real 0m0.533s -user 0m0.620s -sys 0m0.366s +real 0m0.114s +user 0m0.154s +sys 0m0.116s =============================================================================== -No old benchmarks to run benchstat against. - -=============================================================================== - -go vet collatzconjecture - -real 0m0.352s -user 0m0.445s -sys 0m0.280s - -=============================================================================== - -go fix collatzconjecture +benchstat benchstat-old.txt benchstat-new.txt +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: collatzconjecture +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +CollatzConjecture-8 366.8n ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +CollatzConjecture-8 104.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +CollatzConjecture-8 5.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.236s -user 0m0.194s -sys 0m0.180s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +CollatzConjecture-4 957.2n ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +CollatzConjecture-4 104.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./collatz-conjecture -[gosec] 2022/07/22 13:29:21 Including rules: default -[gosec] 2022/07/22 13:29:21 Excluding rules: default -[gosec] 2022/07/22 13:29:21 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/collatz-conjecture -2022/07/22 13:29:21 internal error: package "fmt" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +CollatzConjecture-4 5.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.547s -user 0m0.652s -sys 0m0.383s +real 0m0.002s +user 0m0.002s +sys 0m0.000s =============================================================================== gomarkdoc --output collatzconjecture-doc.md -real 0m0.030s -user 0m0.020s -sys 0m0.016s +real 0m0.011s +user 0m0.004s +sys 0m0.007s =============================================================================== @@ -163,9 +799,9 @@ func CollatzConjecture(n int) (int, error) Collatz Conjecture. -real 0m0.233s -user 0m0.138s -sys 0m0.197s +real 0m0.059s +user 0m0.037s +sys 0m0.053s =============================================================================== diff --git a/go/crypto-square/benchstat-new.txt b/go/crypto-square/benchstat-new.txt index 39b95be9..eb8391a0 100644 --- a/go/crypto-square/benchstat-new.txt +++ b/go/crypto-square/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: cryptosquare -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkEncode-4 2530 402031 ns/op 42270 B/op 845 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkEncode +BenchmarkEncode-8 18175 65310 ns/op 42655 B/op 840 allocs/op PASS -ok cryptosquare 1.144s +ok cryptosquare 1.862s diff --git a/go/crypto-square/benchstat-old.txt b/go/crypto-square/benchstat-old.txt new file mode 100644 index 00000000..39b95be9 --- /dev/null +++ b/go/crypto-square/benchstat-old.txt @@ -0,0 +1,7 @@ +goos: linux +goarch: amd64 +pkg: cryptosquare +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkEncode-4 2530 402031 ns/op 42270 B/op 845 allocs/op +PASS +ok cryptosquare 1.144s diff --git a/go/crypto-square/coverage-annotations.txt b/go/crypto-square/coverage-annotations.txt index 406c0780..a4504016 100644 --- a/go/crypto-square/coverage-annotations.txt +++ b/go/crypto-square/coverage-annotations.txt @@ -1,146 +1,146 @@ -14 func Encode(plain string) string { -15 if plain == "" { -16 return "" -17 } -18  -19 if debugMode { -20 fmt.Printf("plain: %q\n", plain) -21 } -22  -23 normalizedText := NormalizeText(plain) -24  -25 if debugMode { -26 fmt.Printf("plain: %q\n", normalizedText) -27 } -28  -29 plainTokens := GetTokens(normalizedText) -30  -31 if debugMode { -32 fmt.Printf("plainTokens: %#v\n", plainTokens) -33 } -34  -35 encodedTokens := EncodeTokens(plainTokens) -36  -37 if debugMode { -38 fmt.Printf("encodedTokens: %#v\n", encodedTokens) -39 } -40  -41 cipher := strings.Join(encodedTokens, " ") -42  -43 return cipher -44 } +14 func Encode(plain string) string { +15 if plain == "" { +16 return "" +17 } +18 +19 if debugMode { +20 MISS fmt.Printf("plain: %q\n", plain) +21 } +22 +23 normalizedText := NormalizeText(plain) +24 +25 if debugMode { +26 MISS fmt.Printf("plain: %q\n", normalizedText) +27 } +28 +29 plainTokens := GetTokens(normalizedText) +30 +31 if debugMode { +32 MISS fmt.Printf("plainTokens: %#v\n", plainTokens) +33 } +34 +35 encodedTokens := EncodeTokens(plainTokens) +36 +37 if debugMode { +38 MISS fmt.Printf("encodedTokens: %#v\n", encodedTokens) +39 } +40 +41 cipher := strings.Join(encodedTokens, " ") +42 +43 return cipher +44 } -134 func EncodeTokens(tokens []string) []string { -135 if len(tokens) == 0 { -136 return []string{} -137 } -138  -139 var sb strings.Builder -140 cipher := []string{} -141  -142 // col <= len because we need to capture incomplete tokens. -143 for col := 0; col <= len(tokens); col++ { -144 for _, row := range tokens { -145 if col < len(row) { -146 sb.WriteString(string(row[col])) -147 } -148 } -149  -150 // To prevent from ending with an empty token. -151 // Write a token to the slice. -152 if len(sb.String()) > 0 { -153 cipher = append(cipher, sb.String()) -154 } -155 sb.Reset() -156 } -157  -158 return cipher -159 } +134 func EncodeTokens(tokens []string) []string { +135 if len(tokens) == 0 { +136 MISS return []string{} +137 } +138 +139 var sb strings.Builder +140 cipher := []string{} +141 +142 // col <= len because we need to capture incomplete tokens. +143 for col := 0; col <= len(tokens); col++ { +144 for _, row := range tokens { +145 if col < len(row) { +146 sb.WriteString(string(row[col])) +147 } +148 } +149 +150 // To prevent from ending with an empty token. +151 // Write a token to the slice. +152 if len(sb.String()) > 0 { +153 cipher = append(cipher, sb.String()) +154 } +155 sb.Reset() +156 } +157 +158 return cipher +159 } -71 func GetSquareDimmensions(text string) (row, col int) { -72 size := len(text) -73  -74 if size == 0 { -75 return -76 } -77  -78 if size == 1 { -79 row, col = 1, 1 -80 return -81 } -82  -83 for c := 1; c <= size; c++ { -84 for r := 1; r < size; r++ { -85 if r*c >= size && c >= r && c-r <= 1 { -86 row, col = r, c -87 return -88 } -89 } -90 } -91  -92 return -93 } +71 func GetSquareDimmensions(text string) (row, col int) { +72 size := len(text) +73 +74 if size == 0 { +75 MISS return +76 } +77 +78 if size == 1 { +79 row, col = 1, 1 +80 return +81 } +82 +83 for c := 1; c <= size; c++ { +84 for r := 1; r < size; r++ { +85 if r*c >= size && c >= r && c-r <= 1 { +86 row, col = r, c +87 return +88 } +89 } +90 } +91 +92 MISS return +93 } - 96 func GetTokens(text string) []string { - 97 if text == "" { - 98 return []string{} - 99 } -100  -101 row, col := GetSquareDimmensions(NormalizeText(text)) -102  -103 tokens := []string{} -104 var token strings.Builder -105 var count int -106  -107 for _, char := range text { -108 count++ -109 token.WriteString(string(char)) -110  -111 // Write a token to the slice. -112 if count == col { -113 tokens = append(tokens, token.String()) -114 token.Reset() -115 count = 0 -116 } -117 } -118  -119 // Prevent empty tokens from being captured. -120 if len(token.String()) > 0 { -121 tokens = append(tokens, token.String()) -122 } -123  -124 // Count can be zero or larger than col. -125 // Catch incomplete tokens and add whitespace padd them. -126 if count > 0 && count < col { -127 tokens[row-1] += strings.Repeat(" ", col-count) -128 } -129  -130 return tokens -131 } + 96 func GetTokens(text string) []string { + 97 if text == "" { + 98 MISS return []string{} + 99 } +100 +101 row, col := GetSquareDimmensions(NormalizeText(text)) +102 +103 tokens := []string{} +104 var token strings.Builder +105 var count int +106 +107 for _, char := range text { +108 count++ +109 token.WriteString(string(char)) +110 +111 // Write a token to the slice. +112 if count == col { +113 tokens = append(tokens, token.String()) +114 token.Reset() +115 count = 0 +116 } +117 } +118 +119 // Prevent empty tokens from being captured. +120 if len(token.String()) > 0 { +121 tokens = append(tokens, token.String()) +122 } +123 +124 // Count can be zero or larger than col. +125 // Catch incomplete tokens and add whitespace padd them. +126 if count > 0 && count < col { +127 tokens[row-1] += strings.Repeat(" ", col-count) +128 } +129 +130 return tokens +131 } -49 func NormalizeText(text string) string { -50 if text == "" { -51 return "" -52 } -53  -54 var output string -55  -56 reStr := `[[:^alnum:]]+` -57 re, err := regexp.Compile(reStr) -58 if err != nil { -59 panic(err) -60 } -61  -62 // If it's not A-Z, a-z or 0-9, replace it with an empty string. -63 output = re.ReplaceAllString(text, "") -64  -65 output = strings.ToLower(output) -66  -67 return output -68 } +49 func NormalizeText(text string) string { +50 if text == "" { +51 MISS return "" +52 } +53 +54 var output string +55 +56 reStr := `[[:^alnum:]]+` +57 re, err := regexp.Compile(reStr) +58 if err != nil { +59 MISS panic(err) +60 } +61 +62 // If it's not A-Z, a-z or 0-9, replace it with an empty string. +63 output = re.ReplaceAllString(text, "") +64 +65 output = strings.ToLower(output) +66 +67 return output +68 } diff --git a/go/crypto-square/coverage.out b/go/crypto-square/coverage.out index e58d7c7f..8e726572 100644 --- a/go/crypto-square/coverage.out +++ b/go/crypto-square/coverage.out @@ -1,46 +1,46 @@ mode: count cryptosquare/crypto_square.go:14.34,15.17 1 20 -cryptosquare/crypto_square.go:19.2,19.15 1 19 -cryptosquare/crypto_square.go:23.2,25.15 2 19 -cryptosquare/crypto_square.go:29.2,31.15 2 19 -cryptosquare/crypto_square.go:35.2,37.15 2 19 -cryptosquare/crypto_square.go:41.2,43.15 2 19 cryptosquare/crypto_square.go:15.17,17.3 1 1 +cryptosquare/crypto_square.go:19.2,19.15 1 19 cryptosquare/crypto_square.go:19.15,21.3 1 0 +cryptosquare/crypto_square.go:23.2,25.15 2 19 cryptosquare/crypto_square.go:25.15,27.3 1 0 +cryptosquare/crypto_square.go:29.2,31.15 2 19 cryptosquare/crypto_square.go:31.15,33.3 1 0 +cryptosquare/crypto_square.go:35.2,37.15 2 19 cryptosquare/crypto_square.go:37.15,39.3 1 0 +cryptosquare/crypto_square.go:41.2,43.15 2 19 cryptosquare/crypto_square.go:49.40,50.16 1 42 -cryptosquare/crypto_square.go:54.2,58.16 4 42 -cryptosquare/crypto_square.go:63.2,67.15 3 42 cryptosquare/crypto_square.go:50.16,52.3 1 0 +cryptosquare/crypto_square.go:54.2,58.16 4 42 cryptosquare/crypto_square.go:58.16,59.13 1 0 +cryptosquare/crypto_square.go:63.2,67.15 3 42 cryptosquare/crypto_square.go:71.55,74.15 2 23 -cryptosquare/crypto_square.go:78.2,78.15 1 23 -cryptosquare/crypto_square.go:83.2,83.29 1 22 -cryptosquare/crypto_square.go:92.2,92.8 1 0 cryptosquare/crypto_square.go:74.15,76.3 1 0 +cryptosquare/crypto_square.go:78.2,78.15 1 23 cryptosquare/crypto_square.go:78.15,81.3 2 1 +cryptosquare/crypto_square.go:83.2,83.29 1 22 cryptosquare/crypto_square.go:83.29,84.29 1 101 cryptosquare/crypto_square.go:84.29,85.41 1 2542 cryptosquare/crypto_square.go:85.41,88.5 2 22 +cryptosquare/crypto_square.go:92.2,92.8 1 0 cryptosquare/crypto_square.go:96.38,97.16 1 21 -cryptosquare/crypto_square.go:101.2,107.28 5 21 -cryptosquare/crypto_square.go:120.2,120.29 1 21 -cryptosquare/crypto_square.go:126.2,126.30 1 21 -cryptosquare/crypto_square.go:130.2,130.15 1 21 cryptosquare/crypto_square.go:97.16,99.3 1 0 +cryptosquare/crypto_square.go:101.2,107.28 5 21 cryptosquare/crypto_square.go:107.28,112.19 3 411 cryptosquare/crypto_square.go:112.19,116.4 3 68 +cryptosquare/crypto_square.go:120.2,120.29 1 21 cryptosquare/crypto_square.go:120.29,122.3 1 11 +cryptosquare/crypto_square.go:126.2,126.30 1 21 cryptosquare/crypto_square.go:126.30,128.3 1 11 +cryptosquare/crypto_square.go:130.2,130.15 1 21 cryptosquare/crypto_square.go:134.45,135.22 1 21 -cryptosquare/crypto_square.go:139.2,143.42 3 21 -cryptosquare/crypto_square.go:158.2,158.15 1 21 cryptosquare/crypto_square.go:135.22,137.3 1 0 +cryptosquare/crypto_square.go:139.2,143.42 3 21 cryptosquare/crypto_square.go:143.42,144.30 1 100 -cryptosquare/crypto_square.go:152.3,152.27 1 100 -cryptosquare/crypto_square.go:155.3,155.13 1 100 cryptosquare/crypto_square.go:144.30,145.22 1 456 cryptosquare/crypto_square.go:145.22,147.5 1 431 +cryptosquare/crypto_square.go:152.3,152.27 1 100 cryptosquare/crypto_square.go:152.27,154.4 1 92 +cryptosquare/crypto_square.go:155.3,155.13 1 100 +cryptosquare/crypto_square.go:158.2,158.15 1 21 diff --git a/go/crypto-square/run-tests-go.txt b/go/crypto-square/run-tests-go.txt index 27b26dcb..a417abc1 100644 --- a/go/crypto-square/run-tests-go.txt +++ b/go/crypto-square/run-tests-go.txt @@ -5,56 +5,615 @@ Go packages: cryptosquare =============================================================================== -golint ./... - -real 0m0.129s -user 0m0.164s -sys 0m0.121s +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.022s +sys 0m0.028s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +crypto_square.go:20:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo) + fmt.Printf("plain: %q\n", plain) + ^ +crypto_square.go:26:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo) + fmt.Printf("plain: %q\n", normalizedText) + ^ +crypto_square.go:32:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo) + fmt.Printf("plainTokens: %#v\n", plainTokens) + ^ +crypto_square_examples_test.go:61: File is not `gofmt`-ed with `-s` (gofmt) + []string{"ifmanwas", "meanttos", "tayonthe", "groundgo", "dwouldha", "vegivenu", "sroots "}, + []string{"12", "34"}, +crypto_square_test.go:90:21: Using the variable on range scope `test` in function literal (scopelint) + if got := Encode(test.input); got != test.expected { + ^ +crypto_square_test.go:91:47: Using the variable on range scope `test` in function literal (scopelint) + t.Errorf("Encode(%q):\n got:%q\nwant:%q", test.input, got, test.expected) + ^ +crypto_square.go:58:2: only one cuddle assignment allowed before if statement (wsl) + if err != nil { + ^ +crypto_square.go:104:2: declarations should never be cuddled (wsl) + var token strings.Builder + ^ +crypto_square.go:105:2: declarations should never be cuddled (wsl) + var count int + ^ +crypto_square.go:109:3: only cuddled expressions if assigning variable or using from line above (wsl) + token.WriteString(string(char)) + ^ +crypto_square.go:115:4: assignments should only be cuddled with other assignments (wsl) + count = 0 + ^ +crypto_square.go:140:2: assignments should only be cuddled with other assignments (wsl) + cipher := []string{} + ^ +crypto_square.go:155:3: expressions should not be cuddled with blocks (wsl) + sb.Reset() + ^ +crypto_square_test.go:101:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +crypto_square.go:11:5: debugMode is a global variable (gochecknoglobals) +var debugMode = false + ^ +crypto_square_test.go:5:5: tests is a global variable (gochecknoglobals) +var tests = []struct { + ^ +crypto_square.go:80:3: return with no blank line before (nlreturn) + return + ^ +crypto_square.go:87:5: return with no blank line before (nlreturn) + return + ^ +crypto_square.go:71:1: named return "row" with type "int" found (nonamedreturns) +func GetSquareDimmensions(text string) (row, col int) { +^ +crypto_square_test.go:87:1: Function TestEncode missing the call to method parallel (paralleltest) +func TestEncode(t *testing.T) { +^ +crypto_square_test.go:88:2: Range statement for test TestEncode missing the call to method parallel in test Run (paralleltest) + for _, test := range tests { + ^ +crypto_square_examples_test.go:1:9: package should be `cryptosquare_test` instead of `cryptosquare` (testpackage) +package cryptosquare + ^ +crypto_square_test.go:1:9: package should be `cryptosquare_test` instead of `cryptosquare` (testpackage) +package cryptosquare + ^ +crypto_square.go:57:2: variable name 're' is too short for the scope of its usage (varnamelen) + re, err := regexp.Compile(reStr) + ^ +crypto_square.go:139:6: variable name 'sb' is too short for the scope of its usage (varnamelen) + var sb strings.Builder + ^ + +real 0m0.567s +user 0m0.831s +sys 0m0.527s + + + ============================================================================== + +Exit code: -1 + +real 0m0.608s +user 0m0.864s +sys 0m0.568s + +real 0m0.613s +user 0m0.867s +sys 0m0.570s =============================================================================== -revive ./... +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.022s +sys 0m0.028s + -real 0m0.052s -user 0m0.044s -sys 0m0.052s + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.093s +user 0m0.046s +sys 0m0.081s + + + ============================================================================== + +Exit code: 0 + +real 0m0.128s +user 0m0.075s +sys 0m0.118s + +real 0m0.130s +user 0m0.076s +sys 0m0.119s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.589s -user 0m0.656s -sys 0m0.489s +real 0m0.004s +user 0m0.000s +sys 0m0.003s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.023s +sys 0m0.025s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." +internal error: package "fmt" without types was imported from "cryptosquare" -real 0m1.645s -user 0m2.635s -sys 0m1.102s +real 0m0.099s +user 0m0.123s +sys 0m0.137s + + + ============================================================================== + +Exit code: -1 + +real 0m0.137s +user 0m0.150s +sys 0m0.175s + +real 0m0.145s +user 0m0.152s +sys 0m0.181s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.018s +sys 0m0.030s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.164s +user 0m0.214s +sys 0m0.127s + + + ============================================================================== + +Exit code: 0 + +real 0m0.200s +user 0m0.238s +sys 0m0.168s + +real 0m0.203s +user 0m0.240s +sys 0m0.169s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.026s +sys 0m0.026s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m1.000s +user 0m2.334s +sys 0m0.336s + + + ============================================================================== + +Exit code: 0 + +real 0m1.034s +user 0m2.366s +sys 0m0.369s + +real 0m1.035s +user 0m2.367s +sys 0m0.369s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.018s +sys 0m0.028s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.145s +user 0m0.176s +sys 0m0.194s + + + ============================================================================== + +Exit code: 0 + +real 0m0.189s +user 0m0.198s +sys 0m0.240s + +real 0m0.191s +user 0m0.199s +sys 0m0.241s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-fixer-go_fix -real 0m1.018s -user 0m1.217s -sys 0m0.952s +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.035s +user 0m0.039s +sys 0m0.059s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.028s +user 0m0.025s +sys 0m0.024s + + + ============================================================================== + +Exit code: 0 + +real 0m0.076s +user 0m0.072s +sys 0m0.092s + +real 0m0.079s +user 0m0.074s +sys 0m0.094s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 -real 0m6.601s -user 0m10.393s -sys 0m2.822s + + ============================================================================== + +Running: go clean ./... + + +real 0m0.035s +user 0m0.023s +sys 0m0.039s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.474s +user 0m1.241s +sys 0m0.263s + + + ============================================================================== + +Exit code: 0 + +real 0m0.521s +user 0m1.268s +sys 0m0.315s + +real 0m0.523s +user 0m1.270s +sys 0m0.315s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.019s +sys 0m0.031s + + + ============================================================================== + +Running: gocyclo . + +8 cryptosquare GetSquareDimmensions crypto_square.go:71:1 +7 cryptosquare GetTokens crypto_square.go:96:1 +6 cryptosquare EncodeTokens crypto_square.go:134:1 +6 cryptosquare Encode crypto_square.go:14:1 +4 cryptosquare BenchmarkEncode crypto_square_test.go:97:1 +3 cryptosquare TestEncode crypto_square_test.go:87:1 +3 cryptosquare NormalizeText crypto_square.go:49:1 +2 cryptosquare ExampleEncodeTokens crypto_square_examples_test.go:59:1 +2 cryptosquare ExampleGetTokens crypto_square_examples_test.go:41:1 +2 cryptosquare ExampleGetSquareDimmensions crypto_square_examples_test.go:22:1 +2 cryptosquare ExampleNormalizeText crypto_square_examples_test.go:5:1 +1 cryptosquare ExampleEncode crypto_square_examples_test.go:78:1 + +real 0m0.002s +user 0m0.001s +sys 0m0.001s + + + ============================================================================== + +Exit code: 0 + +real 0m0.038s +user 0m0.028s +sys 0m0.040s + +real 0m0.040s +user 0m0.028s +sys 0m0.041s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.035s +user 0m0.028s +sys 0m0.017s + + + ============================================================================== + +Exit code: 0 + +real 0m0.047s +user 0m0.035s +sys 0m0.025s + +real 0m0.048s +user 0m0.035s +sys 0m0.027s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.024s +sys 0m0.023s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:21:57 Including rules: default +[gosec] 2023/09/07 00:21:57 Excluding rules: default +[gosec] 2023/09/07 00:21:57 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/crypto-square +[gosec] 2023/09/07 00:21:57 Checking package: cryptosquare +[gosec] 2023/09/07 00:21:57 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/crypto-square/crypto_square.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 159 + Nosec : 0 + Issues : 0 + + +real 0m0.129s +user 0m0.149s +sys 0m0.110s + + + ============================================================================== + +Exit code: 0 + +real 0m0.166s +user 0m0.180s +sys 0m0.142s + +real 0m0.168s +user 0m0.180s +sys 0m0.143s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.034s +user 0m0.030s +sys 0m0.038s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestEncode === RUN TestEncode/s#$%^&plunk === RUN TestEncode/1,_2,_3_GO! @@ -107,15 +666,17 @@ gotest -v -covermode=count -coverprofile coverage.out ./... --- PASS: ExampleEncode (0.00s) PASS coverage: 85.1% of statements -ok cryptosquare 0.014s coverage: 85.1% of statements +ok cryptosquare 0.002s coverage: 85.1% of statements -real 0m1.301s -user 0m1.599s -sys 0m0.896s +real 0m0.206s +user 0m0.293s +sys 0m0.169s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + cryptosquare/crypto_square.go:14: Encode 73.3% cryptosquare/crypto_square.go:49: NormalizeText 80.0% cryptosquare/crypto_square.go:71: GetSquareDimmensions 83.3% @@ -123,175 +684,186 @@ cryptosquare/crypto_square.go:96: GetTokens 94.4% cryptosquare/crypto_square.go:134: EncodeTokens 91.7% total: (statements) 85.1% -real 0m0.519s -user 0m0.330s -sys 0m0.586s +real 0m0.065s +user 0m0.083s +sys 0m0.088s + + + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.049s +user 0m0.073s +sys 0m0.063s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +14 func Encode(plain string) string { +15 if plain == "" { +16 return "" +17 } +18 +19 if debugMode { +20 MISS fmt.Printf("plain: %q\n", plain) +21 } +22 +23 normalizedText := NormalizeText(plain) +24 +25 if debugMode { +26 MISS fmt.Printf("plain: %q\n", normalizedText) +27 } +28 +29 plainTokens := GetTokens(normalizedText) +30 +31 if debugMode { +32 MISS fmt.Printf("plainTokens: %#v\n", plainTokens) +33 } +34 +35 encodedTokens := EncodeTokens(plainTokens) +36 +37 if debugMode { +38 MISS fmt.Printf("encodedTokens: %#v\n", encodedTokens) +39 } +40 +41 cipher := strings.Join(encodedTokens, " ") +42 +43 return cipher +44 } + + +134 func EncodeTokens(tokens []string) []string { +135 if len(tokens) == 0 { +136 MISS return []string{} +137 } +138 +139 var sb strings.Builder +140 cipher := []string{} +141 +142 // col <= len because we need to capture incomplete tokens. +143 for col := 0; col <= len(tokens); col++ { +144 for _, row := range tokens { +145 if col < len(row) { +146 sb.WriteString(string(row[col])) +147 } +148 } +149 +150 // To prevent from ending with an empty token. +151 // Write a token to the slice. +152 if len(sb.String()) > 0 { +153 cipher = append(cipher, sb.String()) +154 } +155 sb.Reset() +156 } +157 +158 return cipher +159 } + + +71 func GetSquareDimmensions(text string) (row, col int) { +72 size := len(text) +73 +74 if size == 0 { +75 MISS return +76 } +77 +78 if size == 1 { +79 row, col = 1, 1 +80 return +81 } +82 +83 for c := 1; c <= size; c++ { +84 for r := 1; r < size; r++ { +85 if r*c >= size && c >= r && c-r <= 1 { +86 row, col = r, c +87 return +88 } +89 } +90 } +91 +92 MISS return +93 } + + + 96 func GetTokens(text string) []string { + 97 if text == "" { + 98 MISS return []string{} + 99 } +100 +101 row, col := GetSquareDimmensions(NormalizeText(text)) +102 +103 tokens := []string{} +104 var token strings.Builder +105 var count int +106 +107 for _, char := range text { +108 count++ +109 token.WriteString(string(char)) +110 +111 // Write a token to the slice. +112 if count == col { +113 tokens = append(tokens, token.String()) +114 token.Reset() +115 count = 0 +116 } +117 } +118 +119 // Prevent empty tokens from being captured. +120 if len(token.String()) > 0 { +121 tokens = append(tokens, token.String()) +122 } +123 +124 // Count can be zero or larger than col. +125 // Catch incomplete tokens and add whitespace padd them. +126 if count > 0 && count < col { +127 tokens[row-1] += strings.Repeat(" ", col-count) +128 } +129 +130 return tokens +131 } + + +49 func NormalizeText(text string) string { +50 if text == "" { +51 MISS return "" +52 } +53 +54 var output string +55 +56 reStr := `[[:^alnum:]]+` +57 re, err := regexp.Compile(reStr) +58 if err != nil { +59 MISS panic(err) +60 } +61 +62 // If it's not A-Z, a-z or 0-9, replace it with an empty string. +63 output = re.ReplaceAllString(text, "") +64 +65 output = strings.ToLower(output) +66 +67 return output +68 } + + +real 0m0.020s +user 0m0.024s +sys 0m0.023s + +real 0m0.020s +user 0m0.024s +sys 0m0.023s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -=============================================================================== - -go tool cover -html coverage.out -o coverage.html - -real 0m0.354s -user 0m0.396s -sys 0m0.338s - -=============================================================================== - -gocov convert coverage.out | gocov annotate -ceiling=100 -color - | tee coverage-annotations.txt - -14 func Encode(plain string) string { -15 if plain == "" { -16 return "" -17 } -18  -19 if debugMode { -20 fmt.Printf("plain: %q\n", plain) -21 } -22  -23 normalizedText := NormalizeText(plain) -24  -25 if debugMode { -26 fmt.Printf("plain: %q\n", normalizedText) -27 } -28  -29 plainTokens := GetTokens(normalizedText) -30  -31 if debugMode { -32 fmt.Printf("plainTokens: %#v\n", plainTokens) -33 } -34  -35 encodedTokens := EncodeTokens(plainTokens) -36  -37 if debugMode { -38 fmt.Printf("encodedTokens: %#v\n", encodedTokens) -39 } -40  -41 cipher := strings.Join(encodedTokens, " ") -42  -43 return cipher -44 } - - -134 func EncodeTokens(tokens []string) []string { -135 if len(tokens) == 0 { -136 return []string{} -137 } -138  -139 var sb strings.Builder -140 cipher := []string{} -141  -142 // col <= len because we need to capture incomplete tokens. -143 for col := 0; col <= len(tokens); col++ { -144 for _, row := range tokens { -145 if col < len(row) { -146 sb.WriteString(string(row[col])) -147 } -148 } -149  -150 // To prevent from ending with an empty token. -151 // Write a token to the slice. -152 if len(sb.String()) > 0 { -153 cipher = append(cipher, sb.String()) -154 } -155 sb.Reset() -156 } -157  -158 return cipher -159 } - - -71 func GetSquareDimmensions(text string) (row, col int) { -72 size := len(text) -73  -74 if size == 0 { -75 return -76 } -77  -78 if size == 1 { -79 row, col = 1, 1 -80 return -81 } -82  -83 for c := 1; c <= size; c++ { -84 for r := 1; r < size; r++ { -85 if r*c >= size && c >= r && c-r <= 1 { -86 row, col = r, c -87 return -88 } -89 } -90 } -91  -92 return -93 } - - - 96 func GetTokens(text string) []string { - 97 if text == "" { - 98 return []string{} - 99 } -100  -101 row, col := GetSquareDimmensions(NormalizeText(text)) -102  -103 tokens := []string{} -104 var token strings.Builder -105 var count int -106  -107 for _, char := range text { -108 count++ -109 token.WriteString(string(char)) -110  -111 // Write a token to the slice. -112 if count == col { -113 tokens = append(tokens, token.String()) -114 token.Reset() -115 count = 0 -116 } -117 } -118  -119 // Prevent empty tokens from being captured. -120 if len(token.String()) > 0 { -121 tokens = append(tokens, token.String()) -122 } -123  -124 // Count can be zero or larger than col. -125 // Catch incomplete tokens and add whitespace padd them. -126 if count > 0 && count < col { -127 tokens[row-1] += strings.Repeat(" ", col-count) -128 } -129  -130 return tokens -131 } - - -49 func NormalizeText(text string) string { -50 if text == "" { -51 return "" -52 } -53  -54 var output string -55  -56 reStr := `[[:^alnum:]]+` -57 re, err := regexp.Compile(reStr) -58 if err != nil { -59 panic(err) -60 } -61  -62 // If it's not A-Z, a-z or 0-9, replace it with an empty string. -63 output = re.ReplaceAllString(text, "") -64  -65 output = strings.ToLower(output) -66  -67 return output -68 } - - -real 0m0.106s -user 0m0.076s -sys 0m0.123s - -=============================================================================== - -gotest -v -race -covermode=atomic cryptosquare === RUN TestEncode === RUN TestEncode/s#$%^&plunk === RUN TestEncode/1,_2,_3_GO! @@ -312,7 +884,7 @@ gotest -v -race -covermode=atomic cryptosquare === RUN TestEncode/123456789a === RUN TestEncode/If_man_was_meant_to_stay_on_the_ground_god_would_have_given_us_roots === RUN TestEncode/Have_a_nice_day._Feed_the_dog_&_chill_out! ---- PASS: TestEncode (0.02s) +--- PASS: TestEncode (0.00s) --- PASS: TestEncode/s#$%^&plunk (0.00s) --- PASS: TestEncode/1,_2,_3_GO! (0.00s) --- PASS: TestEncode/1234 (0.00s) @@ -344,104 +916,154 @@ gotest -v -race -covermode=atomic cryptosquare --- PASS: ExampleEncode (0.00s) PASS coverage: 85.1% of statements -ok cryptosquare 0.127s coverage: 85.1% of statements - -real 0m1.584s -user 0m1.658s -sys 0m0.972s +ok cryptosquare 1.019s coverage: 85.1% of statements -=============================================================================== +real 0m1.258s +user 0m0.289s +sys 0m0.176s -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -goos: linux -goarch: amd64 -pkg: cryptosquare -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkEncode-4 2530 402031 ns/op 42270 B/op 845 allocs/op -PASS -ok cryptosquare 1.144s -real 0m2.109s -user 0m2.981s -sys 0m0.930s + ============================================================================== -=============================================================================== +Exit code: 0 -go test -tags bonus -PASS -ok cryptosquare 0.043s +real 0m1.645s +user 0m0.800s +sys 0m0.565s -real 0m0.775s -user 0m0.875s -sys 0m0.528s +real 0m1.647s +user 0m0.800s +sys 0m0.567s =============================================================================== -No old benchmarks to run benchstat against. - -=============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go vet ./... +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +goos: linux +goarch: amd64 +pkg: cryptosquare +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkEncode +BenchmarkEncode-8 18175 65310 ns/op 42655 B/op 840 allocs/op +PASS +ok cryptosquare 1.862s -real 0m0.515s -user 0m0.614s -sys 0m0.521s +real 0m2.013s +user 0m2.099s +sys 0m0.203s =============================================================================== -go fix ./... - -real 0m0.189s -user 0m0.108s -sys 0m0.207s - -=============================================================================== - -gocyclo . -8 cryptosquare GetSquareDimmensions crypto_square.go:71:1 -7 cryptosquare GetTokens crypto_square.go:96:1 -6 cryptosquare EncodeTokens crypto_square.go:134:1 -6 cryptosquare Encode crypto_square.go:14:1 -4 cryptosquare BenchmarkEncode crypto_square_test.go:97:1 -3 cryptosquare TestEncode crypto_square_test.go:87:1 -3 cryptosquare NormalizeText crypto_square.go:49:1 -2 cryptosquare ExampleEncodeTokens crypto_square_examples_test.go:59:1 -2 cryptosquare ExampleGetTokens crypto_square_examples_test.go:41:1 -2 cryptosquare ExampleGetSquareDimmensions crypto_square_examples_test.go:22:1 -2 cryptosquare ExampleNormalizeText crypto_square_examples_test.go:5:1 -1 cryptosquare ExampleEncode crypto_square_examples_test.go:78:1 +gotest -v -tags bonus +=== RUN TestEncode +=== RUN TestEncode/s#$%^&plunk +=== RUN TestEncode/1,_2,_3_GO! +=== RUN TestEncode/1234 +=== RUN TestEncode/123456789 +=== RUN TestEncode/123456789abc +=== RUN TestEncode/Never_vex_thine_heart_with_idle_woes +=== RUN TestEncode/ZOMG!_ZOMBIES!!! +=== RUN TestEncode/Time_is_an_illusion._Lunchtime_doubly_so. +=== RUN TestEncode/We_all_know_interspecies_romance_is_weird. +=== RUN TestEncode/Madness,_and_then_illumination. +=== RUN TestEncode/Vampires_are_people_too! +=== RUN TestEncode/#00 +=== RUN TestEncode/1 +=== RUN TestEncode/12 +=== RUN TestEncode/12_3 +=== RUN TestEncode/12345678 +=== RUN TestEncode/123456789a +=== RUN TestEncode/If_man_was_meant_to_stay_on_the_ground_god_would_have_given_us_roots +=== RUN TestEncode/Have_a_nice_day._Feed_the_dog_&_chill_out! +--- PASS: TestEncode (0.00s) + --- PASS: TestEncode/s#$%^&plunk (0.00s) + --- PASS: TestEncode/1,_2,_3_GO! (0.00s) + --- PASS: TestEncode/1234 (0.00s) + --- PASS: TestEncode/123456789 (0.00s) + --- PASS: TestEncode/123456789abc (0.00s) + --- PASS: TestEncode/Never_vex_thine_heart_with_idle_woes (0.00s) + --- PASS: TestEncode/ZOMG!_ZOMBIES!!! (0.00s) + --- PASS: TestEncode/Time_is_an_illusion._Lunchtime_doubly_so. (0.00s) + --- PASS: TestEncode/We_all_know_interspecies_romance_is_weird. (0.00s) + --- PASS: TestEncode/Madness,_and_then_illumination. (0.00s) + --- PASS: TestEncode/Vampires_are_people_too! (0.00s) + --- PASS: TestEncode/#00 (0.00s) + --- PASS: TestEncode/1 (0.00s) + --- PASS: TestEncode/12 (0.00s) + --- PASS: TestEncode/12_3 (0.00s) + --- PASS: TestEncode/12345678 (0.00s) + --- PASS: TestEncode/123456789a (0.00s) + --- PASS: TestEncode/If_man_was_meant_to_stay_on_the_ground_god_would_have_given_us_roots (0.00s) + --- PASS: TestEncode/Have_a_nice_day._Feed_the_dog_&_chill_out! (0.00s) +=== RUN ExampleNormalizeText +--- PASS: ExampleNormalizeText (0.00s) +=== RUN ExampleGetSquareDimmensions +--- PASS: ExampleGetSquareDimmensions (0.00s) +=== RUN ExampleGetTokens +--- PASS: ExampleGetTokens (0.00s) +=== RUN ExampleEncodeTokens +--- PASS: ExampleEncodeTokens (0.00s) +=== RUN ExampleEncode +--- PASS: ExampleEncode (0.00s) +PASS +ok cryptosquare 0.004s -real 0m0.021s -user 0m0.013s -sys 0m0.009s +real 0m0.147s +user 0m0.212s +sys 0m0.156s =============================================================================== -misspell . +benchstat benchstat-old.txt benchstat-new.txt +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: cryptosquare +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Encode-8 65.31µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Encode-8 41.66Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Encode-8 840.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.203s -user 0m0.229s -sys 0m0.068s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Encode-4 402.0µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +Encode-4 41.28Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./... -[gosec] 2022/08/19 22:21:56 Including rules: default -[gosec] 2022/08/19 22:21:56 Excluding rules: default -[gosec] 2022/08/19 22:21:56 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/crypto-square -2022/08/19 22:21:57 internal error: package "fmt" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +Encode-4 845.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.797s -user 0m0.835s -sys 0m0.585s +real 0m0.002s +user 0m0.001s +sys 0m0.001s =============================================================================== gomarkdoc --output cryptosquare-doc.md -real 0m0.044s -user 0m0.042s -sys 0m0.022s +real 0m0.010s +user 0m0.004s +sys 0m0.006s =============================================================================== @@ -470,9 +1092,9 @@ func NormalizeText(text string) string removed from the English text. - The message is down-cased. -real 0m0.274s -user 0m0.170s -sys 0m0.252s +real 0m0.038s +user 0m0.025s +sys 0m0.039s =============================================================================== diff --git a/go/custom-set/benchstat-new.txt b/go/custom-set/benchstat-new.txt index b341e466..b28d5736 100644 --- a/go/custom-set/benchstat-new.txt +++ b/go/custom-set/benchstat-new.txt @@ -1,14 +1,14 @@ goos: linux goarch: amd64 pkg: stringset -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkNewFromSlice1e1 -BenchmarkNewFromSlice1e1-4 4052859 298.9 ns/op 0 B/op 0 allocs/op +BenchmarkNewFromSlice1e1-8 7917919 144.1 ns/op 0 B/op 0 allocs/op BenchmarkNewFromSlice1e2 -BenchmarkNewFromSlice1e2-4 57602 24311 ns/op 5096 B/op 7 allocs/op +BenchmarkNewFromSlice1e2-8 220611 5633 ns/op 4978 B/op 6 allocs/op BenchmarkNewFromSlice1e3 -BenchmarkNewFromSlice1e3-4 4417 243157 ns/op 42533 B/op 19 allocs/op +BenchmarkNewFromSlice1e3-8 21044 59360 ns/op 41621 B/op 13 allocs/op BenchmarkNewFromSlice1e4 -BenchmarkNewFromSlice1e4-4 667 2096502 ns/op 351308 B/op 176 allocs/op +BenchmarkNewFromSlice1e4-8 1183 955058 ns/op 659628 B/op 99 allocs/op PASS -ok stringset 6.011s +ok stringset 6.595s diff --git a/go/custom-set/benchstat-old.txt b/go/custom-set/benchstat-old.txt new file mode 100644 index 00000000..b341e466 --- /dev/null +++ b/go/custom-set/benchstat-old.txt @@ -0,0 +1,14 @@ +goos: linux +goarch: amd64 +pkg: stringset +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkNewFromSlice1e1 +BenchmarkNewFromSlice1e1-4 4052859 298.9 ns/op 0 B/op 0 allocs/op +BenchmarkNewFromSlice1e2 +BenchmarkNewFromSlice1e2-4 57602 24311 ns/op 5096 B/op 7 allocs/op +BenchmarkNewFromSlice1e3 +BenchmarkNewFromSlice1e3-4 4417 243157 ns/op 42533 B/op 19 allocs/op +BenchmarkNewFromSlice1e4 +BenchmarkNewFromSlice1e4-4 667 2096502 ns/op 351308 B/op 176 allocs/op +PASS +ok stringset 6.011s diff --git a/go/custom-set/coverage.html b/go/custom-set/coverage.html index ba75a050..f3107cf1 100644 --- a/go/custom-set/coverage.html +++ b/go/custom-set/coverage.html @@ -147,7 +147,7 @@ } // Has returns true if the string is found in the Set, false if it doesn't. -func (s Set) Has(elem string) bool { +func (s Set) Has(elem string) bool { _, found := s[elem] return found @@ -176,7 +176,7 @@ return false } - for k := range s1 { + for k := range s1 { if !s2.Has(k) { return false } @@ -196,7 +196,7 @@ return false } - for k := range s1 { + for k := range s1 { if !s2.Has(k) { return false } diff --git a/go/custom-set/coverage.out b/go/custom-set/coverage.out index e41bcd4f..faf44fe6 100644 --- a/go/custom-set/coverage.out +++ b/go/custom-set/coverage.out @@ -1,50 +1,50 @@ mode: count stringset/custom_set.go:12.16,14.2 1 133 stringset/custom_set.go:17.38,20.25 2 106 -stringset/custom_set.go:24.2,24.10 1 106 stringset/custom_set.go:20.25,22.3 1 186 +stringset/custom_set.go:24.2,24.10 1 106 stringset/custom_set.go:28.30,29.17 1 30 -stringset/custom_set.go:33.2,41.19 5 27 -stringset/custom_set.go:45.2,47.25 2 27 -stringset/custom_set.go:59.2,61.20 2 27 stringset/custom_set.go:29.17,31.3 1 3 +stringset/custom_set.go:33.2,41.19 5 27 stringset/custom_set.go:41.19,43.3 1 71 +stringset/custom_set.go:45.2,47.25 2 27 stringset/custom_set.go:47.25,48.13 1 71 -stringset/custom_set.go:54.3,56.22 3 71 stringset/custom_set.go:48.13,50.4 1 44 stringset/custom_set.go:50.9,52.4 1 27 +stringset/custom_set.go:54.3,56.22 3 71 +stringset/custom_set.go:59.2,61.20 2 27 stringset/custom_set.go:65.29,67.2 1 11 -stringset/custom_set.go:70.36,74.2 2 80 +stringset/custom_set.go:70.36,74.2 2 78 stringset/custom_set.go:77.31,80.2 1 218 stringset/custom_set.go:83.30,85.34 1 7 -stringset/custom_set.go:90.2,90.33 1 6 -stringset/custom_set.go:95.2,95.33 1 5 -stringset/custom_set.go:99.2,99.20 1 4 -stringset/custom_set.go:105.2,105.13 1 2 stringset/custom_set.go:85.34,87.3 1 1 +stringset/custom_set.go:90.2,90.33 1 6 stringset/custom_set.go:90.33,92.3 1 1 +stringset/custom_set.go:95.2,95.33 1 5 stringset/custom_set.go:95.33,97.3 1 1 -stringset/custom_set.go:99.20,100.17 1 11 +stringset/custom_set.go:99.2,99.20 1 4 +stringset/custom_set.go:99.20,100.17 1 10 stringset/custom_set.go:100.17,102.4 1 2 +stringset/custom_set.go:105.2,105.13 1 2 stringset/custom_set.go:109.32,111.2 1 7 stringset/custom_set.go:114.29,115.24 1 24 -stringset/custom_set.go:119.2,119.20 1 21 -stringset/custom_set.go:125.2,125.13 1 19 stringset/custom_set.go:115.24,117.3 1 3 -stringset/custom_set.go:119.20,120.17 1 33 +stringset/custom_set.go:119.2,119.20 1 21 +stringset/custom_set.go:119.20,120.17 1 32 stringset/custom_set.go:120.17,122.4 1 2 +stringset/custom_set.go:125.2,125.13 1 19 stringset/custom_set.go:129.35,132.23 2 13 -stringset/custom_set.go:136.2,136.20 1 13 -stringset/custom_set.go:142.2,142.10 1 13 stringset/custom_set.go:132.23,134.3 1 3 +stringset/custom_set.go:136.2,136.20 1 13 stringset/custom_set.go:136.20,137.16 1 19 stringset/custom_set.go:137.16,139.4 1 5 +stringset/custom_set.go:142.2,142.10 1 13 stringset/custom_set.go:146.33,149.20 2 5 -stringset/custom_set.go:155.2,155.10 1 5 stringset/custom_set.go:149.20,150.17 1 10 stringset/custom_set.go:150.17,152.4 1 8 +stringset/custom_set.go:155.2,155.10 1 5 stringset/custom_set.go:159.28,162.20 2 5 -stringset/custom_set.go:166.2,166.20 1 5 -stringset/custom_set.go:170.2,170.10 1 5 stringset/custom_set.go:162.20,164.3 1 7 +stringset/custom_set.go:166.2,166.20 1 5 stringset/custom_set.go:166.20,168.3 1 6 +stringset/custom_set.go:170.2,170.10 1 5 diff --git a/go/custom-set/run-tests-go.txt b/go/custom-set/run-tests-go.txt index 46eec7bf..2708f77a 100644 --- a/go/custom-set/run-tests-go.txt +++ b/go/custom-set/run-tests-go.txt @@ -5,81 +5,572 @@ Go packages: stringset =============================================================================== -golangci-lint run ./... - -real 0m10.506s -user 0m20.868s -sys 0m4.242s +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.025s +sys 0m0.021s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +cases_test.go:9:42: Comment should end in a period (godot) + // unary function, bool result (IsEmpty) + ^ +cases_test.go:15:44: Comment should end in a period (godot) + // set-element function, bool result (Has) + ^ +cases_test.go:22:59: Comment should end in a period (godot) + // binary function, bool result (Subset, Disjoint, Equal) + ^ +custom_set.go:37: File is not `gofumpt`-ed (gofumpt) + var first = true +custom_set_test.go:50:22: Using the variable on range scope `tc` in function literal (scopelint) + s := NewFromSlice(tc.set) + ^ +custom_set_test.go:52:14: Using the variable on range scope `tc` in function literal (scopelint) + if got != tc.want { + ^ +custom_set_test.go:53:50: Using the variable on range scope `tc` in function literal (scopelint) + t.Errorf("%v IsEmpty = %t, want %t", s, got, tc.want) + ^ +custom_set_test.go:42:2: only one cuddle assignment allowed before if statement (wsl) + if got != want1 && got != want2 { // order undefined + ^ +custom_set_test.go:146:2: assignments should only be cuddled with other assignments (wsl) + s := make([]string, nAdd) + ^ +custom_set_test.go:147:2: only one cuddle assignment allowed before range statement (wsl) + for i := range s { + ^ +custom_set_test.go:150:2: expressions should not be cuddled with blocks (wsl) + b.ResetTimer() + ^ +custom_set_test.go:151:2: only one cuddle assignment allowed before for statement (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:46:5: emptyCases is a global variable (gochecknoglobals) +var emptyCases = []unaryBoolCase{ + ^ +cases_test.go:60:5: containsCases is a global variable (gochecknoglobals) +var containsCases = []eleBoolCase{ + ^ +cases_test.go:82:5: subsetCases is a global variable (gochecknoglobals) +var subsetCases = []binBoolCase{ + ^ +cases_test.go:122:5: disjointCases is a global variable (gochecknoglobals) +var disjointCases = []binBoolCase{ + ^ +cases_test.go:156:5: equalCases is a global variable (gochecknoglobals) +var equalCases = []binBoolCase{ + ^ +cases_test.go:196:5: addCases is a global variable (gochecknoglobals) +var addCases = []eleOpCase{ + ^ +cases_test.go:218:5: intersectionCases is a global variable (gochecknoglobals) +var intersectionCases = []binOpCase{ + ^ +cases_test.go:252:5: differenceCases is a global variable (gochecknoglobals) +var differenceCases = []binOpCase{ + ^ +cases_test.go:280:5: unionCases is a global variable (gochecknoglobals) +var unionCases = []binOpCase{ + ^ +custom_set_test.go:14:2: variable 'want' is only used in the if-statement (custom_set_test.go:15:2); consider using short syntax (ifshort) + want := "{}" + ^ +custom_set_test.go:40:2: variable 'want1' is only used in the if-statement (custom_set_test.go:42:2); consider using short syntax (ifshort) + want1 := `{"a", "b"}` + ^ +custom_set_test.go:41:2: variable 'want2' is only used in the if-statement (custom_set_test.go:42:2); consider using short syntax (ifshort) + want2 := `{"b", "a"}` + ^ +custom_set_examples_test.go:24:6: ExampleSet_IsEmpty contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleSet_IsEmpty() { + ^ +custom_set_examples_test.go:37:6: ExampleSet_Add contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleSet_Add() { + ^ +custom_set_examples_test.go:54:6: ExampleSet_Has contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleSet_Has() { + ^ +custom_set_test.go:12:1: Function TestNew missing the call to method parallel (paralleltest) +func TestNew(t *testing.T) { +^ +custom_set_test.go:20:1: Function TestNewFromSlice missing the call to method parallel (paralleltest) +func TestNewFromSlice(t *testing.T) { +^ +custom_set_test.go:47:1: Function TestIsEmpty missing the call to method parallel (paralleltest) +func TestIsEmpty(t *testing.T) { +^ +custom_set_test.go:48:2: Range statement for test TestIsEmpty missing the call to method parallel in test Run (paralleltest) + for _, tc := range emptyCases { + ^ +custom_set_test.go:59:1: Function TestHas missing the call to method parallel (paralleltest) +func TestHas(t *testing.T) { +^ +custom_set_test.go:60:2: Range statement for test TestHas missing the call to method parallel in test Run (paralleltest) + for _, tc := range containsCases { + ^ +custom_set_test.go:85:1: Function TestSubset missing the call to method parallel (paralleltest) +func TestSubset(t *testing.T) { +^ +custom_set_test.go:89:1: Function TestDisjoint missing the call to method parallel (paralleltest) +func TestDisjoint(t *testing.T) { +^ +custom_set_test.go:93:1: Function TestEqual missing the call to method parallel (paralleltest) +func TestEqual(t *testing.T) { +^ +custom_set_test.go:97:1: Function TestAdd missing the call to method parallel (paralleltest) +func TestAdd(t *testing.T) { +^ +custom_set_test.go:98:2: Range statement for test TestAdd missing the call to method parallel in test Run (paralleltest) + for _, tc := range addCases { + ^ +custom_set_test.go:125:1: Function TestIntersection missing the call to method parallel (paralleltest) +func TestIntersection(t *testing.T) { +^ +custom_set_test.go:129:1: Function TestDifference missing the call to method parallel (paralleltest) +func TestDifference(t *testing.T) { +^ +custom_set_test.go:133:1: Function TestUnion missing the call to method parallel (paralleltest) +func TestUnion(t *testing.T) { +^ +cases_test.go:1:9: package should be `stringset_test` instead of `stringset` (testpackage) +package stringset + ^ +custom_set_examples_test.go:1:9: package should be `stringset_test` instead of `stringset` (testpackage) +package stringset + ^ +custom_set_test.go:2:9: package should be `stringset_test` instead of `stringset` (testpackage) +package stringset + ^ +custom_set_test.go:72:6: parameter *testing.T should be the first or after context.Context (thelper) +func testBinBool(name string, f func(Set, Set) bool, cases []binBoolCase, t *testing.T) { + ^ +custom_set_test.go:111:6: parameter *testing.T should be the first or after context.Context (thelper) +func testBinOp(name string, f func(Set, Set) Set, cases []binOpCase, t *testing.T) { + ^ +custom_set_test.go:142:6: parameter *testing.B should be the first or after context.Context (thelper) +func bench(nAdd int, b *testing.B) { + ^ +custom_set.go:147:2: variable name 'd' is too short for the scope of its usage (varnamelen) + d := New() + ^ +custom_set.go:47:6: variable name 'v' is too short for the scope of its usage (varnamelen) + for _, v := range list { + ^ +custom_set.go:130:2: variable name 'i' is too short for the scope of its usage (varnamelen) + i := New() + ^ +custom_set.go:33:6: variable name 'sb' is too short for the scope of its usage (varnamelen) + var sb strings.Builder + ^ +custom_set.go:160:2: variable name 'u' is too short for the scope of its usage (varnamelen) + u := New() + ^ +custom_set_examples_test.go:38:2: variable name 's1' is too short for the scope of its usage (varnamelen) + s1 := New() + ^ +custom_set_test.go:73:6: variable name 'tc' is too short for the scope of its usage (varnamelen) + for _, tc := range cases { + ^ +custom_set.go:18:2: variable name 's' is too short for the scope of its usage (varnamelen) + s := New() + ^ +custom_set.go:129:19: parameter name 's1' is too short for the scope of its usage (varnamelen) +func Intersection(s1, s2 Set) Set { + ^ +custom_set.go:83:13: parameter name 's1' is too short for the scope of its usage (varnamelen) +func Subset(s1, s2 Set) bool { + ^ +custom_set.go:159:12: parameter name 's2' is too short for the scope of its usage (varnamelen) +func Union(s1, s2 Set) Set { + ^ +custom_set.go:114:12: parameter name 's2' is too short for the scope of its usage (varnamelen) +func Equal(s1, s2 Set) bool { + ^ + +real 0m0.631s +user 0m0.994s +sys 0m0.597s + + + ============================================================================== + +Exit code: -1 + +real 0m0.681s +user 0m1.034s +sys 0m0.631s + +real 0m0.683s +user 0m1.035s +sys 0m0.633s =============================================================================== -golint ./... +Running: ../../.github/citools/go/go-lint-revive -real 0m0.078s -user 0m0.084s -sys 0m0.055s +Running Go Lint Revive -=============================================================================== +Go version: -revive -formatter=stylish ./... + go version go1.21.0 linux/amd64 -real 0m0.048s -user 0m0.061s -sys 0m0.023s + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.011s +sys 0m0.015s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.091s +user 0m0.056s +sys 0m0.066s + + + ============================================================================== + +Exit code: 0 + +real 0m0.122s +user 0m0.076s +sys 0m0.088s + +real 0m0.124s +user 0m0.077s +sys 0m0.089s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.343s -user 0m0.307s -sys 0m0.311s +real 0m0.001s +user 0m0.000s +sys 0m0.001s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.030s +sys 0m0.022s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." +internal error: package "sort" without types was imported from "stringset" + +real 0m0.095s +user 0m0.119s +sys 0m0.123s + + + ============================================================================== + +Exit code: -1 + +real 0m0.141s +user 0m0.156s +sys 0m0.159s -real 0m0.589s -user 0m0.572s -sys 0m0.500s +real 0m0.145s +user 0m0.158s +sys 0m0.160s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck -real 0m0.783s -user 0m0.934s -sys 0m0.641s +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.013s +sys 0m0.016s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +custom_set.go:1:1: at least one file in a package should have a package comment (ST1000) + +real 0m0.169s +user 0m0.251s +sys 0m0.119s + + + ============================================================================== + +Exit code: -1 + +real 0m0.200s +user 0m0.268s +sys 0m0.145s + +real 0m0.201s +user 0m0.269s +sys 0m0.146s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.018s +sys 0m0.013s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + ./custom_set_examples_test.go:9:2: commentedOutCode: may want to remove commented-out code -real 0m3.147s -user 0m5.121s -sys 0m1.454s +real 0m0.806s +user 0m1.843s +sys 0m0.302s + + + ============================================================================== + +Exit code: -1 + +real 0m0.836s +user 0m1.867s +sys 0m0.323s + +real 0m0.839s +user 0m1.868s +sys 0m0.324s =============================================================================== -go vet ./... +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.008s +sys 0m0.021s + + + ============================================================================== + +Running: go vet ./... + -real 0m0.320s -user 0m0.414s -sys 0m0.261s +real 0m0.069s +user 0m0.099s +sys 0m0.101s + + + ============================================================================== + +Exit code: 0 + +real 0m0.098s +user 0m0.112s +sys 0m0.133s + +real 0m0.101s +user 0m0.114s +sys 0m0.133s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.014s +sys 0m0.015s -real 0m0.126s -user 0m0.084s -sys 0m0.126s + + ============================================================================== + +Running: go fix ./... + + +real 0m0.027s +user 0m0.024s +sys 0m0.013s + + + ============================================================================== + +Exit code: 0 + +real 0m0.056s +user 0m0.042s +sys 0m0.039s + +real 0m0.058s +user 0m0.043s +sys 0m0.040s =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.014s +sys 0m0.024s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.468s +user 0m1.286s +sys 0m0.242s + + + ============================================================================== + +Exit code: 0 + +real 0m0.507s +user 0m1.306s +sys 0m0.278s + +real 0m0.509s +user 0m1.308s +sys 0m0.279s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.011s +sys 0m0.016s + + + ============================================================================== + +Running: gocyclo . + 9 stringset Subset custom_set.go:83:1 6 stringset TestNewFromSlice custom_set_test.go:20:1 5 stringset (Set).String custom_set.go:28:1 @@ -122,33 +613,139 @@ gocyclo . 1 stringset (Set).IsEmpty custom_set.go:65:1 1 stringset New custom_set.go:12:1 -real 0m0.020s -user 0m0.005s -sys 0m0.012s +real 0m0.003s +user 0m0.002s +sys 0m0.001s + + + ============================================================================== + +Exit code: 0 + +real 0m0.029s +user 0m0.018s +sys 0m0.025s + +real 0m0.032s +user 0m0.018s +sys 0m0.028s =============================================================================== -misspell . +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . -real 0m0.107s -user 0m0.123s -sys 0m0.043s + +real 0m0.026s +user 0m0.032s +sys 0m0.013s + + + ============================================================================== + +Exit code: 0 + +real 0m0.037s +user 0m0.037s +sys 0m0.022s + +real 0m0.039s +user 0m0.038s +sys 0m0.023s =============================================================================== -gosec ./... -[gosec] 2022/10/16 20:49:10 Including rules: default -[gosec] 2022/10/16 20:49:10 Excluding rules: default -[gosec] 2022/10/16 20:49:10 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/custom-set -2022/10/16 20:49:11 internal error: package "sort" without types was imported from "command-line-arguments" +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... -real 0m0.512s -user 0m0.522s -sys 0m0.340s + +real 0m0.031s +user 0m0.023s +sys 0m0.025s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:22:03 Including rules: default +[gosec] 2023/09/07 00:22:03 Excluding rules: default +[gosec] 2023/09/07 00:22:03 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/custom-set +[gosec] 2023/09/07 00:22:03 Checking package: stringset +[gosec] 2023/09/07 00:22:03 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/custom-set/custom_set.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 171 + Nosec : 0 + Issues : 0 + + +real 0m0.126s +user 0m0.169s +sys 0m0.114s + + + ============================================================================== + +Exit code: 0 + +real 0m0.174s +user 0m0.198s +sys 0m0.153s + +real 0m0.175s +user 0m0.199s +sys 0m0.153s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.015s +sys 0m0.021s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestNew --- PASS: TestNew (0.00s) === RUN TestNewFromSlice @@ -271,15 +868,17 @@ gotest -v -covermode=count -coverprofile coverage.out ./... --- PASS: ExampleUnion (0.00s) PASS coverage: 100.0% of statements -ok stringset 0.018s coverage: 100.0% of statements +ok stringset 0.006s coverage: 100.0% of statements -real 0m1.050s -user 0m1.347s -sys 0m0.737s +real 0m0.223s +user 0m0.315s +sys 0m0.173s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + stringset/custom_set.go:12: New 100.0% stringset/custom_set.go:17: NewFromSlice 100.0% stringset/custom_set.go:28: String 100.0% @@ -294,29 +893,40 @@ stringset/custom_set.go:146: Difference 100.0% stringset/custom_set.go:159: Union 100.0% total: (statements) 100.0% -real 0m0.276s -user 0m0.141s -sys 0m0.277s +real 0m0.047s +user 0m0.047s +sys 0m0.069s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.221s -user 0m0.127s -sys 0m0.202s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +real 0m0.039s +user 0m0.046s +sys 0m0.058s -real 0m0.127s -user 0m0.104s -sys 0m0.099s -=============================================================================== + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.018s +user 0m0.007s +sys 0m0.022s + +real 0m0.018s +user 0m0.007s +sys 0m0.022s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestNew --- PASS: TestNew (0.00s) === RUN TestNewFromSlice @@ -439,33 +1049,49 @@ gotest -v -race -covermode=atomic ./... --- PASS: ExampleUnion (0.00s) PASS coverage: 100.0% of statements -ok stringset 0.063s coverage: 100.0% of statements +ok stringset 1.033s coverage: 100.0% of statements -real 0m1.092s -user 0m1.125s -sys 0m0.595s +real 0m1.383s +user 0m0.459s +sys 0m0.257s + + + ============================================================================== + +Exit code: 0 + +real 0m1.750s +user 0m0.895s +sys 0m0.611s + +real 0m1.753s +user 0m0.895s +sys 0m0.614s =============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: stringset -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkNewFromSlice1e1 -BenchmarkNewFromSlice1e1-4 4052859 298.9 ns/op 0 B/op 0 allocs/op +BenchmarkNewFromSlice1e1-8 7917919 144.1 ns/op 0 B/op 0 allocs/op BenchmarkNewFromSlice1e2 -BenchmarkNewFromSlice1e2-4 57602 24311 ns/op 5096 B/op 7 allocs/op +BenchmarkNewFromSlice1e2-8 220611 5633 ns/op 4978 B/op 6 allocs/op BenchmarkNewFromSlice1e3 -BenchmarkNewFromSlice1e3-4 4417 243157 ns/op 42533 B/op 19 allocs/op +BenchmarkNewFromSlice1e3-8 21044 59360 ns/op 41621 B/op 13 allocs/op BenchmarkNewFromSlice1e4 -BenchmarkNewFromSlice1e4-4 667 2096502 ns/op 351308 B/op 176 allocs/op +BenchmarkNewFromSlice1e4-8 1183 955058 ns/op 659628 B/op 99 allocs/op PASS -ok stringset 6.011s +ok stringset 6.595s -real 0m6.579s -user 0m9.115s -sys 0m1.017s +real 0m6.797s +user 0m7.083s +sys 0m0.308s =============================================================================== @@ -591,23 +1217,97 @@ gotest -v -tags bonus === RUN ExampleUnion --- PASS: ExampleUnion (0.00s) PASS -ok stringset 0.007s +ok stringset 0.006s -real 0m0.556s -user 0m0.656s -sys 0m0.396s +real 0m0.141s +user 0m0.170s +sys 0m0.148s =============================================================================== -No old benchmarks to run benchstat against. +benchstat benchstat-old.txt benchstat-new.txt +benchstat-old.txt:5: missing iteration count +benchstat-old.txt:7: missing iteration count +benchstat-old.txt:9: missing iteration count +benchstat-old.txt:11: missing iteration count +benchstat-new.txt:5: missing iteration count +benchstat-new.txt:7: missing iteration count +benchstat-new.txt:9: missing iteration count +benchstat-new.txt:11: missing iteration count +goos: linux +goarch: amd64 +pkg: stringset +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +NewFromSlice1e1-8 144.1n ± ∞ ¹ +NewFromSlice1e2-8 5.633µ ± ∞ ¹ +NewFromSlice1e3-8 59.36µ ± ∞ ¹ +NewFromSlice1e4-8 955.1µ ± ∞ ¹ +geomean 14.65µ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +NewFromSlice1e1-8 0.000 ± ∞ ¹ +NewFromSlice1e2-8 4.861Ki ± ∞ ¹ +NewFromSlice1e3-8 40.65Ki ± ∞ ¹ +NewFromSlice1e4-8 644.2Ki ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean + + │ benchstat-new.txt │ + │ allocs/op │ +NewFromSlice1e1-8 0.000 ± ∞ ¹ +NewFromSlice1e2-8 6.000 ± ∞ ¹ +NewFromSlice1e3-8 13.00 ± ∞ ¹ +NewFromSlice1e4-8 99.00 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean + +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +NewFromSlice1e1-4 298.9n ± ∞ ¹ +NewFromSlice1e2-4 24.31µ ± ∞ ¹ +NewFromSlice1e3-4 243.2µ ± ∞ ¹ +NewFromSlice1e4-4 2.097m ± ∞ ¹ +geomean 43.87µ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ B/op │ +NewFromSlice1e1-4 0.000 ± ∞ ¹ +NewFromSlice1e2-4 4.977Ki ± ∞ ¹ +NewFromSlice1e3-4 41.54Ki ± ∞ ¹ +NewFromSlice1e4-4 343.1Ki ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean + + │ benchstat-old.txt │ + │ allocs/op │ +NewFromSlice1e1-4 0.000 ± ∞ ¹ +NewFromSlice1e2-4 7.000 ± ∞ ¹ +NewFromSlice1e3-4 19.00 ± ∞ ¹ +NewFromSlice1e4-4 176.0 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean + +real 0m0.004s +user 0m0.001s +sys 0m0.003s =============================================================================== gomarkdoc --output stringset-doc.md -real 0m0.034s -user 0m0.020s -sys 0m0.023s +real 0m0.013s +user 0m0.008s +sys 0m0.005s =============================================================================== @@ -661,9 +1361,9 @@ func (s Set) String() string String returns the string version of the Set. -real 0m0.153s -user 0m0.086s -sys 0m0.154s +real 0m0.040s +user 0m0.018s +sys 0m0.034s =============================================================================== diff --git a/go/darts/benchstat-new.txt b/go/darts/benchstat-new.txt index 4394b7c7..fa0a1097 100644 --- a/go/darts/benchstat-new.txt +++ b/go/darts/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: darts -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkScore-4 1764415 811.8 ns/op 0 B/op 0 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkScore +BenchmarkScore-8 3529778 337.7 ns/op 0 B/op 0 allocs/op PASS -ok darts 2.170s +ok darts 1.542s diff --git a/go/darts/benchstat-old.txt b/go/darts/benchstat-old.txt index 2c372475..4394b7c7 100644 --- a/go/darts/benchstat-old.txt +++ b/go/darts/benchstat-old.txt @@ -2,6 +2,6 @@ goos: linux goarch: amd64 pkg: darts cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkScore-4 1882360 738.9 ns/op 0 B/op 0 allocs/op +BenchmarkScore-4 1764415 811.8 ns/op 0 B/op 0 allocs/op PASS -ok darts 2.105s +ok darts 2.170s diff --git a/go/darts/coverage-annotations.txt b/go/darts/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/darts/darts-doc.md b/go/darts/darts-doc.md index 2df416c8..3dbe06b0 100755 --- a/go/darts/darts-doc.md +++ b/go/darts/darts-doc.md @@ -6,7 +6,7 @@ import "darts" ``` -Package darts is used to calculate the score in a game of darts\. +Package darts is used to calculate the score in a game of darts. ## Index @@ -19,7 +19,7 @@ Package darts is used to calculate the score in a game of darts\. func Score(x, y float64) int ``` -Score returns a score for a single dart throw\. +Score returns a score for a single dart throw.

Example

diff --git a/go/darts/run-tests-go.txt b/go/darts/run-tests-go.txt index b64ab62b..18d17824 100644 --- a/go/darts/run-tests-go.txt +++ b/go/darts/run-tests-go.txt @@ -5,15 +5,575 @@ Go packages: darts =============================================================================== -golint darts +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.007s +sys 0m0.018s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +darts_test.go:10:20: Using the variable on range scope `tc` in function literal (scopelint) + actual := Score(tc.x, tc.y) + ^ +darts_test.go:11:17: Using the variable on range scope `tc` in function literal (scopelint) + if actual != tc.expected { + ^ +darts_test.go:12:50: Using the variable on range scope `tc` in function literal (scopelint) + t.Errorf("Score(%#v, %#v) = %#v, want: %#v", tc.x, tc.y, actual, tc.expected) + ^ +darts_test.go:22:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +darts.go:14:35: mnd: Magic number: 2, in detected (gomnd) + radius = math.Sqrt(math.Pow(x-0, 2) + math.Pow(y-0, 2)) + ^ +darts.go:20:10: mnd: Magic number: 5, in detected (gomnd) + return 5 + ^ +darts.go:22:10: mnd: Magic number: 10, in detected (gomnd) + return 10 + ^ +darts.go:10:2: S1021: should merge variable declaration with assignment on next line (gosimple) + var radius float64 + ^ +darts_test.go:7:1: Function TestScore missing the call to method parallel (paralleltest) +func TestScore(t *testing.T) { +^ +darts_test.go:8:2: Range statement for test TestScore missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +cases_test.go:1:9: package should be `darts_test` instead of `darts` (testpackage) +package darts + ^ +darts_examples_test.go:1:9: package should be `darts_test` instead of `darts` (testpackage) +package darts + ^ +darts_test.go:1:9: package should be `darts_test` instead of `darts` (testpackage) +package darts + ^ + +real 0m0.463s +user 0m0.697s +sys 0m0.425s + + + ============================================================================== + +Exit code: -1 + +real 0m0.497s +user 0m0.708s +sys 0m0.456s + +real 0m0.500s +user 0m0.710s +sys 0m0.458s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.015s +sys 0m0.015s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.057s +user 0m0.030s +sys 0m0.043s + + + ============================================================================== + +Exit code: 0 + +real 0m0.093s +user 0m0.050s +sys 0m0.071s + +real 0m0.095s +user 0m0.051s +sys 0m0.072s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.011s +sys 0m0.016s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "math" without types was imported from "darts" + +real 0m0.083s +user 0m0.111s +sys 0m0.103s + + + ============================================================================== + +Exit code: -1 + +real 0m0.123s +user 0m0.132s +sys 0m0.132s + +real 0m0.125s +user 0m0.133s +sys 0m0.134s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.003s +sys 0m0.013s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +darts.go:10:2: should merge variable declaration with assignment on next line (S1021) + +real 0m0.164s +user 0m0.203s +sys 0m0.115s + + + ============================================================================== + +Exit code: -1 + +real 0m0.186s +user 0m0.212s +sys 0m0.134s + +real 0m0.188s +user 0m0.213s +sys 0m0.134s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + -real 0m0.140s -user 0m0.065s -sys 0m0.123s + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.009s +sys 0m0.014s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.830s +user 0m2.029s +sys 0m0.310s + + + ============================================================================== + +Exit code: 0 + +real 0m0.865s +user 0m2.046s +sys 0m0.337s + +real 0m0.867s +user 0m2.047s +sys 0m0.339s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.018s +sys 0m0.014s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.082s +user 0m0.122s +sys 0m0.108s + + + ============================================================================== + +Exit code: 0 + +real 0m0.124s +user 0m0.149s +sys 0m0.137s + +real 0m0.127s +user 0m0.150s +sys 0m0.138s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.004s +sys 0m0.013s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.022s +user 0m0.012s +sys 0m0.014s + + + ============================================================================== + +Exit code: 0 + +real 0m0.047s +user 0m0.021s +sys 0m0.037s + +real 0m0.049s +user 0m0.022s +sys 0m0.038s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out darts +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.006s +sys 0m0.014s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.462s +user 0m1.382s +sys 0m0.301s + + + ============================================================================== + +Exit code: 0 + +real 0m0.493s +user 0m1.394s +sys 0m0.328s + +real 0m0.497s +user 0m1.396s +sys 0m0.330s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.006s +sys 0m0.017s + + + ============================================================================== + +Running: gocyclo . + +6 darts Score darts.go:9:1 +4 darts BenchmarkScore darts_test.go:18:1 +3 darts TestScore darts_test.go:7:1 +1 darts ExampleScore darts_examples_test.go:7:1 + +real 0m0.003s +user 0m0.000s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.032s +user 0m0.015s +sys 0m0.025s + +real 0m0.034s +user 0m0.015s +sys 0m0.026s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.027s +user 0m0.028s +sys 0m0.013s + + + ============================================================================== + +Exit code: 0 + +real 0m0.043s +user 0m0.037s +sys 0m0.027s + +real 0m0.046s +user 0m0.039s +sys 0m0.028s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.007s +sys 0m0.009s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:22:15 Including rules: default +[gosec] 2023/09/07 00:22:15 Excluding rules: default +[gosec] 2023/09/07 00:22:15 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/darts +[gosec] 2023/09/07 00:22:15 Checking package: darts +[gosec] 2023/09/07 00:22:15 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/darts/darts.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 26 + Nosec : 0 + Issues : 0 + + +real 0m0.088s +user 0m0.082s +sys 0m0.060s + + + ============================================================================== + +Exit code: 0 + +real 0m0.111s +user 0m0.093s +sys 0m0.078s + +real 0m0.114s +user 0m0.093s +sys 0m0.080s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.004s +sys 0m0.012s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestScore === RUN TestScore/Missed_target === RUN TestScore/On_the_outer_circle @@ -46,33 +606,54 @@ go test -v -covermode=count -coverprofile coverage.out darts --- PASS: ExampleScore (0.00s) PASS coverage: 100.0% of statements -ok darts 0.006s coverage: 100.0% of statements +ok darts 0.002s coverage: 100.0% of statements -real 0m0.633s -user 0m0.702s -sys 0m0.440s +real 0m0.193s +user 0m0.268s +sys 0m0.183s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + darts/darts.go:9: Score 100.0% total: (statements) 100.0% -real 0m0.112s -user 0m0.069s -sys 0m0.104s +real 0m0.030s +user 0m0.010s +sys 0m0.030s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.086s -user 0m0.058s -sys 0m0.073s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic darts +real 0m0.042s +user 0m0.026s +sys 0m0.038s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.025s +user 0m0.016s +sys 0m0.028s + +real 0m0.025s +user 0m0.017s +sys 0m0.028s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestScore === RUN TestScore/Missed_target === RUN TestScore/On_the_outer_circle @@ -87,7 +668,7 @@ go test -v -race -covermode=atomic darts === RUN TestScore/Just_within_the_outer_circle === RUN TestScore/Just_outside_the_outer_circle === RUN TestScore/Asymmetric_position_between_the_inner_and_middle_circles ---- PASS: TestScore (0.02s) +--- PASS: TestScore (0.00s) --- PASS: TestScore/Missed_target (0.00s) --- PASS: TestScore/On_the_outer_circle (0.00s) --- PASS: TestScore/On_the_middle_circle (0.00s) @@ -105,97 +686,134 @@ go test -v -race -covermode=atomic darts --- PASS: ExampleScore (0.00s) PASS coverage: 100.0% of statements -ok darts 0.055s coverage: 100.0% of statements +ok darts 1.013s coverage: 100.0% of statements + +real 0m1.257s +user 0m0.293s +sys 0m0.202s -real 0m0.697s -user 0m0.710s -sys 0m0.496s + + ============================================================================== + +Exit code: 0 + +real 0m1.579s +user 0m0.626s +sys 0m0.512s + +real 0m1.581s +user 0m0.627s +sys 0m0.513s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: darts -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkScore-4 1764415 811.8 ns/op 0 B/op 0 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkScore +BenchmarkScore-8 3529778 337.7 ns/op 0 B/op 0 allocs/op PASS -ok darts 2.170s +ok darts 1.542s -real 0m2.627s -user 0m2.749s -sys 0m0.359s +real 0m1.696s +user 0m1.747s +sys 0m0.149s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestScore +=== RUN TestScore/Missed_target +=== RUN TestScore/On_the_outer_circle +=== RUN TestScore/On_the_middle_circle +=== RUN TestScore/On_the_inner_circle +=== RUN TestScore/Exactly_on_centre +=== RUN TestScore/Near_the_centre +=== RUN TestScore/Just_within_the_inner_circle +=== RUN TestScore/Just_outside_the_inner_circle +=== RUN TestScore/Just_within_the_middle_circle +=== RUN TestScore/Just_outside_the_middle_circle +=== RUN TestScore/Just_within_the_outer_circle +=== RUN TestScore/Just_outside_the_outer_circle +=== RUN TestScore/Asymmetric_position_between_the_inner_and_middle_circles +--- PASS: TestScore (0.00s) + --- PASS: TestScore/Missed_target (0.00s) + --- PASS: TestScore/On_the_outer_circle (0.00s) + --- PASS: TestScore/On_the_middle_circle (0.00s) + --- PASS: TestScore/On_the_inner_circle (0.00s) + --- PASS: TestScore/Exactly_on_centre (0.00s) + --- PASS: TestScore/Near_the_centre (0.00s) + --- PASS: TestScore/Just_within_the_inner_circle (0.00s) + --- PASS: TestScore/Just_outside_the_inner_circle (0.00s) + --- PASS: TestScore/Just_within_the_middle_circle (0.00s) + --- PASS: TestScore/Just_outside_the_middle_circle (0.00s) + --- PASS: TestScore/Just_within_the_outer_circle (0.00s) + --- PASS: TestScore/Just_outside_the_outer_circle (0.00s) + --- PASS: TestScore/Asymmetric_position_between_the_inner_and_middle_circles (0.00s) +=== RUN ExampleScore +--- PASS: ExampleScore (0.00s) PASS -ok darts 0.008s +ok darts 0.002s -real 0m0.570s -user 0m0.706s -sys 0m0.471s +real 0m0.155s +user 0m0.201s +sys 0m0.144s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m0.693s -user 0m0.668s -sys 0m0.312s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -Score-4 739ns ± 0% 812ns ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -Score-4 0.00B 0.00B ~ (all equal) - -name old allocs/op new allocs/op delta -Score-4 0.00 0.00 ~ (all equal) - -real 0m0.035s -user 0m0.015s -sys 0m0.031s - -=============================================================================== - -go vet darts - -real 0m0.319s -user 0m0.355s -sys 0m0.319s - -=============================================================================== +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: darts +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Score-8 337.7n ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Score-8 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Score-8 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -go fix darts +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Score-4 811.8n ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.061s -user 0m0.042s -sys 0m0.051s + │ benchstat-old.txt │ + │ B/op │ +Score-4 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ allocs/op │ +Score-4 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./darts -[gosec] 2022/07/24 00:39:00 Including rules: default -[gosec] 2022/07/24 00:39:00 Excluding rules: default -[gosec] 2022/07/24 00:39:00 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/darts -2022/07/24 00:39:00 internal error: package "math" without types was imported from "command-line-arguments" - -real 0m0.329s -user 0m0.297s -sys 0m0.253s +real 0m0.002s +user 0m0.001s +sys 0m0.001s =============================================================================== gomarkdoc --output darts-doc.md -real 0m0.027s -user 0m0.021s -sys 0m0.021s +real 0m0.012s +user 0m0.007s +sys 0m0.004s =============================================================================== @@ -210,9 +828,9 @@ func Score(x, y float64) int Score returns a score for a single dart throw. -real 0m0.140s -user 0m0.057s -sys 0m0.147s +real 0m0.038s +user 0m0.015s +sys 0m0.033s =============================================================================== diff --git a/go/difference-of-squares/benchstat-new.txt b/go/difference-of-squares/benchstat-new.txt index 930e1a56..c1d236ed 100644 --- a/go/difference-of-squares/benchstat-new.txt +++ b/go/difference-of-squares/benchstat-new.txt @@ -1,29 +1,57 @@ goos: linux goarch: amd64 pkg: diffsquares -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -Benchmark_squareOfSumBruteForce/input_size_10-4 29426822 36.32 ns/op 0 B/op 0 allocs/op -Benchmark_squareOfSumBruteForce/input_size_100-4 8640528 131.1 ns/op 0 B/op 0 allocs/op -Benchmark_squareOfSumBruteForce/input_size_1000-4 1308825 945.4 ns/op 0 B/op 0 allocs/op -Benchmark_squareOfSumBruteForce/input_size_10000-4 115472 9273 ns/op 0 B/op 0 allocs/op -Benchmark_sumOfSquaresBruteForce/input_size_10-4 3680767 291.4 ns/op 0 B/op 0 allocs/op -Benchmark_sumOfSquaresBruteForce/input_size_100-4 341122 3511 ns/op 0 B/op 0 allocs/op -Benchmark_sumOfSquaresBruteForce/input_size_1000-4 32896 34281 ns/op 0 B/op 0 allocs/op -Benchmark_sumOfSquaresBruteForce/input_size_10000-4 3711 347095 ns/op 0 B/op 0 allocs/op -Benchmark_squareOfSumGauss/input_size_10-4 26699696 50.20 ns/op 0 B/op 0 allocs/op -Benchmark_squareOfSumGauss/input_size_100-4 30163941 34.02 ns/op 0 B/op 0 allocs/op -Benchmark_squareOfSumGauss/input_size_1000-4 38001340 34.72 ns/op 0 B/op 0 allocs/op -Benchmark_squareOfSumGauss/input_size_10000-4 31666057 35.09 ns/op 0 B/op 0 allocs/op -Benchmark_sumOfSquaresGauss/input_size_10-4 439645538 2.339 ns/op 0 B/op 0 allocs/op -Benchmark_sumOfSquaresGauss/input_size_100-4 497528520 2.323 ns/op 0 B/op 0 allocs/op -Benchmark_sumOfSquaresGauss/input_size_1000-4 483448791 2.396 ns/op 0 B/op 0 allocs/op -Benchmark_sumOfSquaresGauss/input_size_10000-4 438887734 2.466 ns/op 0 B/op 0 allocs/op -BenchmarkDifference2/input_size_10-4 26115793 43.57 ns/op 0 B/op 0 allocs/op -BenchmarkDifference2/input_size_100-4 26788078 43.28 ns/op 0 B/op 0 allocs/op -BenchmarkDifference2/input_size_1000-4 28098295 43.96 ns/op 0 B/op 0 allocs/op -BenchmarkDifference2/input_size_10000-4 21875874 45.85 ns/op 0 B/op 0 allocs/op -BenchmarkSquareOfSum-4 31738362 37.79 ns/op 0 B/op 0 allocs/op -BenchmarkSumOfSquares-4 241435201 5.311 ns/op 0 B/op 0 allocs/op -BenchmarkDifference-4 28246478 43.55 ns/op 0 B/op 0 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +Benchmark_squareOfSumBruteForce +Benchmark_squareOfSumBruteForce/input_size_10 +Benchmark_squareOfSumBruteForce/input_size_10-8 65260878 18.76 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumBruteForce/input_size_100 +Benchmark_squareOfSumBruteForce/input_size_100-8 28727955 39.90 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumBruteForce/input_size_1000 +Benchmark_squareOfSumBruteForce/input_size_1000-8 4833860 238.2 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumBruteForce/input_size_10000 +Benchmark_squareOfSumBruteForce/input_size_10000-8 506860 2329 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresBruteForce +Benchmark_sumOfSquaresBruteForce/input_size_10 +Benchmark_sumOfSquaresBruteForce/input_size_10-8 9536739 123.3 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresBruteForce/input_size_100 +Benchmark_sumOfSquaresBruteForce/input_size_100-8 871184 1466 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresBruteForce/input_size_1000 +Benchmark_sumOfSquaresBruteForce/input_size_1000-8 88890 13647 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresBruteForce/input_size_10000 +Benchmark_sumOfSquaresBruteForce/input_size_10000-8 8983 137880 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumGauss +Benchmark_squareOfSumGauss/input_size_10 +Benchmark_squareOfSumGauss/input_size_10-8 81535269 14.85 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumGauss/input_size_100 +Benchmark_squareOfSumGauss/input_size_100-8 64242895 15.68 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumGauss/input_size_1000 +Benchmark_squareOfSumGauss/input_size_1000-8 69711468 14.94 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumGauss/input_size_10000 +Benchmark_squareOfSumGauss/input_size_10000-8 72954270 15.52 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresGauss +Benchmark_sumOfSquaresGauss/input_size_10 +Benchmark_sumOfSquaresGauss/input_size_10-8 1000000000 0.9166 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresGauss/input_size_100 +Benchmark_sumOfSquaresGauss/input_size_100-8 1000000000 0.8591 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresGauss/input_size_1000 +Benchmark_sumOfSquaresGauss/input_size_1000-8 1000000000 0.8592 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresGauss/input_size_10000 +Benchmark_sumOfSquaresGauss/input_size_10000-8 1000000000 0.9019 ns/op 0 B/op 0 allocs/op +BenchmarkDifference2 +BenchmarkDifference2/input_size_10 +BenchmarkDifference2/input_size_10-8 58354600 18.40 ns/op 0 B/op 0 allocs/op +BenchmarkDifference2/input_size_100 +BenchmarkDifference2/input_size_100-8 68028196 18.28 ns/op 0 B/op 0 allocs/op +BenchmarkDifference2/input_size_1000 +BenchmarkDifference2/input_size_1000-8 73059724 17.84 ns/op 0 B/op 0 allocs/op +BenchmarkDifference2/input_size_10000 +BenchmarkDifference2/input_size_10000-8 67205625 17.88 ns/op 0 B/op 0 allocs/op +BenchmarkSquareOfSum +BenchmarkSquareOfSum-8 72406717 16.56 ns/op 0 B/op 0 allocs/op +BenchmarkSumOfSquares +BenchmarkSumOfSquares-8 656380638 1.702 ns/op 0 B/op 0 allocs/op +BenchmarkDifference +BenchmarkDifference-8 72435668 17.44 ns/op 0 B/op 0 allocs/op PASS -ok diffsquares 36.072s +ok diffsquares 30.095s diff --git a/go/difference-of-squares/benchstat-old.txt b/go/difference-of-squares/benchstat-old.txt index cb2b82ed..930e1a56 100644 --- a/go/difference-of-squares/benchstat-old.txt +++ b/go/difference-of-squares/benchstat-old.txt @@ -2,4 +2,28 @@ goos: linux goarch: amd64 pkg: diffsquares cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -Benchmark_squareOfSumBruteForce/input_size_10-4 \ No newline at end of file +Benchmark_squareOfSumBruteForce/input_size_10-4 29426822 36.32 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumBruteForce/input_size_100-4 8640528 131.1 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumBruteForce/input_size_1000-4 1308825 945.4 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumBruteForce/input_size_10000-4 115472 9273 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresBruteForce/input_size_10-4 3680767 291.4 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresBruteForce/input_size_100-4 341122 3511 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresBruteForce/input_size_1000-4 32896 34281 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresBruteForce/input_size_10000-4 3711 347095 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumGauss/input_size_10-4 26699696 50.20 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumGauss/input_size_100-4 30163941 34.02 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumGauss/input_size_1000-4 38001340 34.72 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumGauss/input_size_10000-4 31666057 35.09 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresGauss/input_size_10-4 439645538 2.339 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresGauss/input_size_100-4 497528520 2.323 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresGauss/input_size_1000-4 483448791 2.396 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresGauss/input_size_10000-4 438887734 2.466 ns/op 0 B/op 0 allocs/op +BenchmarkDifference2/input_size_10-4 26115793 43.57 ns/op 0 B/op 0 allocs/op +BenchmarkDifference2/input_size_100-4 26788078 43.28 ns/op 0 B/op 0 allocs/op +BenchmarkDifference2/input_size_1000-4 28098295 43.96 ns/op 0 B/op 0 allocs/op +BenchmarkDifference2/input_size_10000-4 21875874 45.85 ns/op 0 B/op 0 allocs/op +BenchmarkSquareOfSum-4 31738362 37.79 ns/op 0 B/op 0 allocs/op +BenchmarkSumOfSquares-4 241435201 5.311 ns/op 0 B/op 0 allocs/op +BenchmarkDifference-4 28246478 43.55 ns/op 0 B/op 0 allocs/op +PASS +ok diffsquares 36.072s diff --git a/go/difference-of-squares/coverage-annotations.txt b/go/difference-of-squares/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/difference-of-squares/coverage.html b/go/difference-of-squares/coverage.html new file mode 100644 index 00000000..eedad0a1 --- /dev/null +++ b/go/difference-of-squares/coverage.html @@ -0,0 +1,178 @@ + + + + + + diffsquares: Go Coverage Report + + + +

+ +
+ not tracked + + no coverage + low coverage + * + * + * + * + * + * + * + * + high coverage + +
+
+
+ + + +
+ + + diff --git a/go/difference-of-squares/coverage.out b/go/difference-of-squares/coverage.out index 04c9c8c9..80dcc207 100644 --- a/go/difference-of-squares/coverage.out +++ b/go/difference-of-squares/coverage.out @@ -1,16 +1,16 @@ mode: count diffsquares/difference_of_squares.go:10.29,11.30 1 17 -diffsquares/difference_of_squares.go:15.2,15.33 1 1 diffsquares/difference_of_squares.go:11.30,13.3 1 16 +diffsquares/difference_of_squares.go:15.2,15.33 1 1 diffsquares/difference_of_squares.go:19.34,23.2 2 16 diffsquares/difference_of_squares.go:26.39,29.26 2 2 -diffsquares/difference_of_squares.go:33.2,33.41 1 2 diffsquares/difference_of_squares.go:29.26,31.3 1 20 +diffsquares/difference_of_squares.go:33.2,33.41 1 2 diffsquares/difference_of_squares.go:37.30,38.30 1 17 -diffsquares/difference_of_squares.go:42.2,42.34 1 1 diffsquares/difference_of_squares.go:38.30,40.3 1 16 +diffsquares/difference_of_squares.go:42.2,42.34 1 1 diffsquares/difference_of_squares.go:46.35,50.2 2 16 diffsquares/difference_of_squares.go:53.40,56.26 2 2 -diffsquares/difference_of_squares.go:60.2,60.12 1 2 diffsquares/difference_of_squares.go:56.26,58.3 1 20 +diffsquares/difference_of_squares.go:60.2,60.12 1 2 diffsquares/difference_of_squares.go:64.28,66.2 1 9 diff --git a/go/difference-of-squares/diffsquares-doc.md b/go/difference-of-squares/diffsquares-doc.md index c54e6c22..84c50302 100755 --- a/go/difference-of-squares/diffsquares-doc.md +++ b/go/difference-of-squares/diffsquares-doc.md @@ -6,7 +6,7 @@ import "diffsquares" ``` -Package diffsquares finds the difference between the square of the sum and the sum of the squares of the first N natural numbers\. +Package diffsquares finds the difference between the square of the sum and the sum of the squares of the first N natural numbers.
Example (Square Of Sum Brute Force)

@@ -59,7 +59,7 @@ Package diffsquares finds the difference between the square of the sum and the s func Difference(n int) int ``` -Difference returns the difference between the Square of Sums and Sum of Squares\. +Difference returns the difference between the Square of Sums and Sum of Squares.

Example

@@ -110,7 +110,7 @@ Difference returns the difference between the Square of Sums and Sum of Squares\ func SquareOfSum(n int) int ``` -SquareOfSum returns the sum\, \`int\`\, of the square of the sum of the first n \(\`int\`\) numbers \(starting with 1 to 10\, inclusive\)\. +SquareOfSum returns the sum, \`int\`, of the square of the sum of the first n \(\`int\`\) numbers \(starting with 1 to 10, inclusive\).

Example

@@ -141,7 +141,7 @@ SquareOfSum returns the sum\, \`int\`\, of the square of the sum of the first n func SumOfSquares(n int) int ``` -SumOfSquares returns the sum\, \`int\`\, of the sum of the first n \(\`int\`\) squares \(starting with 1 to 10\, inclusive\)\. +SumOfSquares returns the sum, \`int\`, of the sum of the first n \(\`int\`\) squares \(starting with 1 to 10, inclusive\).

Example

diff --git a/go/difference-of-squares/diffsquares-doc.txt b/go/difference-of-squares/diffsquares-doc.txt index ebf42281..765a86ce 100644 --- a/go/difference-of-squares/diffsquares-doc.txt +++ b/go/difference-of-squares/diffsquares-doc.txt @@ -1,7 +1,7 @@ package diffsquares // import "diffsquares" -Package diffsquares finds the difference between the square of the sum and -the sum of the squares of the first N natural numbers. +Package diffsquares finds the difference between the square of the sum and the +sum of the squares of the first N natural numbers. FUNCTIONS diff --git a/go/difference-of-squares/run-tests-go.txt b/go/difference-of-squares/run-tests-go.txt index 8f5fce72..7b4c472c 100644 --- a/go/difference-of-squares/run-tests-go.txt +++ b/go/difference-of-squares/run-tests-go.txt @@ -5,15 +5,657 @@ Go packages: diffsquares =============================================================================== -golint diffsquares +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.157s -user 0m0.099s -sys 0m0.146s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.006s +sys 0m0.014s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +difference_of_squares.go:1: line is 132 characters (lll) +// Package diffsquares finds the difference between the square of the sum and the sum of the squares of the first N natural numbers. +difference_of_squares.go:9: line is 130 characters (lll) +// SquareOfSum returns the sum, `int`, of the square of the sum of the first n (`int`) numbers (starting with 1 to 10, inclusive). +difference_of_squares_benchmarks_test.go:96: line is 139 characters (lll) + Benchmark_squareOfSumBruteForce/input_size_10-4 29426822 36.32 ns/op 0 B/op 0 allocs/op +difference_of_squares_benchmarks_test.go:97: line is 139 characters (lll) + Benchmark_squareOfSumBruteForce/input_size_100-4 8640528 131.1 ns/op 0 B/op 0 allocs/op +difference_of_squares_benchmarks_test.go:98: line is 139 characters (lll) + Benchmark_squareOfSumBruteForce/input_size_1000-4 1308825 945.4 ns/op 0 B/op 0 allocs/op +difference_of_squares.go:7:19: var-declaration: should omit type string from declaration of var defaultMethod; it will be inferred from the right-hand side (revive) +var defaultMethod string = "gauss" + ^ +difference_of_squares.go:20:10: var-declaration: should omit type int from declaration of var sum; it will be inferred from the right-hand side (revive) + var sum int = n * (n + 1) / 2 + ^ +difference_of_squares.go:47:10: var-declaration: should omit type int from declaration of var sum; it will be inferred from the right-hand side (revive) + var sum int = n * (n + 1) * (2*n + 1) / 6 + ^ +difference_of_squares_benchmarks_test.go:25:31: Using the variable on range scope `v` in function literal (scopelint) + r = squareOfSumBruteForce(v.input) + ^ +difference_of_squares_benchmarks_test.go:39:32: Using the variable on range scope `v` in function literal (scopelint) + r = sumOfSquaresBruteForce(v.input) + ^ +difference_of_squares_benchmarks_test.go:53:26: Using the variable on range scope `v` in function literal (scopelint) + r = squareOfSumGauss(v.input) + ^ +difference_of_squares_examples_test.go:49:2: only cuddled expressions if assigning variable or using from line above (wsl) + fmt.Println(Difference(10)) + ^ +difference_of_squares_test.go:44:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +difference_of_squares_test.go:53:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +difference_of_squares_test.go:62:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +difference_of_squares_benchmarks_test.go:8:5: table is a global variable (gochecknoglobals) +var table = []struct { + ^ +difference_of_squares_benchmarks_test.go:17:5: result is a global variable (gochecknoglobals) +var result int + ^ +difference_of_squares_test.go:5:5: tests is a global variable (gochecknoglobals) +var tests = []struct{ n, sqOfSum, sumOfSq int }{ + ^ +difference_of_squares.go:22:36: mnd: Magic number: 2.0, in detected (gomnd) + return int(math.Pow(float64(sum), 2.0)) + ^ +difference_of_squares.go:33:36: mnd: Magic number: 2.0, in detected (gomnd) + return int(math.Pow(float64(sum), 2.0)) + ^ +difference_of_squares.go:57:35: mnd: Magic number: 2.0, in detected (gomnd) + sum += int(math.Pow(float64(i), 2.0)) + ^ +difference_of_squares_examples_test.go:47:1: tests: ExampleDifference_BruteForce refers to unknown field or method: Difference.BruteForce (govet) +func ExampleDifference_BruteForce() { +^ +difference_of_squares_examples_test.go:35:6: Example_squareOfSumBruteForce contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func Example_squareOfSumBruteForce() { + ^ +difference_of_squares_examples_test.go:41:6: Example_sumOfSquaresBruteForce contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func Example_sumOfSquaresBruteForce() { + ^ +difference_of_squares_test.go:13:1: Function TestSquareOfSum missing the call to method parallel (paralleltest) +func TestSquareOfSum(t *testing.T) { +^ +difference_of_squares_test.go:21:1: Function TestSumOfSquares missing the call to method parallel (paralleltest) +func TestSumOfSquares(t *testing.T) { +^ +difference_of_squares_test.go:29:1: Function TestDifference missing the call to method parallel (paralleltest) +func TestDifference(t *testing.T) { +^ +difference_of_squares_benchmarks_test.go:1:9: package should be `diffsquares_test` instead of `diffsquares` (testpackage) +package diffsquares + ^ +difference_of_squares_examples_test.go:1:9: package should be `diffsquares_test` instead of `diffsquares` (testpackage) +package diffsquares + ^ +difference_of_squares_test.go:1:9: package should be `diffsquares_test` instead of `diffsquares` (testpackage) +package diffsquares + ^ +difference_of_squares_benchmarks_test.go:76:6: variable name 'r' is too short for the scope of its usage (varnamelen) + var r int + ^ +difference_of_squares_benchmarks_test.go:48:6: variable name 'r' is too short for the scope of its usage (varnamelen) + var r int + ^ +difference_of_squares_benchmarks_test.go:20:6: variable name 'r' is too short for the scope of its usage (varnamelen) + var r int + ^ + +real 0m0.529s +user 0m0.838s +sys 0m0.472s + + + ============================================================================== + +Exit code: -1 + +real 0m0.556s +user 0m0.850s +sys 0m0.493s + +real 0m0.558s +user 0m0.850s +sys 0m0.495s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out diffsquares +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.006s +sys 0m0.011s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +difference_of_squares.go + (7, 19) https://revive.run/r#var-declaration should omit type string from declaration of var defaultMethod; it will be inferred from the right-hand side + (20, 10) https://revive.run/r#var-declaration should omit type int from declaration of var sum; it will be inferred from the right-hand side + (47, 10) https://revive.run/r#var-declaration should omit type int from declaration of var sum; it will be inferred from the right-hand side + + + ✖ 3 problems (0 errors) (3 warnings) + +real 0m0.058s +user 0m0.026s +sys 0m0.048s + + + ============================================================================== + +Exit code: 0 + +real 0m0.083s +user 0m0.037s +sys 0m0.069s + +real 0m0.085s +user 0m0.037s +sys 0m0.071s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.013s +sys 0m0.015s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "math" without types was imported from "diffsquares" + +real 0m0.101s +user 0m0.136s +sys 0m0.112s + + + ============================================================================== + +Exit code: -1 + +real 0m0.146s +user 0m0.162s +sys 0m0.143s + +real 0m0.148s +user 0m0.162s +sys 0m0.145s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.016s +user 0m0.010s +sys 0m0.011s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +difference_of_squares.go:20:10: should omit type int from declaration; it will be inferred from the right-hand side (ST1023) +difference_of_squares.go:47:10: should omit type int from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.199s +user 0m0.253s +sys 0m0.158s + + + ============================================================================== + +Exit code: -1 + +real 0m0.226s +user 0m0.268s +sys 0m0.179s + +real 0m0.227s +user 0m0.269s +sys 0m0.179s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.005s +sys 0m0.017s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.800s +user 0m1.849s +sys 0m0.322s + + + ============================================================================== + +Exit code: 0 + +real 0m0.831s +user 0m1.862s +sys 0m0.347s + +real 0m0.833s +user 0m1.863s +sys 0m0.349s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.012s +sys 0m0.011s + + + ============================================================================== + +Running: go vet ./... + +# diffsquares +./difference_of_squares_examples_test.go:47:1: ExampleDifference_BruteForce refers to unknown field or method: Difference.BruteForce + +real 0m0.076s +user 0m0.127s +sys 0m0.092s + + + ============================================================================== + +Exit code: -1 + +real 0m0.113s +user 0m0.145s +sys 0m0.119s + +real 0m0.115s +user 0m0.146s +sys 0m0.119s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.008s +sys 0m0.009s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.017s +user 0m0.007s +sys 0m0.012s + + + ============================================================================== + +Exit code: 0 + +real 0m0.043s +user 0m0.021s +sys 0m0.032s + +real 0m0.045s +user 0m0.022s +sys 0m0.033s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.008s +sys 0m0.012s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.403s +user 0m1.111s +sys 0m0.244s + + + ============================================================================== + +Exit code: 0 + +real 0m0.435s +user 0m1.126s +sys 0m0.270s + +real 0m0.437s +user 0m1.128s +sys 0m0.271s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.010s +sys 0m0.016s + + + ============================================================================== + +Running: gocyclo . + +3 diffsquares BenchmarkDifference difference_of_squares_test.go:58:1 +3 diffsquares BenchmarkSumOfSquares difference_of_squares_test.go:49:1 +3 diffsquares BenchmarkSquareOfSum difference_of_squares_test.go:40:1 +3 diffsquares TestDifference difference_of_squares_test.go:29:1 +3 diffsquares TestSumOfSquares difference_of_squares_test.go:21:1 +3 diffsquares TestSquareOfSum difference_of_squares_test.go:13:1 +3 diffsquares BenchmarkDifference2 difference_of_squares_benchmarks_test.go:75:1 +3 diffsquares Benchmark_sumOfSquaresGauss difference_of_squares_benchmarks_test.go:61:1 +3 diffsquares Benchmark_squareOfSumGauss difference_of_squares_benchmarks_test.go:47:1 +3 diffsquares Benchmark_sumOfSquaresBruteForce difference_of_squares_benchmarks_test.go:33:1 +3 diffsquares Benchmark_squareOfSumBruteForce difference_of_squares_benchmarks_test.go:19:1 +2 diffsquares sumOfSquaresBruteForce difference_of_squares.go:53:1 +2 diffsquares SumOfSquares difference_of_squares.go:37:1 +2 diffsquares squareOfSumBruteForce difference_of_squares.go:26:1 +2 diffsquares SquareOfSum difference_of_squares.go:10:1 +1 diffsquares ExampleDifference_BruteForce difference_of_squares_examples_test.go:47:1 +1 diffsquares Example_sumOfSquaresBruteForce difference_of_squares_examples_test.go:41:1 +1 diffsquares Example_squareOfSumBruteForce difference_of_squares_examples_test.go:35:1 +1 diffsquares ExampleDifference difference_of_squares_examples_test.go:25:1 +1 diffsquares ExampleSumOfSquares difference_of_squares_examples_test.go:15:1 +1 diffsquares ExampleSquareOfSum difference_of_squares_examples_test.go:5:1 +1 diffsquares Difference difference_of_squares.go:64:1 +1 diffsquares sumOfSquaresGauss difference_of_squares.go:46:1 +1 diffsquares squareOfSumGauss difference_of_squares.go:19:1 + +real 0m0.006s +user 0m0.002s +sys 0m0.004s + + + ============================================================================== + +Exit code: 0 + +real 0m0.041s +user 0m0.017s +sys 0m0.032s + +real 0m0.042s +user 0m0.017s +sys 0m0.034s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.029s +user 0m0.043s +sys 0m0.010s + + + ============================================================================== + +Exit code: 0 + +real 0m0.045s +user 0m0.056s +sys 0m0.022s + +real 0m0.048s +user 0m0.057s +sys 0m0.023s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.006s +sys 0m0.012s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:22:21 Including rules: default +[gosec] 2023/09/07 00:22:21 Excluding rules: default +[gosec] 2023/09/07 00:22:21 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/difference-of-squares +[gosec] 2023/09/07 00:22:21 Checking package: diffsquares +[gosec] 2023/09/07 00:22:21 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/difference-of-squares/difference_of_squares.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 66 + Nosec : 0 + Issues : 0 + + +real 0m0.098s +user 0m0.076s +sys 0m0.072s + + + ============================================================================== + +Exit code: 0 + +real 0m0.123s +user 0m0.090s +sys 0m0.089s + +real 0m0.126s +user 0m0.091s +sys 0m0.091s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.003s +sys 0m0.016s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestSquareOfSum --- PASS: TestSquareOfSum (0.00s) === RUN TestSumOfSquares @@ -34,15 +676,17 @@ go test -v -covermode=count -coverprofile coverage.out diffsquares --- PASS: ExampleDifference_BruteForce (0.00s) PASS coverage: 100.0% of statements -ok diffsquares 0.011s coverage: 100.0% of statements +ok diffsquares 0.002s coverage: 100.0% of statements -real 0m0.601s -user 0m0.681s -sys 0m0.473s +real 0m0.191s +user 0m0.242s +sys 0m0.182s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + diffsquares/difference_of_squares.go:10: SquareOfSum 100.0% diffsquares/difference_of_squares.go:19: squareOfSumGauss 100.0% diffsquares/difference_of_squares.go:26: squareOfSumBruteForce 100.0% @@ -52,13 +696,40 @@ diffsquares/difference_of_squares.go:53: sumOfSquaresBruteForce 100.0% diffsquares/difference_of_squares.go:64: Difference 100.0% total: (statements) 100.0% -real 0m0.134s -user 0m0.062s -sys 0m0.121s +real 0m0.029s +user 0m0.019s +sys 0m0.023s -=============================================================================== -go test -v -race -covermode=atomic diffsquares + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.026s +user 0m0.013s +sys 0m0.024s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.013s +user 0m0.003s +sys 0m0.014s + +real 0m0.013s +user 0m0.003s +sys 0m0.014s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestSquareOfSum --- PASS: TestSquareOfSum (0.00s) === RUN TestSumOfSquares @@ -79,121 +750,348 @@ go test -v -race -covermode=atomic diffsquares --- PASS: ExampleDifference_BruteForce (0.00s) PASS coverage: 100.0% of statements -ok diffsquares 0.050s coverage: 100.0% of statements +ok diffsquares 1.014s coverage: 100.0% of statements + +real 0m1.240s +user 0m0.259s +sys 0m0.160s + -real 0m0.727s -user 0m0.786s -sys 0m0.548s + ============================================================================== + +Exit code: 0 + +real 0m1.527s +user 0m0.548s +sys 0m0.424s + +real 0m1.529s +user 0m0.550s +sys 0m0.425s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: diffsquares -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -Benchmark_squareOfSumBruteForce/input_size_10-4 29426822 36.32 ns/op 0 B/op 0 allocs/op -Benchmark_squareOfSumBruteForce/input_size_100-4 8640528 131.1 ns/op 0 B/op 0 allocs/op -Benchmark_squareOfSumBruteForce/input_size_1000-4 1308825 945.4 ns/op 0 B/op 0 allocs/op -Benchmark_squareOfSumBruteForce/input_size_10000-4 115472 9273 ns/op 0 B/op 0 allocs/op -Benchmark_sumOfSquaresBruteForce/input_size_10-4 3680767 291.4 ns/op 0 B/op 0 allocs/op -Benchmark_sumOfSquaresBruteForce/input_size_100-4 341122 3511 ns/op 0 B/op 0 allocs/op -Benchmark_sumOfSquaresBruteForce/input_size_1000-4 32896 34281 ns/op 0 B/op 0 allocs/op -Benchmark_sumOfSquaresBruteForce/input_size_10000-4 3711 347095 ns/op 0 B/op 0 allocs/op -Benchmark_squareOfSumGauss/input_size_10-4 26699696 50.20 ns/op 0 B/op 0 allocs/op -Benchmark_squareOfSumGauss/input_size_100-4 30163941 34.02 ns/op 0 B/op 0 allocs/op -Benchmark_squareOfSumGauss/input_size_1000-4 38001340 34.72 ns/op 0 B/op 0 allocs/op -Benchmark_squareOfSumGauss/input_size_10000-4 31666057 35.09 ns/op 0 B/op 0 allocs/op -Benchmark_sumOfSquaresGauss/input_size_10-4 439645538 2.339 ns/op 0 B/op 0 allocs/op -Benchmark_sumOfSquaresGauss/input_size_100-4 497528520 2.323 ns/op 0 B/op 0 allocs/op -Benchmark_sumOfSquaresGauss/input_size_1000-4 483448791 2.396 ns/op 0 B/op 0 allocs/op -Benchmark_sumOfSquaresGauss/input_size_10000-4 438887734 2.466 ns/op 0 B/op 0 allocs/op -BenchmarkDifference2/input_size_10-4 26115793 43.57 ns/op 0 B/op 0 allocs/op -BenchmarkDifference2/input_size_100-4 26788078 43.28 ns/op 0 B/op 0 allocs/op -BenchmarkDifference2/input_size_1000-4 28098295 43.96 ns/op 0 B/op 0 allocs/op -BenchmarkDifference2/input_size_10000-4 21875874 45.85 ns/op 0 B/op 0 allocs/op -BenchmarkSquareOfSum-4 31738362 37.79 ns/op 0 B/op 0 allocs/op -BenchmarkSumOfSquares-4 241435201 5.311 ns/op 0 B/op 0 allocs/op -BenchmarkDifference-4 28246478 43.55 ns/op 0 B/op 0 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +Benchmark_squareOfSumBruteForce +Benchmark_squareOfSumBruteForce/input_size_10 +Benchmark_squareOfSumBruteForce/input_size_10-8 65260878 18.76 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumBruteForce/input_size_100 +Benchmark_squareOfSumBruteForce/input_size_100-8 28727955 39.90 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumBruteForce/input_size_1000 +Benchmark_squareOfSumBruteForce/input_size_1000-8 4833860 238.2 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumBruteForce/input_size_10000 +Benchmark_squareOfSumBruteForce/input_size_10000-8 506860 2329 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresBruteForce +Benchmark_sumOfSquaresBruteForce/input_size_10 +Benchmark_sumOfSquaresBruteForce/input_size_10-8 9536739 123.3 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresBruteForce/input_size_100 +Benchmark_sumOfSquaresBruteForce/input_size_100-8 871184 1466 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresBruteForce/input_size_1000 +Benchmark_sumOfSquaresBruteForce/input_size_1000-8 88890 13647 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresBruteForce/input_size_10000 +Benchmark_sumOfSquaresBruteForce/input_size_10000-8 8983 137880 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumGauss +Benchmark_squareOfSumGauss/input_size_10 +Benchmark_squareOfSumGauss/input_size_10-8 81535269 14.85 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumGauss/input_size_100 +Benchmark_squareOfSumGauss/input_size_100-8 64242895 15.68 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumGauss/input_size_1000 +Benchmark_squareOfSumGauss/input_size_1000-8 69711468 14.94 ns/op 0 B/op 0 allocs/op +Benchmark_squareOfSumGauss/input_size_10000 +Benchmark_squareOfSumGauss/input_size_10000-8 72954270 15.52 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresGauss +Benchmark_sumOfSquaresGauss/input_size_10 +Benchmark_sumOfSquaresGauss/input_size_10-8 1000000000 0.9166 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresGauss/input_size_100 +Benchmark_sumOfSquaresGauss/input_size_100-8 1000000000 0.8591 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresGauss/input_size_1000 +Benchmark_sumOfSquaresGauss/input_size_1000-8 1000000000 0.8592 ns/op 0 B/op 0 allocs/op +Benchmark_sumOfSquaresGauss/input_size_10000 +Benchmark_sumOfSquaresGauss/input_size_10000-8 1000000000 0.9019 ns/op 0 B/op 0 allocs/op +BenchmarkDifference2 +BenchmarkDifference2/input_size_10 +BenchmarkDifference2/input_size_10-8 58354600 18.40 ns/op 0 B/op 0 allocs/op +BenchmarkDifference2/input_size_100 +BenchmarkDifference2/input_size_100-8 68028196 18.28 ns/op 0 B/op 0 allocs/op +BenchmarkDifference2/input_size_1000 +BenchmarkDifference2/input_size_1000-8 73059724 17.84 ns/op 0 B/op 0 allocs/op +BenchmarkDifference2/input_size_10000 +BenchmarkDifference2/input_size_10000-8 67205625 17.88 ns/op 0 B/op 0 allocs/op +BenchmarkSquareOfSum +BenchmarkSquareOfSum-8 72406717 16.56 ns/op 0 B/op 0 allocs/op +BenchmarkSumOfSquares +BenchmarkSumOfSquares-8 656380638 1.702 ns/op 0 B/op 0 allocs/op +BenchmarkDifference +BenchmarkDifference-8 72435668 17.44 ns/op 0 B/op 0 allocs/op PASS -ok diffsquares 36.072s +ok diffsquares 30.095s -real 0m36.562s -user 0m38.104s -sys 0m0.711s +real 0m30.237s +user 0m30.299s +sys 0m0.184s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestSquareOfSum +--- PASS: TestSquareOfSum (0.00s) +=== RUN TestSumOfSquares +--- PASS: TestSumOfSquares (0.00s) +=== RUN TestDifference +--- PASS: TestDifference (0.00s) +=== RUN ExampleSquareOfSum +--- PASS: ExampleSquareOfSum (0.00s) +=== RUN ExampleSumOfSquares +--- PASS: ExampleSumOfSquares (0.00s) +=== RUN ExampleDifference +--- PASS: ExampleDifference (0.00s) +=== RUN Example_squareOfSumBruteForce +--- PASS: Example_squareOfSumBruteForce (0.00s) +=== RUN Example_sumOfSquaresBruteForce +--- PASS: Example_sumOfSquaresBruteForce (0.00s) +=== RUN ExampleDifference_BruteForce +--- PASS: ExampleDifference_BruteForce (0.00s) PASS -ok diffsquares 0.005s +ok diffsquares 0.002s -real 0m0.619s -user 0m0.742s -sys 0m0.468s +real 0m0.138s +user 0m0.178s +sys 0m0.129s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m0.735s -user 0m0.727s -sys 0m0.394s - benchstat benchstat-old.txt benchstat-new.txt +benchstat-new.txt:5: missing iteration count +benchstat-new.txt:6: missing iteration count +benchstat-new.txt:8: missing iteration count +benchstat-new.txt:10: missing iteration count +benchstat-new.txt:12: missing iteration count +benchstat-new.txt:14: missing iteration count +benchstat-new.txt:15: missing iteration count +benchstat-new.txt:17: missing iteration count +benchstat-new.txt:19: missing iteration count +benchstat-new.txt:21: missing iteration count +benchstat-new.txt:23: missing iteration count +benchstat-new.txt:24: missing iteration count +benchstat-new.txt:26: missing iteration count +benchstat-new.txt:28: missing iteration count +benchstat-new.txt:30: missing iteration count +benchstat-new.txt:32: missing iteration count +benchstat-new.txt:33: missing iteration count +benchstat-new.txt:35: missing iteration count +benchstat-new.txt:37: missing iteration count +benchstat-new.txt:39: missing iteration count +benchstat-new.txt:41: missing iteration count +benchstat-new.txt:42: missing iteration count +benchstat-new.txt:44: missing iteration count +benchstat-new.txt:46: missing iteration count +benchstat-new.txt:48: missing iteration count +benchstat-new.txt:50: missing iteration count +benchstat-new.txt:52: missing iteration count +benchstat-new.txt:54: missing iteration count +goos: linux +goarch: amd64 +pkg: diffsquares +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +_squareOfSumBruteForce/input_size_10-8 18.76n ± ∞ ¹ +_squareOfSumBruteForce/input_size_100-8 39.90n ± ∞ ¹ +_squareOfSumBruteForce/input_size_1000-8 238.2n ± ∞ ¹ +_squareOfSumBruteForce/input_size_10000-8 2.329µ ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_10-8 123.3n ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_100-8 1.466µ ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_1000-8 13.65µ ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_10000-8 137.9µ ± ∞ ¹ +_squareOfSumGauss/input_size_10-8 14.85n ± ∞ ¹ +_squareOfSumGauss/input_size_100-8 15.68n ± ∞ ¹ +_squareOfSumGauss/input_size_1000-8 14.94n ± ∞ ¹ +_squareOfSumGauss/input_size_10000-8 15.52n ± ∞ ¹ +_sumOfSquaresGauss/input_size_10-8 0.9166n ± ∞ ¹ +_sumOfSquaresGauss/input_size_100-8 0.8591n ± ∞ ¹ +_sumOfSquaresGauss/input_size_1000-8 0.8592n ± ∞ ¹ +_sumOfSquaresGauss/input_size_10000-8 0.9019n ± ∞ ¹ +Difference2/input_size_10-8 18.40n ± ∞ ¹ +Difference2/input_size_100-8 18.28n ± ∞ ¹ +Difference2/input_size_1000-8 17.84n ± ∞ ¹ +Difference2/input_size_10000-8 17.88n ± ∞ ¹ +SquareOfSum-8 16.56n ± ∞ ¹ +SumOfSquares-8 1.702n ± ∞ ¹ +Difference-8 17.44n ± ∞ ¹ +geomean 34.57n +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.030s -user 0m0.018s -sys 0m0.026s - -=============================================================================== - -go vet diffsquares -# diffsquares -./difference_of_squares_examples_test.go:47:1: ExampleDifference_BruteForce refers to unknown field or method: Difference.BruteForce - -real 0m0.407s -user 0m0.516s -sys 0m0.346s + │ benchstat-new.txt │ + │ B/op │ +_squareOfSumBruteForce/input_size_10-8 0.000 ± ∞ ¹ +_squareOfSumBruteForce/input_size_100-8 0.000 ± ∞ ¹ +_squareOfSumBruteForce/input_size_1000-8 0.000 ± ∞ ¹ +_squareOfSumBruteForce/input_size_10000-8 0.000 ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_10-8 0.000 ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_100-8 0.000 ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_1000-8 0.000 ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_10000-8 0.000 ± ∞ ¹ +_squareOfSumGauss/input_size_10-8 0.000 ± ∞ ¹ +_squareOfSumGauss/input_size_100-8 0.000 ± ∞ ¹ +_squareOfSumGauss/input_size_1000-8 0.000 ± ∞ ¹ +_squareOfSumGauss/input_size_10000-8 0.000 ± ∞ ¹ +_sumOfSquaresGauss/input_size_10-8 0.000 ± ∞ ¹ +_sumOfSquaresGauss/input_size_100-8 0.000 ± ∞ ¹ +_sumOfSquaresGauss/input_size_1000-8 0.000 ± ∞ ¹ +_sumOfSquaresGauss/input_size_10000-8 0.000 ± ∞ ¹ +Difference2/input_size_10-8 0.000 ± ∞ ¹ +Difference2/input_size_100-8 0.000 ± ∞ ¹ +Difference2/input_size_1000-8 0.000 ± ∞ ¹ +Difference2/input_size_10000-8 0.000 ± ∞ ¹ +SquareOfSum-8 0.000 ± ∞ ¹ +SumOfSquares-8 0.000 ± ∞ ¹ +Difference-8 0.000 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean -=============================================================================== + │ benchstat-new.txt │ + │ allocs/op │ +_squareOfSumBruteForce/input_size_10-8 0.000 ± ∞ ¹ +_squareOfSumBruteForce/input_size_100-8 0.000 ± ∞ ¹ +_squareOfSumBruteForce/input_size_1000-8 0.000 ± ∞ ¹ +_squareOfSumBruteForce/input_size_10000-8 0.000 ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_10-8 0.000 ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_100-8 0.000 ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_1000-8 0.000 ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_10000-8 0.000 ± ∞ ¹ +_squareOfSumGauss/input_size_10-8 0.000 ± ∞ ¹ +_squareOfSumGauss/input_size_100-8 0.000 ± ∞ ¹ +_squareOfSumGauss/input_size_1000-8 0.000 ± ∞ ¹ +_squareOfSumGauss/input_size_10000-8 0.000 ± ∞ ¹ +_sumOfSquaresGauss/input_size_10-8 0.000 ± ∞ ¹ +_sumOfSquaresGauss/input_size_100-8 0.000 ± ∞ ¹ +_sumOfSquaresGauss/input_size_1000-8 0.000 ± ∞ ¹ +_sumOfSquaresGauss/input_size_10000-8 0.000 ± ∞ ¹ +Difference2/input_size_10-8 0.000 ± ∞ ¹ +Difference2/input_size_100-8 0.000 ± ∞ ¹ +Difference2/input_size_1000-8 0.000 ± ∞ ¹ +Difference2/input_size_10000-8 0.000 ± ∞ ¹ +SquareOfSum-8 0.000 ± ∞ ¹ +SumOfSquares-8 0.000 ± ∞ ¹ +Difference-8 0.000 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean -go fix diffsquares - -real 0m0.059s -user 0m0.028s -sys 0m0.056s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +_squareOfSumBruteForce/input_size_10-4 36.32n ± ∞ ¹ +_squareOfSumBruteForce/input_size_100-4 131.1n ± ∞ ¹ +_squareOfSumBruteForce/input_size_1000-4 945.4n ± ∞ ¹ +_squareOfSumBruteForce/input_size_10000-4 9.273µ ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_10-4 291.4n ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_100-4 3.511µ ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_1000-4 34.28µ ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_10000-4 347.1µ ± ∞ ¹ +_squareOfSumGauss/input_size_10-4 50.20n ± ∞ ¹ +_squareOfSumGauss/input_size_100-4 34.02n ± ∞ ¹ +_squareOfSumGauss/input_size_1000-4 34.72n ± ∞ ¹ +_squareOfSumGauss/input_size_10000-4 35.09n ± ∞ ¹ +_sumOfSquaresGauss/input_size_10-4 2.339n ± ∞ ¹ +_sumOfSquaresGauss/input_size_100-4 2.323n ± ∞ ¹ +_sumOfSquaresGauss/input_size_1000-4 2.396n ± ∞ ¹ +_sumOfSquaresGauss/input_size_10000-4 2.466n ± ∞ ¹ +Difference2/input_size_10-4 43.57n ± ∞ ¹ +Difference2/input_size_100-4 43.28n ± ∞ ¹ +Difference2/input_size_1000-4 43.96n ± ∞ ¹ +Difference2/input_size_10000-4 45.85n ± ∞ ¹ +SquareOfSum-4 37.79n ± ∞ ¹ +SumOfSquares-4 5.311n ± ∞ ¹ +Difference-4 43.55n ± ∞ ¹ +geomean 90.95n +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +_squareOfSumBruteForce/input_size_10-4 0.000 ± ∞ ¹ +_squareOfSumBruteForce/input_size_100-4 0.000 ± ∞ ¹ +_squareOfSumBruteForce/input_size_1000-4 0.000 ± ∞ ¹ +_squareOfSumBruteForce/input_size_10000-4 0.000 ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_10-4 0.000 ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_100-4 0.000 ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_1000-4 0.000 ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_10000-4 0.000 ± ∞ ¹ +_squareOfSumGauss/input_size_10-4 0.000 ± ∞ ¹ +_squareOfSumGauss/input_size_100-4 0.000 ± ∞ ¹ +_squareOfSumGauss/input_size_1000-4 0.000 ± ∞ ¹ +_squareOfSumGauss/input_size_10000-4 0.000 ± ∞ ¹ +_sumOfSquaresGauss/input_size_10-4 0.000 ± ∞ ¹ +_sumOfSquaresGauss/input_size_100-4 0.000 ± ∞ ¹ +_sumOfSquaresGauss/input_size_1000-4 0.000 ± ∞ ¹ +_sumOfSquaresGauss/input_size_10000-4 0.000 ± ∞ ¹ +Difference2/input_size_10-4 0.000 ± ∞ ¹ +Difference2/input_size_100-4 0.000 ± ∞ ¹ +Difference2/input_size_1000-4 0.000 ± ∞ ¹ +Difference2/input_size_10000-4 0.000 ± ∞ ¹ +SquareOfSum-4 0.000 ± ∞ ¹ +SumOfSquares-4 0.000 ± ∞ ¹ +Difference-4 0.000 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean -gosec ./difference-of-squares -[gosec] 2022/06/23 22:04:48 Including rules: default -[gosec] 2022/06/23 22:04:48 Excluding rules: default -[gosec] 2022/06/23 22:04:48 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/difference-of-squares -2022/06/23 22:04:48 internal error: package "math" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +_squareOfSumBruteForce/input_size_10-4 0.000 ± ∞ ¹ +_squareOfSumBruteForce/input_size_100-4 0.000 ± ∞ ¹ +_squareOfSumBruteForce/input_size_1000-4 0.000 ± ∞ ¹ +_squareOfSumBruteForce/input_size_10000-4 0.000 ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_10-4 0.000 ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_100-4 0.000 ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_1000-4 0.000 ± ∞ ¹ +_sumOfSquaresBruteForce/input_size_10000-4 0.000 ± ∞ ¹ +_squareOfSumGauss/input_size_10-4 0.000 ± ∞ ¹ +_squareOfSumGauss/input_size_100-4 0.000 ± ∞ ¹ +_squareOfSumGauss/input_size_1000-4 0.000 ± ∞ ¹ +_squareOfSumGauss/input_size_10000-4 0.000 ± ∞ ¹ +_sumOfSquaresGauss/input_size_10-4 0.000 ± ∞ ¹ +_sumOfSquaresGauss/input_size_100-4 0.000 ± ∞ ¹ +_sumOfSquaresGauss/input_size_1000-4 0.000 ± ∞ ¹ +_sumOfSquaresGauss/input_size_10000-4 0.000 ± ∞ ¹ +Difference2/input_size_10-4 0.000 ± ∞ ¹ +Difference2/input_size_100-4 0.000 ± ∞ ¹ +Difference2/input_size_1000-4 0.000 ± ∞ ¹ +Difference2/input_size_10000-4 0.000 ± ∞ ¹ +SquareOfSum-4 0.000 ± ∞ ¹ +SumOfSquares-4 0.000 ± ∞ ¹ +Difference-4 0.000 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean -real 0m0.384s -user 0m0.425s -sys 0m0.337s +real 0m0.006s +user 0m0.004s +sys 0m0.003s =============================================================================== gomarkdoc --output diffsquares-doc.md -real 0m0.030s -user 0m0.020s -sys 0m0.011s +real 0m0.010s +user 0m0.007s +sys 0m0.003s =============================================================================== go doc -all diffsquares package diffsquares // import "diffsquares" -Package diffsquares finds the difference between the square of the sum and -the sum of the squares of the first N natural numbers. +Package diffsquares finds the difference between the square of the sum and the +sum of the squares of the first N natural numbers. FUNCTIONS @@ -210,9 +1108,9 @@ func SumOfSquares(n int) int squares (starting with 1 to 10, inclusive). -real 0m0.134s -user 0m0.072s -sys 0m0.099s +real 0m0.027s +user 0m0.014s +sys 0m0.019s =============================================================================== diff --git a/go/election-day/benchstat-new.txt b/go/election-day/benchstat-new.txt index 9dcf8251..7bdb3ebe 100644 --- a/go/election-day/benchstat-new.txt +++ b/go/election-day/benchstat-new.txt @@ -1,2 +1,2 @@ PASS -ok electionday 0.028s +ok electionday 0.002s diff --git a/go/election-day/benchstat-old.txt b/go/election-day/benchstat-old.txt new file mode 100644 index 00000000..9dcf8251 --- /dev/null +++ b/go/election-day/benchstat-old.txt @@ -0,0 +1,2 @@ +PASS +ok electionday 0.028s diff --git a/go/election-day/coverage-annotations.txt b/go/election-day/coverage-annotations.txt new file mode 100644 index 00000000..94f03590 --- /dev/null +++ b/go/election-day/coverage-annotations.txt @@ -0,0 +1,9 @@ + +31 func IncrementVoteCount(counter *int, increment int) { +32 if counter != nil { +33 *counter += increment +34 } else { +35 MISS *counter = increment +36 } +37 } + diff --git a/go/election-day/coverage.out b/go/election-day/coverage.out index 0f30acd0..79fc24f2 100644 --- a/go/election-day/coverage.out +++ b/go/election-day/coverage.out @@ -1,9 +1,9 @@ mode: count electionday/election_day.go:9.44,15.2 3 2 electionday/election_day.go:18.34,21.20 2 4 -electionday/election_day.go:27.2,27.14 1 4 electionday/election_day.go:21.20,23.3 1 2 electionday/election_day.go:23.8,25.3 1 2 +electionday/election_day.go:27.2,27.14 1 4 electionday/election_day.go:31.54,32.20 1 4 electionday/election_day.go:32.20,34.3 1 4 electionday/election_day.go:34.8,36.3 1 0 diff --git a/go/election-day/electionday-doc.md b/go/election-day/electionday-doc.md index 47458dc1..73226822 100755 --- a/go/election-day/electionday-doc.md +++ b/go/election-day/electionday-doc.md @@ -130,7 +130,7 @@ true func NewVoteCounter(initialVotes int) *int ``` -NewVoteCounter returns a new vote counter with a given number of initial votes\. +NewVoteCounter returns a new vote counter with a given number of initial votes.

Example

@@ -163,7 +163,7 @@ true func VoteCount(counter *int) int ``` -VoteCount extracts the number of votes from a counter\. +VoteCount extracts the number of votes from a counter.

Example

@@ -196,7 +196,7 @@ VoteCount extracts the number of votes from a counter\. ## type [ElectionResult]() -ElectionResult represents an election result\. +ElectionResult represents an election result. ```go type ElectionResult struct { diff --git a/go/election-day/run-tests-go.txt b/go/election-day/run-tests-go.txt index 80a67957..9d94c584 100644 --- a/go/election-day/run-tests-go.txt +++ b/go/election-day/run-tests-go.txt @@ -5,15 +5,652 @@ Go packages: electionday =============================================================================== -golint electionday +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.022s +sys 0m0.034s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +election_day.go:30:61: Comment should end in a period (godot) +// IncrementVoteCount increments the value in a vote counter + ^ +election_day.go:39:51: Comment should end in a period (godot) +// NewElectionResult creates a new election result + ^ +election_day.go:49:67: Comment should end in a period (godot) +// DisplayResult creates a message with the result to be displayed + ^ +election_day_examples_test.go:79: File is not `gofumpt`-ed (gofumpt) + var finalResults = map[string]int{ +election_day.go:41:13: var-declaration: should omit type ElectionResult from declaration of var result; it will be inferred from the right-hand side (revive) + var result ElectionResult = ElectionResult{ + ^ +election_day_test.go:21:26: Using the variable on range scope `tt` in function literal (scopelint) + got := NewVoteCounter(tt.votes) + ^ +election_day_test.go:23:46: Using the variable on range scope `tt` in function literal (scopelint) + t.Errorf("NewVoteCounter(%d) = %s, &%d", tt.votes, intPtrRepresentation(got), tt.votes) + ^ +election_day_test.go:25:29: Using the variable on range scope `tt` in function literal (scopelint) + if got != nil && *got != tt.votes { + ^ +election_day_examples_test.go:9:2: declarations should never be cuddled (wsl) + var counter *int + ^ +election_day_examples_test.go:37:2: declarations should never be cuddled (wsl) + var voteCounter *int + ^ +election_day_test.go:196:2: return statements should not be cuddled if block has more than two lines (wsl) + return "&" + strconv.Itoa(*p) + ^ +election_day_examples_test.go:48:2: Duplicate words (true) found (dupword) + // true + ^ +election_day_examples_test.go:60:2: Duplicate words (true) found (dupword) + // true + ^ +election_day.go:10:2: S1021: should merge variable declaration with assignment on next line (gosimple) + var counter *int + ^ +election_day.go:51:2: S1021: should merge variable declaration with assignment on next line (gosimple) + var message string + ^ +election_day_examples_test.go:20:2: S1021: should merge variable declaration with assignment on next line (gosimple) + var votes int + ^ +election_day_test.go:8:1: Function TestNewVoteCounter missing the call to method parallel (paralleltest) +func TestNewVoteCounter(t *testing.T) { +^ +election_day_test.go:19:2: Range statement for test TestNewVoteCounter missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +election_day_test.go:32:1: Function TestVoteCount missing the call to method parallel (paralleltest) +func TestVoteCount(t *testing.T) { +^ +election_day_test.go:52:2: Range statement for test TestVoteCount missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +election_day_test.go:61:1: Function TestIncrementVoteCount missing the call to method parallel (paralleltest) +func TestIncrementVoteCount(t *testing.T) { +^ +election_day_test.go:92:2: Range statement for test TestIncrementVoteCount missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +election_day_test.go:109:1: Function TestNewElectionResult missing the call to method parallel (paralleltest) +func TestNewElectionResult(t *testing.T) { +^ +election_day_test.go:127:2: Range statement for test TestNewElectionResult missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +election_day_test.go:139:1: Function TestDisplayResult missing the call to method parallel (paralleltest) +func TestDisplayResult(t *testing.T) { +^ +election_day_test.go:155:2: Range statement for test TestDisplayResult missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +election_day_test.go:164:1: Function TestDecrementVotesOfCandidate missing the call to method parallel (paralleltest) +func TestDecrementVotesOfCandidate(t *testing.T) { +^ +election_day_test.go:181:2: Range statement for test TestDecrementVotesOfCandidate missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +election_day_examples_test.go:1:9: package should be `electionday_test` instead of `electionday` (testpackage) +package electionday + ^ +election_day_test.go:1:9: package should be `electionday_test` instead of `electionday` (testpackage) +package electionday + ^ + +real 0m0.479s +user 0m0.693s +sys 0m0.443s + + + ============================================================================== + +Exit code: -1 + +real 0m0.535s +user 0m0.727s +sys 0m0.491s + +real 0m0.538s +user 0m0.728s +sys 0m0.493s -real 0m0.293s -user 0m0.257s -sys 0m0.272s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.013s +sys 0m0.030s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +election_day.go + (1, 1) https://revive.run/r#package-comments should have a package comment + (41, 13) https://revive.run/r#var-declaration should omit type ElectionResult from declaration of var result; it will be inferred from the right-hand side + + + ✖ 2 problems (0 errors) (2 warnings) + +real 0m0.038s +user 0m0.027s +sys 0m0.025s + + + ============================================================================== + +Exit code: 0 + +real 0m0.072s +user 0m0.047s +sys 0m0.062s + +real 0m0.074s +user 0m0.049s +sys 0m0.063s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.042s +user 0m0.024s +sys 0m0.045s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "electionday" + +real 0m0.108s +user 0m0.141s +sys 0m0.159s + + + ============================================================================== + +Exit code: -1 + +real 0m0.168s +user 0m0.171s +sys 0m0.221s + +real 0m0.169s +user 0m0.172s +sys 0m0.222s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.015s +sys 0m0.021s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +election_day.go:1:1: at least one file in a package should have a package comment (ST1000) +election_day.go:10:2: should merge variable declaration with assignment on next line (S1021) +election_day.go:41:13: should omit type ElectionResult from declaration; it will be inferred from the right-hand side (ST1023) +election_day.go:51:2: should merge variable declaration with assignment on next line (S1021) +election_day_examples_test.go:20:2: should merge variable declaration with assignment on next line (S1021) +election_day_examples_test.go:23:2: should merge variable declaration with assignment on next line (S1021) +election_day_examples_test.go:52:2: should merge variable declaration with assignment on next line (S1021) +election_day_examples_test.go:64:2: should merge variable declaration with assignment on next line (S1021) +election_result.go:1:1: at least one file in a package should have a package comment (ST1000) + +real 0m0.176s +user 0m0.214s +sys 0m0.138s + + + ============================================================================== + +Exit code: -1 + +real 0m0.208s +user 0m0.235s +sys 0m0.166s + +real 0m0.210s +user 0m0.235s +sys 0m0.168s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.025s +sys 0m0.020s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.776s +user 0m1.862s +sys 0m0.326s + + + ============================================================================== + +Exit code: 0 + +real 0m0.810s +user 0m1.890s +sys 0m0.360s + +real 0m0.812s +user 0m1.891s +sys 0m0.361s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.011s +sys 0m0.024s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.079s +user 0m0.098s +sys 0m0.097s + + + ============================================================================== + +Exit code: 0 + +real 0m0.110s +user 0m0.115s +sys 0m0.128s + +real 0m0.112s +user 0m0.116s +sys 0m0.129s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.016s +sys 0m0.018s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.025s +user 0m0.019s +sys 0m0.023s + + + ============================================================================== + +Exit code: 0 + +real 0m0.058s +user 0m0.041s +sys 0m0.049s + +real 0m0.060s +user 0m0.043s +sys 0m0.050s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out electionday +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.022s +sys 0m0.024s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.456s +user 0m1.351s +sys 0m0.218s + + + ============================================================================== + +Exit code: 0 + +real 0m0.494s +user 0m1.377s +sys 0m0.255s + +real 0m0.497s +user 0m1.377s +sys 0m0.257s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.036s +user 0m0.027s +sys 0m0.037s + + + ============================================================================== + +Running: gocyclo . + +5 electionday TestNewElectionResult election_day_test.go:109:1 +5 electionday TestIncrementVoteCount election_day_test.go:61:1 +5 electionday TestNewVoteCounter election_day_test.go:8:1 +4 electionday TestDecrementVotesOfCandidate election_day_test.go:164:1 +4 electionday DecrementVotesOfCandidate election_day.go:59:1 +3 electionday TestDisplayResult election_day_test.go:139:1 +3 electionday TestVoteCount election_day_test.go:32:1 +2 electionday intPtrRepresentation election_day_test.go:192:1 +2 electionday IncrementVoteCount election_day.go:31:1 +2 electionday VoteCount election_day.go:18:1 +1 electionday ExampleDecrementVotesOfCandidate election_day_examples_test.go:78:1 +1 electionday ExampleDisplayResult election_day_examples_test.go:63:1 +1 electionday ExampleNewElectionResult election_day_examples_test.go:51:1 +1 electionday ExampleIncrementVoteCount election_day_examples_test.go:35:1 +1 electionday ExampleVoteCount election_day_examples_test.go:19:1 +1 electionday ExampleNewVoteCounter election_day_examples_test.go:7:1 +1 electionday DisplayResult election_day.go:50:1 +1 electionday NewElectionResult election_day.go:40:1 +1 electionday NewVoteCounter election_day.go:9:1 + +real 0m0.004s +user 0m0.002s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.055s +user 0m0.034s +sys 0m0.053s + +real 0m0.058s +user 0m0.035s +sys 0m0.055s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.034s +user 0m0.032s +sys 0m0.016s + + + ============================================================================== + +Exit code: 0 + +real 0m0.054s +user 0m0.041s +sys 0m0.034s + +real 0m0.057s +user 0m0.043s +sys 0m0.035s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.015s +sys 0m0.024s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:22:56 Including rules: default +[gosec] 2023/09/07 00:22:56 Excluding rules: default +[gosec] 2023/09/07 00:22:56 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/election-day +[gosec] 2023/09/07 00:22:56 Checking package: electionday +[gosec] 2023/09/07 00:22:56 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/election-day/election_day.go +[gosec] 2023/09/07 00:22:56 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/election-day/election_result.go +Results: + + +Summary: + Gosec : dev + Files : 2 + Lines : 74 + Nosec : 0 + Issues : 0 + + +real 0m0.124s +user 0m0.146s +sys 0m0.106s + + + ============================================================================== + +Exit code: 0 + +real 0m0.157s +user 0m0.169s +sys 0m0.137s + +real 0m0.159s +user 0m0.170s +sys 0m0.137s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.035s +user 0m0.034s +sys 0m0.030s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestNewVoteCounter === RUN TestNewVoteCounter/Simple_vote_counter_with_2_votes --- PASS: TestNewVoteCounter (0.00s) @@ -58,15 +695,17 @@ go test -v -covermode=count -coverprofile coverage.out electionday --- PASS: ExampleDecrementVotesOfCandidate (0.00s) PASS coverage: 94.7% of statements -ok electionday 0.017s coverage: 94.7% of statements +ok electionday 0.002s coverage: 94.7% of statements -real 0m2.018s -user 0m2.235s -sys 0m1.467s +real 0m0.206s +user 0m0.287s +sys 0m0.190s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + electionday/election_day.go:9: NewVoteCounter 100.0% electionday/election_day.go:18: VoteCount 100.0% electionday/election_day.go:31: IncrementVoteCount 66.7% @@ -75,21 +714,49 @@ electionday/election_day.go:50: DisplayResult 100.0% electionday/election_day.go:59: DecrementVotesOfCandidate 100.0% total: (statements) 94.7% -real 0m0.445s -user 0m0.370s -sys 0m0.428s +real 0m0.050s +user 0m0.059s +sys 0m0.064s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.468s -user 0m0.482s -sys 0m0.418s +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.048s +user 0m0.063s +sys 0m0.083s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +31 func IncrementVoteCount(counter *int, increment int) { +32 if counter != nil { +33 *counter += increment +34 } else { +35 MISS *counter = increment +36 } +37 } + + +real 0m0.022s +user 0m0.014s +sys 0m0.028s + +real 0m0.022s +user 0m0.014s +sys 0m0.028s -=============================================================================== -go test -v -race -covermode=atomic electionday + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestNewVoteCounter === RUN TestNewVoteCounter/Simple_vote_counter_with_2_votes --- PASS: TestNewVoteCounter (0.00s) @@ -134,71 +801,105 @@ go test -v -race -covermode=atomic electionday --- PASS: ExampleDecrementVotesOfCandidate (0.00s) PASS coverage: 94.7% of statements -ok electionday 0.080s coverage: 94.7% of statements +ok electionday 1.015s coverage: 94.7% of statements -real 0m1.739s -user 0m1.511s -sys 0m0.975s +real 0m1.278s +user 0m0.314s +sys 0m0.185s -=============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -PASS -ok electionday 0.028s + ============================================================================== -real 0m1.098s -user 0m1.389s -sys 0m0.947s +Exit code: 0 -=============================================================================== +real 0m1.658s +user 0m0.782s +sys 0m0.594s -go test -tags bonus -PASS -ok electionday 0.019s - -real 0m0.882s -user 0m1.016s -sys 0m0.592s +real 0m1.661s +user 0m0.784s +sys 0m0.595s =============================================================================== -No old benchmarks to run benchstat against. - -=============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go vet electionday +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok electionday 0.002s -real 0m0.736s -user 0m0.867s -sys 0m0.670s +real 0m0.144s +user 0m0.183s +sys 0m0.161s =============================================================================== -go fix electionday +gotest -v -tags bonus +=== RUN TestNewVoteCounter +=== RUN TestNewVoteCounter/Simple_vote_counter_with_2_votes +--- PASS: TestNewVoteCounter (0.00s) + --- PASS: TestNewVoteCounter/Simple_vote_counter_with_2_votes (0.00s) +=== RUN TestVoteCount +=== RUN TestVoteCount/Call_to_VoteCount_with_a_nil_argument +=== RUN TestVoteCount/Call_to_VoteCount_with_a_pointer_to_an_int_with_a_value_of_2 +--- PASS: TestVoteCount (0.00s) + --- PASS: TestVoteCount/Call_to_VoteCount_with_a_nil_argument (0.00s) + --- PASS: TestVoteCount/Call_to_VoteCount_with_a_pointer_to_an_int_with_a_value_of_2 (0.00s) +=== RUN TestIncrementVoteCount +=== RUN TestIncrementVoteCount/Call_to_IncrementVoteCount_with_a_pointer_to_an_int_with_a_value_of_0_and_increment_of_1 +=== RUN TestIncrementVoteCount/Call_to_IncrementVoteCount_with_a_pointer_to_an_int_with_a_value_of_2_and_increment_of_2 +=== RUN TestIncrementVoteCount/Call_to_IncrementVoteCount_with_a_pointer_to_an_int_with_a_value_of_5_and_increment_of_7 +--- PASS: TestIncrementVoteCount (0.00s) + --- PASS: TestIncrementVoteCount/Call_to_IncrementVoteCount_with_a_pointer_to_an_int_with_a_value_of_0_and_increment_of_1 (0.00s) + --- PASS: TestIncrementVoteCount/Call_to_IncrementVoteCount_with_a_pointer_to_an_int_with_a_value_of_2_and_increment_of_2 (0.00s) + --- PASS: TestIncrementVoteCount/Call_to_IncrementVoteCount_with_a_pointer_to_an_int_with_a_value_of_5_and_increment_of_7 (0.00s) +=== RUN TestNewElectionResult +=== RUN TestNewElectionResult/Call_to_NewElectionResult_for_Peter_with_2_votes +--- PASS: TestNewElectionResult (0.00s) + --- PASS: TestNewElectionResult/Call_to_NewElectionResult_for_Peter_with_2_votes (0.00s) +=== RUN TestDisplayResult +=== RUN TestDisplayResult/Call_to_DisplayResult_for_John_with_5_votes +--- PASS: TestDisplayResult (0.00s) + --- PASS: TestDisplayResult/Call_to_DisplayResult_for_John_with_5_votes (0.00s) +=== RUN TestDecrementVotesOfCandidate +=== RUN TestDecrementVotesOfCandidate/Call_to_DecrementVotesOfCandidate_for_John_with_3_votes +--- PASS: TestDecrementVotesOfCandidate (0.00s) + --- PASS: TestDecrementVotesOfCandidate/Call_to_DecrementVotesOfCandidate_for_John_with_3_votes (0.00s) +=== RUN ExampleNewVoteCounter +--- PASS: ExampleNewVoteCounter (0.00s) +=== RUN ExampleVoteCount +--- PASS: ExampleVoteCount (0.00s) +=== RUN ExampleIncrementVoteCount +--- PASS: ExampleIncrementVoteCount (0.00s) +=== RUN ExampleNewElectionResult +--- PASS: ExampleNewElectionResult (0.00s) +=== RUN ExampleDisplayResult +--- PASS: ExampleDisplayResult (0.00s) +=== RUN ExampleDecrementVotesOfCandidate +--- PASS: ExampleDecrementVotesOfCandidate (0.00s) +PASS +ok electionday 0.002s -real 0m0.264s -user 0m0.306s -sys 0m0.246s +real 0m0.129s +user 0m0.173s +sys 0m0.134s =============================================================================== -gosec ./election-day -[gosec] 2022/07/28 07:52:51 Including rules: default -[gosec] 2022/07/28 07:52:51 Excluding rules: default -[gosec] 2022/07/28 07:52:51 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/election-day -2022/07/28 07:52:52 internal error: package "fmt" without types was imported from "command-line-arguments" +benchstat benchstat-old.txt benchstat-new.txt -real 0m0.818s -user 0m1.030s -sys 0m0.601s +real 0m0.002s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output electionday-doc.md -real 0m0.101s -user 0m0.059s -sys 0m0.041s +real 0m0.010s +user 0m0.007s +sys 0m0.003s =============================================================================== @@ -240,9 +941,9 @@ func NewElectionResult(candidateName string, votes int) *ElectionResult NewElectionResult creates a new election result -real 0m0.440s -user 0m0.437s -sys 0m0.399s +real 0m0.036s +user 0m0.022s +sys 0m0.033s =============================================================================== diff --git a/go/elons-toys/benchstat-new.txt b/go/elons-toys/benchstat-new.txt index 830088ca..fd52ee0e 100644 --- a/go/elons-toys/benchstat-new.txt +++ b/go/elons-toys/benchstat-new.txt @@ -1,2 +1,2 @@ PASS -ok elon 0.002s +ok elon 0.003s diff --git a/go/elons-toys/benchstat-old.txt b/go/elons-toys/benchstat-old.txt index fd52ee0e..830088ca 100644 --- a/go/elons-toys/benchstat-old.txt +++ b/go/elons-toys/benchstat-old.txt @@ -1,2 +1,2 @@ PASS -ok elon 0.003s +ok elon 0.002s diff --git a/go/elons-toys/run-tests-go.txt b/go/elons-toys/run-tests-go.txt index ee73d4f0..bff11a53 100644 --- a/go/elons-toys/run-tests-go.txt +++ b/go/elons-toys/run-tests-go.txt @@ -5,7 +5,63 @@ Go packages: elon =============================================================================== -golangci-lint run ./... +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.012s +sys 0m0.029s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +elons_toys.go:10:14: var-declaration: should omit type bool from declaration of var success; it will be inferred from the right-hand side (revive) + var success bool = false + ^ +elons_toys_test.go:47:11: Using the variable on range scope `tt` in function literal (scopelint) + car := tt.car + ^ +elons_toys_test.go:50:14: Using the variable on range scope `tt` in function literal (scopelint) + if car != tt.expected { + ^ +elons_toys_test.go:51:55: Using the variable on range scope `tt` in function literal (scopelint) + t.Errorf("method Drive() = %v; expected %v", car, tt.expected) + ^ +car.go:14:10: distance is missing in Car (exhaustivestruct) + return &Car{ + ^ +elons_toys_test.go:124:9: distance is missing in Car (exhaustivestruct) + car: Car{ + ^ +elons_toys_test.go:134:9: distance is missing in Car (exhaustivestruct) + car: Car{ + ^ +car.go:17:17: mnd: Magic number: 100, in detected (gomnd) + battery: 100, + ^ elons_toys_examples_test.go:7:1: tests: ExampleDrive refers to unknown identifier: Drive (govet) func ExampleDrive() { ^ @@ -18,22 +74,79 @@ func ExampleDisplayBattery() { elons_toys_examples_test.go:45:1: tests: ExampleCanFinish refers to unknown identifier: CanFinish (govet) func ExampleCanFinish() { ^ +elons_toys_test.go:7:1: Function TestDrive missing the call to method parallel (paralleltest) +func TestDrive(t *testing.T) { +^ +elons_toys_test.go:45:2: Range statement for test TestDrive missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +elons_toys_test.go:57:1: Function TestDisplayDistance missing the call to method parallel (paralleltest) +func TestDisplayDistance(t *testing.T) { +^ +elons_toys_test.go:75:2: Range statement for test TestDisplayDistance missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +elons_toys_test.go:86:1: Function TestDisplayBattery missing the call to method parallel (paralleltest) +func TestDisplayBattery(t *testing.T) { +^ +elons_toys_test.go:104:2: Range statement for test TestDisplayBattery missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +elons_toys_test.go:115:1: Function TestCanFinish missing the call to method parallel (paralleltest) +func TestCanFinish(t *testing.T) { +^ +elons_toys_test.go:164:2: Range statement for test TestCanFinish missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +elons_toys_examples_test.go:1:9: package should be `elon_test` instead of `elon` (testpackage) +package elon + ^ +elons_toys_test.go:1:9: package should be `elon_test` instead of `elon` (testpackage) +package elon + ^ -real 0m0.222s -user 0m0.358s -sys 0m0.197s +real 0m0.450s +user 0m0.716s +sys 0m0.429s -=============================================================================== -golint ./... + ============================================================================== + +Exit code: -1 -real 0m0.009s -user 0m0.007s -sys 0m0.008s +real 0m0.485s +user 0m0.735s +sys 0m0.470s + +real 0m0.487s +user 0m0.736s +sys 0m0.471s =============================================================================== -revive -formatter=stylish ./... +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.014s +sys 0m0.021s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + car.go (1, 1) https://revive.run/r#package-comments should have a package comment @@ -43,68 +156,325 @@ elons_toys.go ✖ 2 problems (0 errors) (2 warnings) -real 0m0.007s -user 0m0.005s -sys 0m0.003s +real 0m0.027s +user 0m0.014s +sys 0m0.019s + + + ============================================================================== + +Exit code: 0 + +real 0m0.061s +user 0m0.036s +sys 0m0.045s + +real 0m0.062s +user 0m0.037s +sys 0m0.046s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.079s -user 0m0.140s -sys 0m0.097s +real 0m0.001s +user 0m0.001s +sys 0m0.000s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.016s +sys 0m0.024s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." internal error: package "fmt" without types was imported from "elon" -real 0m0.101s -user 0m0.137s -sys 0m0.152s +real 0m0.083s +user 0m0.115s +sys 0m0.108s + + + ============================================================================== + +Exit code: -1 + +real 0m0.120s +user 0m0.136s +sys 0m0.143s + +real 0m0.122s +user 0m0.136s +sys 0m0.145s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... -real 0m0.145s -user 0m0.200s -sys 0m0.150s + +real 0m0.025s +user 0m0.019s +sys 0m0.027s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +car.go:1:1: at least one file in a package should have a package comment (ST1000) +elons_toys.go:1:1: at least one file in a package should have a package comment (ST1000) +elons_toys.go:10:14: should omit type bool from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.153s +user 0m0.195s +sys 0m0.125s + + + ============================================================================== + +Exit code: -1 + +real 0m0.190s +user 0m0.221s +sys 0m0.161s + +real 0m0.192s +user 0m0.222s +sys 0m0.162s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.017s +sys 0m0.025s + -real 0m0.788s -user 0m2.890s -sys 0m0.408s + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.818s +user 0m1.967s +sys 0m0.275s + + + ============================================================================== + +Exit code: 0 + +real 0m0.854s +user 0m1.992s +sys 0m0.308s + +real 0m0.855s +user 0m1.993s +sys 0m0.308s =============================================================================== -go vet ./... +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.020s +sys 0m0.026s + + + ============================================================================== + +Running: go vet ./... + # elon ./elons_toys_examples_test.go:7:1: ExampleDrive refers to unknown identifier: Drive ./elons_toys_examples_test.go:25:1: ExampleDisplayDistance refers to unknown identifier: DisplayDistance ./elons_toys_examples_test.go:35:1: ExampleDisplayBattery refers to unknown identifier: DisplayBattery ./elons_toys_examples_test.go:45:1: ExampleCanFinish refers to unknown identifier: CanFinish -real 0m0.091s -user 0m0.167s -sys 0m0.122s +real 0m0.082s +user 0m0.106s +sys 0m0.093s + + + ============================================================================== + +Exit code: -1 + +real 0m0.116s +user 0m0.133s +sys 0m0.124s + +real 0m0.118s +user 0m0.134s +sys 0m0.125s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-fixer-go_fix -real 0m0.026s -user 0m0.014s -sys 0m0.032s +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.015s +sys 0m0.023s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.024s +user 0m0.020s +sys 0m0.023s + + + ============================================================================== + +Exit code: 0 + +real 0m0.055s +user 0m0.043s +sys 0m0.052s + +real 0m0.057s +user 0m0.043s +sys 0m0.055s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.038s +user 0m0.028s +sys 0m0.037s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.434s +user 0m1.245s +sys 0m0.288s + + + ============================================================================== + +Exit code: 0 + +real 0m0.490s +user 0m1.285s +sys 0m0.337s + +real 0m0.493s +user 0m1.286s +sys 0m0.339s =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.016s +sys 0m0.025s + + + ============================================================================== + +Running: gocyclo . + 3 elon TestCanFinish elons_toys_test.go:115:1 3 elon TestDisplayBattery elons_toys_test.go:86:1 3 elon TestDisplayDistance elons_toys_test.go:57:1 @@ -123,29 +493,136 @@ real 0m0.003s user 0m0.000s sys 0m0.003s + + ============================================================================== + +Exit code: 0 + +real 0m0.038s +user 0m0.020s +sys 0m0.041s + +real 0m0.040s +user 0m0.021s +sys 0m0.041s + =============================================================================== -misspell . +Running: ../../.github/citools/go/go-lint-misspell -real 0m0.023s -user 0m0.028s -sys 0m0.013s +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.033s +user 0m0.040s +sys 0m0.018s + + + ============================================================================== + +Exit code: 0 + +real 0m0.050s +user 0m0.045s +sys 0m0.036s + +real 0m0.052s +user 0m0.045s +sys 0m0.038s =============================================================================== -gosec ./... -[gosec] 2023/03/04 21:37:44 Including rules: default -[gosec] 2023/03/04 21:37:44 Excluding rules: default -[gosec] 2023/03/04 21:37:44 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/elons-toys -2023/03/04 21:37:44 internal error: package "fmt" without types was imported from "command-line-arguments" +Running: ../../.github/citools/go/go-lint-gosec -real 0m0.116s -user 0m0.161s -sys 0m0.098s +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.018s +sys 0m0.030s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:23:00 Including rules: default +[gosec] 2023/09/07 00:23:00 Excluding rules: default +[gosec] 2023/09/07 00:23:00 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/elons-toys +[gosec] 2023/09/07 00:23:00 Checking package: elon +[gosec] 2023/09/07 00:23:00 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/elons-toys/car.go +[gosec] 2023/09/07 00:23:00 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/elons-toys/elons_toys.go +Results: + + +Summary: + Gosec : dev + Files : 2 + Lines : 56 + Nosec : 0 + Issues : 0 + + +real 0m0.120s +user 0m0.130s +sys 0m0.103s + + + ============================================================================== + +Exit code: 0 + +real 0m0.153s +user 0m0.152s +sys 0m0.143s + +real 0m0.155s +user 0m0.153s +sys 0m0.144s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.015s +sys 0m0.018s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestDrive === RUN TestDrive/Drive_the_car_once. === RUN TestDrive/Drive_when_battery_percentage_is_below_battery_drain @@ -179,16 +656,18 @@ gotest -v -covermode=count -coverprofile coverage.out ./... === RUN ExampleCanFinish --- PASS: ExampleCanFinish (0.00s) PASS - elon coverage: 100.0% of statements +coverage: 100.0% of statements ok elon 0.003s coverage: 100.0% of statements -real 0m0.202s -user 0m0.283s -sys 0m0.224s +real 0m0.180s +user 0m0.210s +sys 0m0.148s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + elon/car.go:13: NewCar 100.0% elon/elons_toys.go:9: Drive 100.0% elon/elons_toys.go:23: DisplayDistance 100.0% @@ -196,29 +675,40 @@ elon/elons_toys.go:28: DisplayBattery 100.0% elon/elons_toys.go:33: CanFinish 100.0% total: (statements) 100.0% -real 0m0.053s -user 0m0.085s -sys 0m0.117s +real 0m0.050s +user 0m0.075s +sys 0m0.067s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.061s -user 0m0.093s -sys 0m0.094s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +real 0m0.050s +user 0m0.069s +sys 0m0.060s -real 0m0.019s -user 0m0.016s -sys 0m0.020s -=============================================================================== + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.018s +user 0m0.017s +sys 0m0.019s + +real 0m0.018s +user 0m0.017s +sys 0m0.019s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestDrive === RUN TestDrive/Drive_the_car_once. === RUN TestDrive/Drive_when_battery_percentage_is_below_battery_drain @@ -252,12 +742,25 @@ gotest -v -race -covermode=atomic ./... === RUN ExampleCanFinish --- PASS: ExampleCanFinish (0.00s) PASS - elon coverage: 100.0% of statements -ok elon 0.022s coverage: 100.0% of statements +coverage: 100.0% of statements +ok elon 1.015s coverage: 100.0% of statements + +real 0m1.257s +user 0m0.293s +sys 0m0.172s + + + ============================================================================== + +Exit code: 0 -real 0m0.280s -user 0m0.382s -sys 0m0.219s +real 0m1.585s +user 0m0.683s +sys 0m0.493s + +real 0m1.587s +user 0m0.684s +sys 0m0.494s =============================================================================== @@ -266,11 +769,11 @@ renamed 'benchstat-new.txt' -> 'benchstat-old.txt' gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt PASS -ok elon 0.002s +ok elon 0.003s -real 0m0.160s -user 0m0.300s -sys 0m0.273s +real 0m0.168s +user 0m0.220s +sys 0m0.158s =============================================================================== @@ -310,25 +813,25 @@ gotest -v -tags bonus PASS ok elon 0.002s -real 0m0.153s -user 0m0.300s -sys 0m0.228s +real 0m0.135s +user 0m0.198s +sys 0m0.124s =============================================================================== benchstat benchstat-old.txt benchstat-new.txt -real 0m0.004s -user 0m0.003s -sys 0m0.004s +real 0m0.001s +user 0m0.001s +sys 0m0.001s =============================================================================== gomarkdoc --output elon-doc.md -real 0m0.011s -user 0m0.007s -sys 0m0.005s +real 0m0.010s +user 0m0.005s +sys 0m0.004s =============================================================================== @@ -363,9 +866,9 @@ func (car *Car) Drive() bool and reduces the battery (`int`) according to the battery drainage. -real 0m0.039s -user 0m0.034s -sys 0m0.038s +real 0m0.035s +user 0m0.020s +sys 0m0.030s =============================================================================== diff --git a/go/etl/benchstat-new.txt b/go/etl/benchstat-new.txt index 45b7de10..a723a3dd 100644 --- a/go/etl/benchstat-new.txt +++ b/go/etl/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: etl -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkTransform-4 147228 9242 ns/op 2577 B/op 46 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkTransform +BenchmarkTransform-8 301872 3753 ns/op 4300 B/op 47 allocs/op PASS -ok etl 1.532s +ok etl 1.178s diff --git a/go/etl/benchstat-old.txt b/go/etl/benchstat-old.txt new file mode 100644 index 00000000..45b7de10 --- /dev/null +++ b/go/etl/benchstat-old.txt @@ -0,0 +1,7 @@ +goos: linux +goarch: amd64 +pkg: etl +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkTransform-4 147228 9242 ns/op 2577 B/op 46 allocs/op +PASS +ok etl 1.532s diff --git a/go/etl/coverage-annotations.txt b/go/etl/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/etl/coverage.out b/go/etl/coverage.out index 7067854d..95bd3c8c 100644 --- a/go/etl/coverage.out +++ b/go/etl/coverage.out @@ -1,5 +1,5 @@ mode: count etl/etl.go:13.48,16.49 2 5 -etl/etl.go:24.2,24.15 1 5 etl/etl.go:16.49,17.35 1 13 etl/etl.go:17.35,21.4 2 40 +etl/etl.go:24.2,24.15 1 5 diff --git a/go/etl/etl-doc.md b/go/etl/etl-doc.md index afcc099e..602c0bb4 100755 --- a/go/etl/etl-doc.md +++ b/go/etl/etl-doc.md @@ -6,7 +6,7 @@ import "etl" ``` -Package etl is used to convert scrablle scores from a legacy system to a new one\. +Package etl is used to convert scrablle scores from a legacy system to a new one. ## Index @@ -17,7 +17,7 @@ Package etl is used to convert scrablle scores from a legacy system to a new one ## type [LegacyScore]() -LegacyScore is the old data type\. +LegacyScore is the old data type. ```go type LegacyScore map[int][]string @@ -25,7 +25,7 @@ type LegacyScore map[int][]string ## type [ModernScore]() -ModernScore is the new data type\. +ModernScore is the new data type. ```go type ModernScore map[string]int @@ -37,7 +37,7 @@ type ModernScore map[string]int func Transform(legacy LegacyScore) ModernScore ``` -Transform returns transformed data\. +Transform returns transformed data.

Example

diff --git a/go/etl/run-tests-go.txt b/go/etl/run-tests-go.txt index 43d79383..46b0a10e 100644 --- a/go/etl/run-tests-go.txt +++ b/go/etl/run-tests-go.txt @@ -5,124 +5,734 @@ Go packages: etl =============================================================================== -golint etl +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.162s -user 0m0.151s -sys 0m0.135s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.013s +sys 0m0.022s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +etl.go:18:4: commentFormatting: put a space between `//` and comment text (gocritic) + //s := strings.ToLower(string(r)) + ^ +etl_test.go:5: File is not `gofumpt`-ed (gofumpt) +type given map[int][]string +type expectation map[string]int +etl_test.go:84: File is not `gofumpt`-ed (gofumpt) + +etl_test.go:88: File is not `gofumpt`-ed (gofumpt) + +etl.go:14:13: var-declaration: should omit type ModernScore from declaration of var modern; it will be inferred from the right-hand side (revive) + var modern ModernScore = ModernScore{} + ^ +etl_test.go:83: unnecessary leading newline (whitespace) + for i := 0; i < b.N; i++ { + +etl_test.go:89:2: block should not end with a whitespace (or comment) (wsl) + } + ^ +etl_test.go:8:5: transformTests is a global variable (gochecknoglobals) +var transformTests = []struct { + ^ +etl_test.go:70:1: Function TestTransform missing the call to method parallel (paralleltest) +func TestTransform(t *testing.T) { +^ +etl_examples_test.go:1:9: package should be `etl_test` instead of `etl` (testpackage) +package etl + ^ +etl_test.go:1:9: package should be `etl_test` instead of `etl` (testpackage) +package etl + ^ + +real 0m0.469s +user 0m0.755s +sys 0m0.468s + + + ============================================================================== + +Exit code: -1 + +real 0m0.505s +user 0m0.774s +sys 0m0.499s + +real 0m0.507s +user 0m0.776s +sys 0m0.500s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.020s +sys 0m0.028s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +etl.go + (14, 13) https://revive.run/r#var-declaration should omit type ModernScore from declaration of var modern; it will be inferred from the right-hand side + + + ✖ 1 problem (0 errors) (1 warnings) + +real 0m0.055s +user 0m0.034s +sys 0m0.036s + + + ============================================================================== + +Exit code: 0 + +real 0m0.107s +user 0m0.071s +sys 0m0.078s + +real 0m0.117s +user 0m0.076s +sys 0m0.084s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.016s +sys 0m0.014s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "strings" without types was imported from "etl" + +real 0m0.090s +user 0m0.137s +sys 0m0.116s + + + ============================================================================== + +Exit code: -1 + +real 0m0.124s +user 0m0.159s +sys 0m0.139s + +real 0m0.126s +user 0m0.161s +sys 0m0.139s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.012s +sys 0m0.014s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +etl.go:14:13: should omit type ModernScore from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.183s +user 0m0.198s +sys 0m0.141s + + + ============================================================================== + +Exit code: -1 + +real 0m0.212s +user 0m0.213s +sys 0m0.165s + +real 0m0.214s +user 0m0.214s +sys 0m0.167s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.017s +sys 0m0.024s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./etl.go:18:4: commentFormatting: put a space between `//` and comment text +./etl.go:18:4: commentedOutCode: may want to remove commented-out code + +real 0m0.776s +user 0m1.815s +sys 0m0.250s + + + ============================================================================== + +Exit code: -1 + +real 0m0.822s +user 0m1.845s +sys 0m0.287s + +real 0m0.826s +user 0m1.847s +sys 0m0.288s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.008s +sys 0m0.019s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.077s +user 0m0.109s +sys 0m0.121s + + + ============================================================================== + +Exit code: 0 + +real 0m0.107s +user 0m0.124s +sys 0m0.148s + +real 0m0.109s +user 0m0.125s +sys 0m0.149s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.012s +sys 0m0.018s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.021s +user 0m0.010s +sys 0m0.019s + + + ============================================================================== + +Exit code: 0 + +real 0m0.056s +user 0m0.029s +sys 0m0.046s + +real 0m0.058s +user 0m0.029s +sys 0m0.048s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.012s +sys 0m0.015s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.420s +user 0m1.257s +sys 0m0.269s + + + ============================================================================== + +Exit code: 0 + +real 0m0.449s +user 0m1.274s +sys 0m0.293s + +real 0m0.451s +user 0m1.275s +sys 0m0.294s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.012s +sys 0m0.016s + + + ============================================================================== + +Running: gocyclo . + +5 etl equal etl_test.go:54:1 +4 etl BenchmarkTransform etl_test.go:79:1 +3 etl TestTransform etl_test.go:70:1 +3 etl Transform etl.go:13:1 +1 etl ExampleTransform etl_examples_test.go:7:1 + +real 0m0.002s +user 0m0.001s +sys 0m0.001s + + + ============================================================================== + +Exit code: 0 + +real 0m0.032s +user 0m0.019s +sys 0m0.025s + +real 0m0.034s +user 0m0.021s +sys 0m0.025s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.028s +user 0m0.030s +sys 0m0.015s + + + ============================================================================== + +Exit code: 0 + +real 0m0.040s +user 0m0.035s +sys 0m0.025s + +real 0m0.042s +user 0m0.037s +sys 0m0.025s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out etl +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.018s +sys 0m0.026s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:23:05 Including rules: default +[gosec] 2023/09/07 00:23:05 Excluding rules: default +[gosec] 2023/09/07 00:23:05 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/etl +[gosec] 2023/09/07 00:23:05 Checking package: etl +[gosec] 2023/09/07 00:23:05 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/etl/etl.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 25 + Nosec : 0 + Issues : 0 + + +real 0m0.106s +user 0m0.111s +sys 0m0.080s + + + ============================================================================== + +Exit code: 0 + +real 0m0.155s +user 0m0.142s +sys 0m0.114s + +real 0m0.158s +user 0m0.143s +sys 0m0.116s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.012s +sys 0m0.020s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestTransform --- PASS: TestTransform (0.00s) === RUN ExampleTransform --- PASS: ExampleTransform (0.00s) PASS coverage: 100.0% of statements -ok etl 0.010s coverage: 100.0% of statements +ok etl 0.002s coverage: 100.0% of statements -real 0m0.519s -user 0m0.630s -sys 0m0.464s +real 0m0.164s +user 0m0.199s +sys 0m0.142s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + etl/etl.go:13: Transform 100.0% total: (statements) 100.0% -real 0m0.221s -user 0m0.118s -sys 0m0.198s +real 0m0.046s +user 0m0.053s +sys 0m0.060s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.207s -user 0m0.170s -sys 0m0.186s +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.058s +user 0m0.066s +sys 0m0.090s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.015s +user 0m0.008s +sys 0m0.015s + +real 0m0.016s +user 0m0.008s +sys 0m0.015s -=============================================================================== -go test -v -race -covermode=atomic etl + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestTransform --- PASS: TestTransform (0.00s) === RUN ExampleTransform --- PASS: ExampleTransform (0.00s) PASS coverage: 100.0% of statements -ok etl 0.048s coverage: 100.0% of statements +ok etl 1.017s coverage: 100.0% of statements + +real 0m1.236s +user 0m0.293s +sys 0m0.150s + + + ============================================================================== -real 0m0.795s -user 0m0.800s -sys 0m0.567s +Exit code: 0 + +real 0m1.554s +user 0m0.641s +sys 0m0.483s + +real 0m1.556s +user 0m0.641s +sys 0m0.485s =============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: etl -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkTransform-4 147228 9242 ns/op 2577 B/op 46 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkTransform +BenchmarkTransform-8 301872 3753 ns/op 4300 B/op 47 allocs/op PASS -ok etl 1.532s +ok etl 1.178s -real 0m2.105s -user 0m3.014s -sys 0m0.619s +real 0m1.332s +user 0m1.427s +sys 0m0.196s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestTransform +--- PASS: TestTransform (0.00s) +=== RUN ExampleTransform +--- PASS: ExampleTransform (0.00s) PASS -ok etl 0.007s +ok etl 0.001s -real 0m0.514s -user 0m0.582s -sys 0m0.457s +real 0m0.135s +user 0m0.185s +sys 0m0.119s =============================================================================== -No old benchmarks to run benchstat against. - -=============================================================================== - -go vet etl - -real 0m0.371s -user 0m0.432s -sys 0m0.341s - -=============================================================================== - -go fix etl +benchstat benchstat-old.txt benchstat-new.txt +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: etl +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Transform-8 3.753µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Transform-8 4.199Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Transform-8 47.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.115s -user 0m0.073s -sys 0m0.117s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Transform-4 9.242µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +Transform-4 2.517Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./etl -[gosec] 2022/07/02 21:27:12 Including rules: default -[gosec] 2022/07/02 21:27:12 Excluding rules: default -[gosec] 2022/07/02 21:27:12 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/etl -2022/07/02 21:27:13 internal error: package "strings" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +Transform-4 46.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.421s -user 0m0.415s -sys 0m0.332s +real 0m0.004s +user 0m0.001s +sys 0m0.002s =============================================================================== gomarkdoc --output etl-doc.md -real 0m0.035s -user 0m0.024s -sys 0m0.026s +real 0m0.012s +user 0m0.006s +sys 0m0.006s =============================================================================== @@ -144,9 +754,9 @@ func Transform(legacy LegacyScore) ModernScore Transform returns transformed data. -real 0m0.268s -user 0m0.128s -sys 0m0.248s +real 0m0.056s +user 0m0.025s +sys 0m0.050s =============================================================================== diff --git a/go/expenses/benchstat-new.txt b/go/expenses/benchstat-new.txt new file mode 100644 index 00000000..78746a42 --- /dev/null +++ b/go/expenses/benchstat-new.txt @@ -0,0 +1,2 @@ +PASS +ok expenses 0.002s diff --git a/go/expenses/coverage-annotations.txt b/go/expenses/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/expenses/coverage.html b/go/expenses/coverage.html new file mode 100644 index 00000000..609a3c4f --- /dev/null +++ b/go/expenses/coverage.html @@ -0,0 +1,195 @@ + + + + + + expenses: Go Coverage Report + + + +

+ +
+ not tracked + + no coverage + low coverage + * + * + * + * + * + * + * + * + high coverage + +
+
+
+ + + +
+ + + diff --git a/go/expenses/coverage.out b/go/expenses/coverage.out index b1f3d040..56a6b42e 100644 --- a/go/expenses/coverage.out +++ b/go/expenses/coverage.out @@ -1,18 +1,18 @@ mode: count expenses/expenses.go:19.64,22.28 2 22 -expenses/expenses.go:28.2,28.12 1 22 expenses/expenses.go:22.28,23.24 1 138 expenses/expenses.go:23.24,25.4 1 44 +expenses/expenses.go:28.2,28.12 1 22 expenses/expenses.go:33.56,34.40 1 12 -expenses/expenses.go:38.2,38.18 1 12 expenses/expenses.go:34.40,36.3 1 68 +expenses/expenses.go:38.2,38.18 1 12 expenses/expenses.go:44.52,45.40 1 9 -expenses/expenses.go:49.2,49.18 1 9 expenses/expenses.go:45.40,47.3 1 65 +expenses/expenses.go:49.2,49.18 1 9 expenses/expenses.go:54.60,59.34 3 9 -expenses/expenses.go:63.2,63.14 1 9 expenses/expenses.go:59.34,61.3 1 17 +expenses/expenses.go:63.2,63.14 1 9 expenses/expenses.go:70.89,76.24 4 6 -expenses/expenses.go:82.2,82.19 1 6 expenses/expenses.go:76.24,78.3 1 2 expenses/expenses.go:78.8,80.3 1 4 +expenses/expenses.go:82.2,82.19 1 6 diff --git a/go/expenses/expenses-doc.md b/go/expenses/expenses-doc.md index f8787afe..798aa4f9 100755 --- a/go/expenses/expenses-doc.md +++ b/go/expenses/expenses-doc.md @@ -114,7 +114,7 @@ ByDaysPeriod returns predicate function that returns true when the day of the re func CategoryExpenses(in []Record, period DaysPeriod, category string) (float64, error) ``` -CategoryExpenses returns total amount of expenses for records in category c that are also inside the period p\. An error must be returned only if there are no records in the list that belong to the given category\, regardless of period of time\. +CategoryExpenses returns total amount of expenses for records in category c that are also inside the period p. An error must be returned only if there are no records in the list that belong to the given category, regardless of period of time.
Example

@@ -193,7 +193,7 @@ TotalByPeriod returns total amount of expenses for records inside the period p ## type [DaysPeriod]() -DaysPeriod represents a period of days for expenses\. +DaysPeriod represents a period of days for expenses. ```go type DaysPeriod struct { @@ -204,7 +204,7 @@ type DaysPeriod struct { ## type [Record]() -Record represents an expense record\. +Record represents an expense record. ```go type Record struct { @@ -220,7 +220,7 @@ type Record struct { func Filter(in []Record, predicate func(Record) bool) []Record ``` -Filter returns the records for which the predicate function returns true\. +Filter returns the records for which the predicate function returns true.

Example

diff --git a/go/expenses/run-tests-go.txt b/go/expenses/run-tests-go.txt index ce2ae5c4..a5320f4c 100644 --- a/go/expenses/run-tests-go.txt +++ b/go/expenses/run-tests-go.txt @@ -5,15 +5,629 @@ Go packages: expenses =============================================================================== -golint expenses +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.014s +sys 0m0.023s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +expenses_test.go:211: Function 'TestCategoryExpenses' is too long (64 > 60) (funlen) +func TestCategoryExpenses(t *testing.T) { +expenses.go:32:73: Comment should end in a period (godot) +// the day of the record is inside the period of day and false otherwise + ^ +expenses.go:43:23: Comment should end in a period (godot) +// and false otherwise + ^ +expenses.go:53:23: Comment should end in a period (godot) +// inside the period p + ^ +expenses.go:20:10: var-declaration: should omit type []Record from declaration of var out; it will be inferred from the right-hand side (revive) + var out []Record = []Record{} + ^ +expenses.go:73:22: var-declaration: should drop = 0 from declaration of var total; it is the zero value (revive) + var total float64 = 0 + ^ +expenses.go:74:18: var-declaration: should drop = nil from declaration of var err; it is the zero value (revive) + var err error = nil + ^ +expenses_test.go:98:52: Using the variable on range scope `tC` in function literal (scopelint) + got := Filter(testExpensesRecords, ByDaysPeriod(tC.p)) + ^ +expenses_test.go:99:23: Using the variable on range scope `tC` in function literal (scopelint) + if len(got) != len(tC.expected) { + ^ +expenses_test.go:100:72: Using the variable on range scope `tC` in function literal (scopelint) + t.Fatalf("Filter by period got %d records, want %d", len(got), len(tC.expected)) + ^ +expenses_examples_test.go:37:2: ranges should only be cuddled with assignments used in the iteration (wsl) + for _, result := range results { + ^ +expenses_examples_test.go:40:2: expressions should not be cuddled with blocks (wsl) + fmt.Println("]") + ^ +expenses_examples_test.go:61:2: ranges should only be cuddled with assignments used in the iteration (wsl) + for _, result := range results { + ^ +expenses_examples_test.go:64:2: expressions should not be cuddled with blocks (wsl) + fmt.Println("]") + ^ +expenses_test.go:5:5: testExpensesRecords is a global variable (gochecknoglobals) +var testExpensesRecords = []Record{ + ^ +expenses.go:77:19: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"unknown category\")" (goerr113) + total, err = 0, errors.New("unknown category") + ^ +expenses_test.go:53:1: Function TestFilterByDaysPeriod missing the call to method parallel (paralleltest) +func TestFilterByDaysPeriod(t *testing.T) { +^ +expenses_test.go:96:2: Range statement for test TestFilterByDaysPeriod missing the call to method parallel in test Run (paralleltest) + for _, tC := range testCases { + ^ +expenses_test.go:112:1: Function TestFilterByCategory missing the call to method parallel (paralleltest) +func TestFilterByCategory(t *testing.T) { +^ +expenses_test.go:154:2: Range statement for test TestFilterByCategory missing the call to method parallel in test Run (paralleltest) + for _, tC := range testCases { + ^ +expenses_test.go:170:1: Function TestTotalByPeriod missing the call to method parallel (paralleltest) +func TestTotalByPeriod(t *testing.T) { +^ +expenses_test.go:201:2: Range statement for test TestTotalByPeriod missing the call to method parallel in test Run (paralleltest) + for _, tC := range testCases { + ^ +expenses_test.go:250:2: Range statement for test TestCategoryExpenses missing the call to method parallel in test Run (paralleltest) + for _, tC := range testCases { + ^ +expenses_examples_test.go:1:9: package should be `expenses_test` instead of `expenses` (testpackage) +package expenses + ^ +expenses_test.go:1:9: package should be `expenses_test` instead of `expenses` (testpackage) +package expenses + ^ +expenses_examples_test.go:99:2: variable name 'p2' is too short for the scope of its usage (varnamelen) + p2 := DaysPeriod{From: 31, To: 60} + ^ + +real 0m0.481s +user 0m0.749s +sys 0m0.425s + + + ============================================================================== + +Exit code: -1 + +real 0m0.530s +user 0m0.772s +sys 0m0.468s + +real 0m0.532s +user 0m0.774s +sys 0m0.470s -real 0m0.185s -user 0m0.117s -sys 0m0.133s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.011s +sys 0m0.017s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +expenses.go + (20, 10) https://revive.run/r#var-declaration should omit type []Record from declaration of var out; it will be inferred from the right-hand side + (73, 22) https://revive.run/r#var-declaration should drop = 0 from declaration of var total; it is the zero value + (74, 18) https://revive.run/r#var-declaration should drop = nil from declaration of var err; it is the zero value + (1, 1) https://revive.run/r#package-comments should have a package comment + + + ✖ 4 problems (0 errors) (4 warnings) + +real 0m0.054s +user 0m0.033s +sys 0m0.037s + + + ============================================================================== + +Exit code: 0 + +real 0m0.087s +user 0m0.050s +sys 0m0.065s + +real 0m0.089s +user 0m0.052s +sys 0m0.065s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.015s +sys 0m0.015s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "errors" without types was imported from "expenses" + +real 0m0.088s +user 0m0.087s +sys 0m0.099s + + + ============================================================================== + +Exit code: -1 + +real 0m0.121s +user 0m0.106s +sys 0m0.124s + +real 0m0.123s +user 0m0.106s +sys 0m0.126s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.016s +user 0m0.009s +sys 0m0.012s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +expenses.go:1:1: at least one file in a package should have a package comment (ST1000) +expenses.go:20:10: should omit type []Record from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.209s +user 0m0.264s +sys 0m0.138s + + + ============================================================================== + +Exit code: -1 + +real 0m0.236s +user 0m0.276s +sys 0m0.163s + +real 0m0.238s +user 0m0.278s +sys 0m0.163s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.007s +sys 0m0.016s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.853s +user 0m2.083s +sys 0m0.306s + + + ============================================================================== + +Exit code: 0 + +real 0m0.883s +user 0m2.096s +sys 0m0.333s + +real 0m0.885s +user 0m2.097s +sys 0m0.333s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out expenses +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.014s +sys 0m0.012s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.080s +user 0m0.160s +sys 0m0.108s + + + ============================================================================== + +Exit code: 0 + +real 0m0.110s +user 0m0.179s +sys 0m0.130s + +real 0m0.113s +user 0m0.180s +sys 0m0.131s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.016s +user 0m0.014s +sys 0m0.009s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.019s +user 0m0.004s +sys 0m0.022s + + + ============================================================================== + +Exit code: 0 + +real 0m0.047s +user 0m0.021s +sys 0m0.044s + +real 0m0.049s +user 0m0.022s +sys 0m0.044s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.015s +sys 0m0.017s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.422s +user 0m1.210s +sys 0m0.249s + + + ============================================================================== + +Exit code: 0 + +real 0m0.457s +user 0m1.231s +sys 0m0.275s + +real 0m0.458s +user 0m1.233s +sys 0m0.275s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.010s +sys 0m0.013s + + + ============================================================================== + +Running: gocyclo . + +8 expenses TestCategoryExpenses expenses_test.go:211:1 +5 expenses TestFilterByCategory expenses_test.go:112:1 +5 expenses TestFilterByDaysPeriod expenses_test.go:53:1 +3 expenses TestTotalByPeriod expenses_test.go:170:1 +3 expenses Filter expenses.go:19:1 +2 expenses ExampleByCategory expenses_examples_test.go:49:1 +2 expenses ExampleByDaysPeriod expenses_examples_test.go:23:1 +2 expenses CategoryExpenses expenses.go:70:1 +2 expenses TotalByPeriod expenses.go:54:1 +2 expenses ByDaysPeriod expenses.go:33:1 +1 expenses ExampleCategoryExpenses expenses_examples_test.go:89:1 +1 expenses ExampleTotalByPeriod expenses_examples_test.go:72:1 +1 expenses ExampleFilter expenses_examples_test.go:5:1 +1 expenses ByCategory expenses.go:44:1 + +real 0m0.003s +user 0m0.000s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.033s +user 0m0.016s +sys 0m0.025s + +real 0m0.035s +user 0m0.018s +sys 0m0.025s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.040s +user 0m0.043s +sys 0m0.019s + + + ============================================================================== + +Exit code: 0 + +real 0m0.057s +user 0m0.053s +sys 0m0.030s + +real 0m0.059s +user 0m0.054s +sys 0m0.031s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.036s +user 0m0.014s +sys 0m0.033s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:23:11 Including rules: default +[gosec] 2023/09/07 00:23:11 Excluding rules: default +[gosec] 2023/09/07 00:23:11 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/expenses +[gosec] 2023/09/07 00:23:11 Checking package: expenses +[gosec] 2023/09/07 00:23:11 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/expenses/expenses.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 83 + Nosec : 0 + Issues : 0 + + +real 0m0.118s +user 0m0.132s +sys 0m0.100s + + + ============================================================================== + +Exit code: 0 + +real 0m0.175s +user 0m0.154s +sys 0m0.153s + +real 0m0.178s +user 0m0.157s +sys 0m0.154s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.013s +sys 0m0.018s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestFilterByDaysPeriod === RUN TestFilterByDaysPeriod/returns_expenses_records_from_1st_to_15th_day === RUN TestFilterByDaysPeriod/returns_empty_list_when_no_expenses_found_in_the_days_period @@ -54,15 +668,17 @@ go test -v -covermode=count -coverprofile coverage.out expenses --- PASS: ExampleCategoryExpenses (0.00s) PASS coverage: 100.0% of statements -ok expenses 0.018s coverage: 100.0% of statements +ok expenses 0.002s coverage: 100.0% of statements -real 0m0.618s -user 0m0.687s -sys 0m0.565s +real 0m0.177s +user 0m0.229s +sys 0m0.149s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + expenses/expenses.go:19: Filter 100.0% expenses/expenses.go:33: ByDaysPeriod 100.0% expenses/expenses.go:44: ByCategory 100.0% @@ -70,13 +686,40 @@ expenses/expenses.go:54: TotalByPeriod 100.0% expenses/expenses.go:70: CategoryExpenses 100.0% total: (statements) 100.0% -real 0m0.205s -user 0m0.171s -sys 0m0.164s +real 0m0.045s +user 0m0.059s +sys 0m0.085s -=============================================================================== -go test -v -race -covermode=atomic expenses + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.048s +user 0m0.036s +sys 0m0.036s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.016s +user 0m0.006s +sys 0m0.015s + +real 0m0.016s +user 0m0.006s +sys 0m0.015s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestFilterByDaysPeriod === RUN TestFilterByDaysPeriod/returns_expenses_records_from_1st_to_15th_day === RUN TestFilterByDaysPeriod/returns_empty_list_when_no_expenses_found_in_the_days_period @@ -117,67 +760,94 @@ go test -v -race -covermode=atomic expenses --- PASS: ExampleCategoryExpenses (0.00s) PASS coverage: 100.0% of statements -ok expenses 0.030s coverage: 100.0% of statements +ok expenses 1.015s coverage: 100.0% of statements -real 0m0.736s -user 0m0.813s -sys 0m0.491s - -=============================================================================== +real 0m1.259s +user 0m0.271s +sys 0m0.176s -go test --bench . --benchmem -PASS -ok expenses 0.025s -real 0m0.502s -user 0m0.615s -sys 0m0.384s + ============================================================================== -=============================================================================== +Exit code: 0 -go test -tags bonus -PASS -ok expenses 0.028s +real 0m1.588s +user 0m0.626s +sys 0m0.494s -real 0m0.609s -user 0m0.687s -sys 0m0.552s +real 0m1.592s +user 0m0.627s +sys 0m0.498s =============================================================================== -go vet expenses +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok expenses 0.002s -real 0m0.413s -user 0m0.446s -sys 0m0.331s +real 0m0.143s +user 0m0.207s +sys 0m0.125s =============================================================================== -go fix expenses +gotest -v -tags bonus +=== RUN TestFilterByDaysPeriod +=== RUN TestFilterByDaysPeriod/returns_expenses_records_from_1st_to_15th_day +=== RUN TestFilterByDaysPeriod/returns_empty_list_when_no_expenses_found_in_the_days_period +--- PASS: TestFilterByDaysPeriod (0.00s) + --- PASS: TestFilterByDaysPeriod/returns_expenses_records_from_1st_to_15th_day (0.00s) + --- PASS: TestFilterByDaysPeriod/returns_empty_list_when_no_expenses_found_in_the_days_period (0.00s) +=== RUN TestFilterByCategory +=== RUN TestFilterByCategory/returns_expenses_in_groceries_category +=== RUN TestFilterByCategory/returns_empty_list_for_unknown_category +--- PASS: TestFilterByCategory (0.00s) + --- PASS: TestFilterByCategory/returns_expenses_in_groceries_category (0.00s) + --- PASS: TestFilterByCategory/returns_empty_list_for_unknown_category (0.00s) +=== RUN TestTotalByPeriod +=== RUN TestTotalByPeriod/total_expenses_is_0_when_no_records_found_in_the_provided_days_period +=== RUN TestTotalByPeriod/total_expenses_for_days_period_from_25th_to_26th_day +=== RUN TestTotalByPeriod/total_expenses_for_the_full_days_period +--- PASS: TestTotalByPeriod (0.00s) + --- PASS: TestTotalByPeriod/total_expenses_is_0_when_no_records_found_in_the_provided_days_period (0.00s) + --- PASS: TestTotalByPeriod/total_expenses_for_days_period_from_25th_to_26th_day (0.00s) + --- PASS: TestTotalByPeriod/total_expenses_for_the_full_days_period (0.00s) +=== RUN TestCategoryExpenses +=== RUN TestCategoryExpenses/returns_error_when_no_records_with_category_found_in_any_days_period +=== RUN TestCategoryExpenses/returns_total_category_expenses_in_the_provided_days_period +=== RUN TestCategoryExpenses/returns_0_when_no_category_expenses_found_in_the_provided_days_period +--- PASS: TestCategoryExpenses (0.00s) + --- PASS: TestCategoryExpenses/returns_error_when_no_records_with_category_found_in_any_days_period (0.00s) + --- PASS: TestCategoryExpenses/returns_total_category_expenses_in_the_provided_days_period (0.00s) + --- PASS: TestCategoryExpenses/returns_0_when_no_category_expenses_found_in_the_provided_days_period (0.00s) +=== RUN ExampleFilter +--- PASS: ExampleFilter (0.00s) +=== RUN ExampleByDaysPeriod +--- PASS: ExampleByDaysPeriod (0.00s) +=== RUN ExampleByCategory +--- PASS: ExampleByCategory (0.00s) +=== RUN ExampleTotalByPeriod +--- PASS: ExampleTotalByPeriod (0.00s) +=== RUN ExampleCategoryExpenses +--- PASS: ExampleCategoryExpenses (0.00s) +PASS +ok expenses 0.001s -real 0m0.131s -user 0m0.096s -sys 0m0.096s +real 0m0.116s +user 0m0.143s +sys 0m0.110s =============================================================================== -gosec ./expenses -[gosec] 2022/06/20 00:59:03 Including rules: default -[gosec] 2022/06/20 00:59:03 Excluding rules: default -[gosec] 2022/06/20 00:59:03 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/expenses -2022/06/20 00:59:03 internal error: package "errors" without types was imported from "command-line-arguments" - -real 0m0.377s -user 0m0.384s -sys 0m0.342s +No old benchmarks to run benchstat against. =============================================================================== gomarkdoc --output expenses-doc.md -real 0m0.044s -user 0m0.024s -sys 0m0.012s +real 0m0.014s +user 0m0.006s +sys 0m0.007s =============================================================================== @@ -225,9 +895,9 @@ func Filter(in []Record, predicate func(Record) bool) []Record Filter returns the records for which the predicate function returns true. -real 0m0.180s -user 0m0.114s -sys 0m0.134s +real 0m0.031s +user 0m0.018s +sys 0m0.023s =============================================================================== diff --git a/go/flatten-array/benchstat-new.txt b/go/flatten-array/benchstat-new.txt index b1538ae9..2cae8ef8 100644 --- a/go/flatten-array/benchstat-new.txt +++ b/go/flatten-array/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: flatten -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkFlatten-4 167460 8110 ns/op 1440 B/op 25 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkFlatten +BenchmarkFlatten-8 870082 1317 ns/op 1440 B/op 25 allocs/op PASS -ok flatten 1.487s +ok flatten 1.164s diff --git a/go/flatten-array/benchstat-old.txt b/go/flatten-array/benchstat-old.txt index b58858ba..b1538ae9 100644 --- a/go/flatten-array/benchstat-old.txt +++ b/go/flatten-array/benchstat-old.txt @@ -2,6 +2,6 @@ goos: linux goarch: amd64 pkg: flatten cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkFlatten-4 376266 4443 ns/op 1328 B/op 20 allocs/op +BenchmarkFlatten-4 167460 8110 ns/op 1440 B/op 25 allocs/op PASS -ok flatten 1.763s +ok flatten 1.487s diff --git a/go/flatten-array/coverage-annotations.txt b/go/flatten-array/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/flatten-array/flatten-doc.md b/go/flatten-array/flatten-doc.md index 9c6f924e..300152a0 100755 --- a/go/flatten-array/flatten-doc.md +++ b/go/flatten-array/flatten-doc.md @@ -6,7 +6,7 @@ import "flatten" ``` -Package flatten is used to flatten lists\. +Package flatten is used to flatten lists. ## Index @@ -19,7 +19,7 @@ Package flatten is used to flatten lists\. func Flatten(nested interface{}) []interface{} ``` -Flatten returns a single flattened list with all values except nil\. +Flatten returns a single flattened list with all values except nil.

Example

diff --git a/go/flatten-array/run-tests-go.txt b/go/flatten-array/run-tests-go.txt index ce1490be..3b963cf1 100644 --- a/go/flatten-array/run-tests-go.txt +++ b/go/flatten-array/run-tests-go.txt @@ -5,15 +5,577 @@ Go packages: flatten =============================================================================== -golint flatten +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.012s +sys 0m0.014s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +flatten_array.go:6:2: typeSwitchVar: 1 case can benefit from type switch with assignment (gocritic) + switch nested.(type) { + ^ +cases_test.go:33: line is 135 characters (lll) + input: []interface{}{0, 2, []interface{}{[]interface{}{2, 3}, 8, 100, 4, []interface{}{[]interface{}{[]interface{}{50}}}}, -2}, +cases_test.go:38: line is 143 characters (lll) + input: []interface{}{1, []interface{}{2, []interface{}{[]interface{}{3}}, []interface{}{4, []interface{}{[]interface{}{5}}}, 6, 7}, 8}, +cases_test.go:58: line is 179 characters (lll) + input: []interface{}{0, 2, []interface{}{[]interface{}{2, 3}, 8, []interface{}{[]interface{}{100}}, interface{}(nil), []interface{}{[]interface{}{interface{}(nil)}}}, -2}, +cases_test.go:63: line is 248 characters (lll) + input: []interface{}{interface{}(nil), []interface{}{[]interface{}{[]interface{}{interface{}(nil)}}}, interface{}(nil), interface{}(nil), []interface{}{[]interface{}{interface{}(nil), interface{}(nil)}, interface{}(nil)}, interface{}(nil)}, +flatten_array_test.go:11:25: Using the variable on range scope `tc` in function literal (scopelint) + if actual := Flatten(tc.input); !reflect.DeepEqual(actual, tc.expected) { + ^ +flatten_array_test.go:12:44: Using the variable on range scope `tc` in function literal (scopelint) + t.Errorf("Flatten(%v) = %v, want: %v", tc.input, actual, tc.expected) + ^ +flatten_array_test.go:22:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +flatten_array.go:10:24: type assertion must be checked (forcetypeassert) + for _, item := range nested.([]interface{}) { + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +flatten_array_test.go:8:1: Function TestFlatten missing the call to method parallel (paralleltest) +func TestFlatten(t *testing.T) { +^ +flatten_array_test.go:9:2: Range statement for test TestFlatten missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +cases_test.go:1:9: package should be `flatten_test` instead of `flatten` (testpackage) +package flatten + ^ +flatten_array_examples_test.go:1:9: package should be `flatten_test` instead of `flatten` (testpackage) +package flatten + ^ +flatten_array_test.go:1:9: package should be `flatten_test` instead of `flatten` (testpackage) +package flatten + ^ + +real 0m0.490s +user 0m0.748s +sys 0m0.511s + + + ============================================================================== + +Exit code: -1 + +real 0m0.527s +user 0m0.771s +sys 0m0.536s + +real 0m0.529s +user 0m0.772s +sys 0m0.538s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.010s +user 0m0.004s +sys 0m0.010s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.040s +user 0m0.027s +sys 0m0.024s + + + ============================================================================== + +Exit code: 0 + +real 0m0.062s +user 0m0.036s +sys 0m0.045s + +real 0m0.063s +user 0m0.037s +sys 0m0.045s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.009s +sys 0m0.017s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "flatten [flatten.test]" + +real 0m0.088s +user 0m0.123s +sys 0m0.094s + + + ============================================================================== + +Exit code: -1 + +real 0m0.124s +user 0m0.142s +sys 0m0.123s real 0m0.126s -user 0m0.080s -sys 0m0.138s +user 0m0.143s +sys 0m0.124s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out flatten +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.016s +user 0m0.011s +sys 0m0.008s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +flatten_array.go:6:9: assigning the result of this type assertion to a variable (switch nested := nested.(type)) could eliminate type assertions in switch cases (S1034) + flatten_array.go:10:24: could eliminate this type assertion + +real 0m0.158s +user 0m0.197s +sys 0m0.134s + + + ============================================================================== + +Exit code: -1 + +real 0m0.186s +user 0m0.214s +sys 0m0.151s + +real 0m0.188s +user 0m0.215s +sys 0m0.152s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.006s +sys 0m0.011s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./flatten_array.go:6:2: typeSwitchVar: 1 case can benefit from type switch with assignment + +real 0m0.784s +user 0m1.837s +sys 0m0.259s + + + ============================================================================== + +Exit code: -1 + +real 0m0.808s +user 0m1.849s +sys 0m0.278s + +real 0m0.810s +user 0m1.850s +sys 0m0.279s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.003s +sys 0m0.011s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.075s +user 0m0.142s +sys 0m0.100s + + + ============================================================================== + +Exit code: 0 + +real 0m0.097s +user 0m0.150s +sys 0m0.119s + +real 0m0.098s +user 0m0.150s +sys 0m0.120s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.010s +user 0m0.006s +sys 0m0.007s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.015s +user 0m0.007s +sys 0m0.011s + + + ============================================================================== + +Exit code: 0 + +real 0m0.039s +user 0m0.020s +sys 0m0.029s + +real 0m0.040s +user 0m0.020s +sys 0m0.030s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.009s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.458s +user 0m1.481s +sys 0m0.251s + + + ============================================================================== + +Exit code: 0 + +real 0m0.479s +user 0m1.493s +sys 0m0.269s + +real 0m0.481s +user 0m1.494s +sys 0m0.269s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.005s +sys 0m0.014s + + + ============================================================================== + +Running: gocyclo . + +4 flatten BenchmarkFlatten flatten_array_test.go:18:1 +4 flatten walkInterface flatten_array.go:5:1 +3 flatten TestFlatten flatten_array_test.go:8:1 +1 flatten ExampleFlatten flatten_array_examples_test.go:5:1 +1 flatten Flatten flatten_array.go:17:1 + +real 0m0.003s +user 0m0.001s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.030s +user 0m0.013s +sys 0m0.023s + +real 0m0.032s +user 0m0.015s +sys 0m0.024s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.029s +user 0m0.030s +sys 0m0.011s + + + ============================================================================== + +Exit code: 0 + +real 0m0.043s +user 0m0.036s +sys 0m0.025s + +real 0m0.046s +user 0m0.037s +sys 0m0.027s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.010s +user 0m0.005s +sys 0m0.007s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:23:15 Including rules: default +[gosec] 2023/09/07 00:23:15 Excluding rules: default +[gosec] 2023/09/07 00:23:15 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/flatten-array +[gosec] 2023/09/07 00:23:15 Checking package: flatten +[gosec] 2023/09/07 00:23:15 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/flatten-array/flatten_array.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 23 + Nosec : 0 + Issues : 0 + + +real 0m0.091s +user 0m0.079s +sys 0m0.058s + + + ============================================================================== + +Exit code: 0 + +real 0m0.113s +user 0m0.091s +sys 0m0.073s + +real 0m0.114s +user 0m0.093s +sys 0m0.073s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.007s +sys 0m0.014s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestFlatten === RUN TestFlatten/empty === RUN TestFlatten/no_nesting @@ -26,7 +588,7 @@ go test -v -covermode=count -coverprofile coverage.out flatten === RUN TestFlatten/consecutive_null_values_in_the_middle_of_the_list_are_omitted_from_the_final_result === RUN TestFlatten/6_level_nest_list_with_null_values === RUN TestFlatten/all_values_in_nested_list_are_null ---- PASS: TestFlatten (0.01s) +--- PASS: TestFlatten (0.00s) --- PASS: TestFlatten/empty (0.00s) --- PASS: TestFlatten/no_nesting (0.00s) --- PASS: TestFlatten/flattens_a_nested_array (0.00s) @@ -42,34 +604,55 @@ go test -v -covermode=count -coverprofile coverage.out flatten --- PASS: ExampleFlatten (0.00s) PASS coverage: 100.0% of statements -ok flatten 0.020s coverage: 100.0% of statements +ok flatten 0.002s coverage: 100.0% of statements -real 0m0.979s -user 0m1.017s -sys 0m0.829s +real 0m0.174s +user 0m0.215s +sys 0m0.159s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + flatten/flatten_array.go:5: walkInterface 100.0% flatten/flatten_array.go:17: Flatten 100.0% total: (statements) 100.0% -real 0m0.125s -user 0m0.069s -sys 0m0.098s +real 0m0.030s +user 0m0.009s +sys 0m0.027s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.141s -user 0m0.071s -sys 0m0.147s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic flatten +real 0m0.033s +user 0m0.011s +sys 0m0.032s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.010s +user 0m0.003s +sys 0m0.011s + +real 0m0.010s +user 0m0.003s +sys 0m0.011s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestFlatten === RUN TestFlatten/empty === RUN TestFlatten/no_nesting @@ -82,7 +665,7 @@ go test -v -race -covermode=atomic flatten === RUN TestFlatten/consecutive_null_values_in_the_middle_of_the_list_are_omitted_from_the_final_result === RUN TestFlatten/6_level_nest_list_with_null_values === RUN TestFlatten/all_values_in_nested_list_are_null ---- PASS: TestFlatten (0.03s) +--- PASS: TestFlatten (0.00s) --- PASS: TestFlatten/empty (0.00s) --- PASS: TestFlatten/no_nesting (0.00s) --- PASS: TestFlatten/flattens_a_nested_array (0.00s) @@ -98,107 +681,130 @@ go test -v -race -covermode=atomic flatten --- PASS: ExampleFlatten (0.00s) PASS coverage: 100.0% of statements -ok flatten 0.104s coverage: 100.0% of statements +ok flatten 1.012s coverage: 100.0% of statements + +real 0m1.231s +user 0m0.300s +sys 0m0.177s + + + ============================================================================== + +Exit code: 0 -real 0m1.495s -user 0m1.842s -sys 0m0.979s +real 0m1.509s +user 0m0.554s +sys 0m0.429s + +real 0m1.511s +user 0m0.555s +sys 0m0.430s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: flatten -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkFlatten-4 167460 8110 ns/op 1440 B/op 25 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkFlatten +BenchmarkFlatten-8 870082 1317 ns/op 1440 B/op 25 allocs/op PASS -ok flatten 1.487s +ok flatten 1.164s -real 0m2.541s -user 0m3.908s -sys 0m1.058s +real 0m1.335s +user 0m1.441s +sys 0m0.217s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestFlatten +=== RUN TestFlatten/empty +=== RUN TestFlatten/no_nesting +=== RUN TestFlatten/flattens_a_nested_array +=== RUN TestFlatten/flattens_array_with_just_integers_present +=== RUN TestFlatten/5_level_nesting +=== RUN TestFlatten/6_level_nesting +=== RUN TestFlatten/null_values_are_omitted_from_the_final_result +=== RUN TestFlatten/consecutive_null_values_at_the_front_of_the_list_are_omitted_from_the_final_result +=== RUN TestFlatten/consecutive_null_values_in_the_middle_of_the_list_are_omitted_from_the_final_result +=== RUN TestFlatten/6_level_nest_list_with_null_values +=== RUN TestFlatten/all_values_in_nested_list_are_null +--- PASS: TestFlatten (0.00s) + --- PASS: TestFlatten/empty (0.00s) + --- PASS: TestFlatten/no_nesting (0.00s) + --- PASS: TestFlatten/flattens_a_nested_array (0.00s) + --- PASS: TestFlatten/flattens_array_with_just_integers_present (0.00s) + --- PASS: TestFlatten/5_level_nesting (0.00s) + --- PASS: TestFlatten/6_level_nesting (0.00s) + --- PASS: TestFlatten/null_values_are_omitted_from_the_final_result (0.00s) + --- PASS: TestFlatten/consecutive_null_values_at_the_front_of_the_list_are_omitted_from_the_final_result (0.00s) + --- PASS: TestFlatten/consecutive_null_values_in_the_middle_of_the_list_are_omitted_from_the_final_result (0.00s) + --- PASS: TestFlatten/6_level_nest_list_with_null_values (0.00s) + --- PASS: TestFlatten/all_values_in_nested_list_are_null (0.00s) +=== RUN ExampleFlatten +--- PASS: ExampleFlatten (0.00s) PASS -ok flatten 0.006s +ok flatten 0.001s -real 0m1.207s -user 0m1.319s -sys 0m0.985s +real 0m0.134s +user 0m0.211s +sys 0m0.125s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m0.909s -user 0m1.409s -sys 0m0.667s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -Flatten-4 4.44µs ± 0% 8.11µs ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -Flatten-4 1.33kB ± 0% 1.44kB ± 0% ~ (p=1.000 n=1+1) - -name old allocs/op new allocs/op delta -Flatten-4 20.0 ± 0% 25.0 ± 0% ~ (p=1.000 n=1+1) - -real 0m0.025s -user 0m0.004s -sys 0m0.022s - -=============================================================================== - -go vet flatten - -real 0m0.652s -user 0m0.905s -sys 0m0.608s - -=============================================================================== - -go fix flatten - -real 0m0.064s -user 0m0.048s -sys 0m0.049s - -=============================================================================== - -gosec ./flatten-array -[gosec] 2022/07/27 12:40:20 Including rules: default -[gosec] 2022/07/27 12:40:20 Excluding rules: default -[gosec] 2022/07/27 12:40:20 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/flatten-array -[gosec] 2022/07/27 12:40:20 Checking package: flatten -[gosec] 2022/07/27 12:40:20 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/flatten-array/flatten_array.go -Results: +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: flatten +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Flatten-8 1.317µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Flatten-8 1.406Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Flatten-8 25.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Flatten-4 8.110µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -Summary: - Files: 1 - Lines: 23 - Nosec: 0 - Issues: 0 + │ benchstat-old.txt │ + │ B/op │ +Flatten-4 1.406Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + │ benchstat-old.txt │ + │ allocs/op │ +Flatten-4 25.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.371s -user 0m0.503s -sys 0m0.261s +real 0m0.002s +user 0m0.001s +sys 0m0.001s =============================================================================== gomarkdoc --output flatten-doc.md -real 0m0.047s -user 0m0.039s -sys 0m0.021s +real 0m0.014s +user 0m0.009s +sys 0m0.004s =============================================================================== @@ -213,9 +819,9 @@ func Flatten(nested interface{}) []interface{} Flatten returns a single flattened list with all values except nil. -real 0m0.167s -user 0m0.107s -sys 0m0.150s +real 0m0.027s +user 0m0.016s +sys 0m0.018s =============================================================================== diff --git a/go/gigasecond/benchstat-new.txt b/go/gigasecond/benchstat-new.txt index d4ab9765..aa3223e0 100644 --- a/go/gigasecond/benchstat-new.txt +++ b/go/gigasecond/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: gigasecond -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkAddGigasecond-4 12006235 88.64 ns/op 0 B/op 0 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkAddGigasecond +BenchmarkAddGigasecond-8 50062734 23.77 ns/op 0 B/op 0 allocs/op PASS -ok gigasecond 1.248s +ok gigasecond 1.219s diff --git a/go/gigasecond/benchstat-old.txt b/go/gigasecond/benchstat-old.txt index 96f2fcca..d4ab9765 100644 --- a/go/gigasecond/benchstat-old.txt +++ b/go/gigasecond/benchstat-old.txt @@ -2,6 +2,6 @@ goos: linux goarch: amd64 pkg: gigasecond cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkAddGigasecond-4 16472568 89.37 ns/op 0 B/op 0 allocs/op +BenchmarkAddGigasecond-4 12006235 88.64 ns/op 0 B/op 0 allocs/op PASS -ok gigasecond 2.502s +ok gigasecond 1.248s diff --git a/go/gigasecond/coverage-annotations.txt b/go/gigasecond/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/gigasecond/gigasecond-doc.md b/go/gigasecond/gigasecond-doc.md index 57b3d646..ced34bf7 100755 --- a/go/gigasecond/gigasecond-doc.md +++ b/go/gigasecond/gigasecond-doc.md @@ -6,7 +6,7 @@ import "gigasecond" ``` -Package gigasecond determines the time now plus 1 gigasecond\. +Package gigasecond determines the time now plus 1 gigasecond. ## Index @@ -19,7 +19,7 @@ Package gigasecond determines the time now plus 1 gigasecond\. func AddGigasecond(t time.Time) time.Time ``` -AddGigasecond returns the current time plus 1 gigasecond\. +AddGigasecond returns the current time plus 1 gigasecond.

Example

diff --git a/go/gigasecond/run-tests-go.txt b/go/gigasecond/run-tests-go.txt index 87fa155e..d965bf44 100644 --- a/go/gigasecond/run-tests-go.txt +++ b/go/gigasecond/run-tests-go.txt @@ -5,15 +5,582 @@ Go packages: gigasecond =============================================================================== -golint gigasecond +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.018s +sys 0m0.028s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +gigasecond_test.go:10:34: Comment should end in a period (godot) +// date formats used in test data + ^ +gigasecond.go:11: File is not `gofumpt`-ed (gofumpt) + +gigasecond_test.go:35: line is 154 characters (lll) + t.Fatalf("error in test setup: TestAddGigasecond requires datetime in one of the following formats: \nformat 1:%q\nformat 2:%q\ngot:%q", fmtD, fmtDT, s) +gigasecond_test.go:19:16: Using the variable on range scope `tc` in function literal (scopelint) + in := parse(tc.in, t) + ^ +gigasecond_test.go:20:18: Using the variable on range scope `tc` in function literal (scopelint) + want := parse(tc.want, t) + ^ +gigasecond.go:10: unnecessary leading newline (whitespace) +func AddGigasecond(t time.Time) time.Time { + +gigasecond_test.go:34:2: if statements should only be cuddled with assignments (wsl) + if err != nil { + ^ +gigasecond_test.go:37:2: return statements should not be cuddled if block has more than two lines (wsl) + return tt + ^ +gigasecond_test.go:44:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:6:5: addCases is a global variable (gochecknoglobals) +var addCases = []struct { + ^ +gigasecond_test.go:16:1: Function TestAddGigasecond missing the call to method parallel (paralleltest) +func TestAddGigasecond(t *testing.T) { +^ +gigasecond_test.go:17:2: Range statement for test TestAddGigasecond missing the call to method parallel in test Run (paralleltest) + for _, tc := range addCases { + ^ +cases_test.go:1:9: package should be `gigasecond_test` instead of `gigasecond` (testpackage) +package gigasecond + ^ +gigasecond_examples_test.go:1:9: package should be `gigasecond_test` instead of `gigasecond` (testpackage) +package gigasecond + ^ +gigasecond_test.go:1:9: package should be `gigasecond_test` instead of `gigasecond` (testpackage) +package gigasecond + ^ +gigasecond_test.go:29:6: parameter *testing.T should be the first or after context.Context (thelper) +func parse(s string, t *testing.T) time.Time { + ^ +gigasecond_test.go:30:2: variable name 'tt' is too short for the scope of its usage (varnamelen) + tt, err := time.Parse(fmtDT, s) // try full date time format first + ^ + +real 0m0.421s +user 0m0.604s +sys 0m0.404s + + + ============================================================================== + +Exit code: -1 + +real 0m0.465s +user 0m0.631s +sys 0m0.443s + +real 0m0.466s +user 0m0.632s +sys 0m0.443s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.016s +sys 0m0.017s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.044s +user 0m0.031s +sys 0m0.024s + + + ============================================================================== + +Exit code: 0 + +real 0m0.079s +user 0m0.056s +sys 0m0.048s + +real 0m0.081s +user 0m0.056s +sys 0m0.050s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.024s +sys 0m0.020s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "time" without types was imported from "gigasecond" + +real 0m0.088s +user 0m0.112s +sys 0m0.129s + + + ============================================================================== + +Exit code: -1 + +real 0m0.132s +user 0m0.141s +sys 0m0.163s + +real 0m0.136s +user 0m0.145s +sys 0m0.164s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.015s +sys 0m0.015s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.178s +user 0m0.215s +sys 0m0.140s + + + ============================================================================== + +Exit code: 0 + +real 0m0.208s +user 0m0.237s +sys 0m0.161s + +real 0m0.210s +user 0m0.239s +sys 0m0.161s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.015s +sys 0m0.020s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.829s +user 0m2.004s +sys 0m0.278s + + + ============================================================================== + +Exit code: 0 + +real 0m0.863s +user 0m2.029s +sys 0m0.305s + +real 0m0.865s +user 0m2.029s +sys 0m0.307s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.020s +sys 0m0.018s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.070s +user 0m0.101s +sys 0m0.080s + + + ============================================================================== + +Exit code: 0 + +real 0m0.108s +user 0m0.125s +sys 0m0.109s + +real 0m0.110s +user 0m0.125s +sys 0m0.111s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.022s +sys 0m0.026s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.026s +user 0m0.012s +sys 0m0.024s + + + ============================================================================== + +Exit code: 0 + +real 0m0.069s +user 0m0.039s +sys 0m0.063s + +real 0m0.071s +user 0m0.039s +sys 0m0.065s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... -real 0m0.276s -user 0m0.355s -sys 0m0.252s + +real 0m0.030s +user 0m0.015s +sys 0m0.030s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.459s +user 0m1.401s +sys 0m0.313s + + + ============================================================================== + +Exit code: 0 + +real 0m0.504s +user 0m1.422s +sys 0m0.357s + +real 0m0.506s +user 0m1.423s +sys 0m0.358s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.011s +sys 0m0.016s + + + ============================================================================== + +Running: gocyclo . + +3 gigasecond BenchmarkAddGigasecond gigasecond_test.go:40:1 +3 gigasecond parse gigasecond_test.go:29:1 +3 gigasecond TestAddGigasecond gigasecond_test.go:16:1 +1 gigasecond ExampleAddGigasecond gigasecond_examples_test.go:8:1 +1 gigasecond AddGigasecond gigasecond.go:10:1 + +real 0m0.002s +user 0m0.001s +sys 0m0.001s + + + ============================================================================== + +Exit code: 0 + +real 0m0.030s +user 0m0.016s +sys 0m0.026s + +real 0m0.031s +user 0m0.016s +sys 0m0.028s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.023s +user 0m0.024s +sys 0m0.012s + + + ============================================================================== + +Exit code: 0 + +real 0m0.036s +user 0m0.031s +sys 0m0.020s + +real 0m0.038s +user 0m0.032s +sys 0m0.021s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out gigasecond +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.019s +sys 0m0.015s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:23:21 Including rules: default +[gosec] 2023/09/07 00:23:21 Excluding rules: default +[gosec] 2023/09/07 00:23:21 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/gigasecond +[gosec] 2023/09/07 00:23:21 Checking package: gigasecond +[gosec] 2023/09/07 00:23:21 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/gigasecond/gigasecond.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 15 + Nosec : 0 + Issues : 0 + + +real 0m0.123s +user 0m0.119s +sys 0m0.121s + + + ============================================================================== + +Exit code: 0 + +real 0m0.161s +user 0m0.147s +sys 0m0.147s + +real 0m0.162s +user 0m0.147s +sys 0m0.148s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.014s +sys 0m0.021s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestAddGigasecond === RUN TestAddGigasecond/date_only_specification_of_time === RUN TestAddGigasecond/second_test_for_date_only_specification_of_time @@ -30,40 +597,61 @@ go test -v -covermode=count -coverprofile coverage.out gigasecond --- PASS: ExampleAddGigasecond (0.00s) PASS coverage: 100.0% of statements -ok gigasecond 0.015s coverage: 100.0% of statements +ok gigasecond 0.002s coverage: 100.0% of statements -real 0m1.037s -user 0m1.353s -sys 0m0.832s +real 0m0.191s +user 0m0.238s +sys 0m0.151s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + gigasecond/gigasecond.go:10: AddGigasecond 100.0% total: (statements) 100.0% -real 0m0.400s -user 0m0.325s -sys 0m0.363s +real 0m0.052s +user 0m0.054s +sys 0m0.072s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.434s -user 0m0.365s -sys 0m0.376s +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.052s +user 0m0.056s +sys 0m0.068s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.015s +user 0m0.005s +sys 0m0.020s + +real 0m0.016s +user 0m0.005s +sys 0m0.020s -=============================================================================== -go test -v -race -covermode=atomic gigasecond + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestAddGigasecond === RUN TestAddGigasecond/date_only_specification_of_time === RUN TestAddGigasecond/second_test_for_date_only_specification_of_time === RUN TestAddGigasecond/third_test_for_date_only_specification_of_time === RUN TestAddGigasecond/full_time_specified === RUN TestAddGigasecond/full_time_with_day_roll-over ---- PASS: TestAddGigasecond (0.01s) +--- PASS: TestAddGigasecond (0.00s) --- PASS: TestAddGigasecond/date_only_specification_of_time (0.00s) --- PASS: TestAddGigasecond/second_test_for_date_only_specification_of_time (0.00s) --- PASS: TestAddGigasecond/third_test_for_date_only_specification_of_time (0.00s) @@ -73,97 +661,118 @@ go test -v -race -covermode=atomic gigasecond --- PASS: ExampleAddGigasecond (0.00s) PASS coverage: 100.0% of statements -ok gigasecond 0.058s coverage: 100.0% of statements +ok gigasecond 1.012s coverage: 100.0% of statements + +real 0m1.253s +user 0m0.270s +sys 0m0.168s + + + ============================================================================== + +Exit code: 0 -real 0m1.128s -user 0m1.377s -sys 0m0.812s +real 0m1.597s +user 0m0.645s +sys 0m0.508s + +real 0m1.599s +user 0m0.646s +sys 0m0.509s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: gigasecond -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkAddGigasecond-4 12006235 88.64 ns/op 0 B/op 0 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkAddGigasecond +BenchmarkAddGigasecond-8 50062734 23.77 ns/op 0 B/op 0 allocs/op PASS -ok gigasecond 1.248s +ok gigasecond 1.219s -real 0m2.174s -user 0m2.373s -sys 0m0.731s +real 0m1.377s +user 0m1.431s +sys 0m0.147s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestAddGigasecond +=== RUN TestAddGigasecond/date_only_specification_of_time +=== RUN TestAddGigasecond/second_test_for_date_only_specification_of_time +=== RUN TestAddGigasecond/third_test_for_date_only_specification_of_time +=== RUN TestAddGigasecond/full_time_specified +=== RUN TestAddGigasecond/full_time_with_day_roll-over +--- PASS: TestAddGigasecond (0.00s) + --- PASS: TestAddGigasecond/date_only_specification_of_time (0.00s) + --- PASS: TestAddGigasecond/second_test_for_date_only_specification_of_time (0.00s) + --- PASS: TestAddGigasecond/third_test_for_date_only_specification_of_time (0.00s) + --- PASS: TestAddGigasecond/full_time_specified (0.00s) + --- PASS: TestAddGigasecond/full_time_with_day_roll-over (0.00s) +=== RUN ExampleAddGigasecond +--- PASS: ExampleAddGigasecond (0.00s) PASS -ok gigasecond 0.011s +ok gigasecond 0.002s -real 0m0.989s -user 0m1.159s -sys 0m0.726s +real 0m0.123s +user 0m0.169s +sys 0m0.110s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m1.122s -user 0m1.280s -sys 0m0.706s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -AddGigasecond-4 89.4ns ± 0% 88.6ns ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -AddGigasecond-4 0.00B 0.00B ~ (all equal) - -name old allocs/op new allocs/op delta -AddGigasecond-4 0.00 0.00 ~ (all equal) - -real 0m0.063s -user 0m0.030s -sys 0m0.035s - -=============================================================================== - -go vet gigasecond - -real 0m0.672s -user 0m0.871s -sys 0m0.650s - -=============================================================================== - -go fix gigasecond +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: gigasecond +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +AddGigasecond-8 23.77n ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +AddGigasecond-8 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +AddGigasecond-8 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.181s -user 0m0.227s -sys 0m0.168s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +AddGigasecond-4 88.64n ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +AddGigasecond-4 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./gigasecond -[gosec] 2022/07/27 12:39:39 Including rules: default -[gosec] 2022/07/27 12:39:39 Excluding rules: default -[gosec] 2022/07/27 12:39:39 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/gigasecond -2022/07/27 12:39:39 internal error: package "time" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +AddGigasecond-4 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.700s -user 0m0.857s -sys 0m0.519s +real 0m0.002s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output gigasecond-doc.md -real 0m0.074s -user 0m0.041s -sys 0m0.046s +real 0m0.011s +user 0m0.006s +sys 0m0.006s =============================================================================== @@ -178,9 +787,9 @@ func AddGigasecond(t time.Time) time.Time AddGigasecond returns the current time plus 1 gigasecond. -real 0m0.361s -user 0m0.251s -sys 0m0.312s +real 0m0.041s +user 0m0.027s +sys 0m0.029s =============================================================================== diff --git a/go/grains/benchstat-new.txt b/go/grains/benchstat-new.txt index 73218ccf..6e05ca2b 100644 --- a/go/grains/benchstat-new.txt +++ b/go/grains/benchstat-new.txt @@ -1,8 +1,10 @@ goos: linux goarch: amd64 pkg: grains -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkSquare-4 729800 2388 ns/op 200 B/op 7 allocs/op -BenchmarkTotal-4 1238496 914.7 ns/op 128 B/op 6 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkSquare +BenchmarkSquare-8 2515102 489.0 ns/op 200 B/op 7 allocs/op +BenchmarkTotal +BenchmarkTotal-8 9378760 120.8 ns/op 104 B/op 3 allocs/op PASS -ok grains 4.018s +ok grains 2.981s diff --git a/go/grains/benchstat-old.txt b/go/grains/benchstat-old.txt index 6e02b6b5..73218ccf 100644 --- a/go/grains/benchstat-old.txt +++ b/go/grains/benchstat-old.txt @@ -2,7 +2,7 @@ goos: linux goarch: amd64 pkg: grains cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkSquare-4 834349 1523 ns/op 200 B/op 7 allocs/op -BenchmarkTotal-4 2227270 687.2 ns/op 128 B/op 6 allocs/op +BenchmarkSquare-4 729800 2388 ns/op 200 B/op 7 allocs/op +BenchmarkTotal-4 1238496 914.7 ns/op 128 B/op 6 allocs/op PASS -ok grains 4.262s +ok grains 4.018s diff --git a/go/grains/coverage-annotations.txt b/go/grains/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/grains/coverage.out b/go/grains/coverage.out index 0f40bd01..74f20b15 100644 --- a/go/grains/coverage.out +++ b/go/grains/coverage.out @@ -1,8 +1,8 @@ mode: count grains/grains.go:20.35,21.44 1 14 -grains/grains.go:25.2,25.14 1 4 grains/grains.go:21.44,23.3 1 10 +grains/grains.go:25.2,25.14 1 4 grains/grains.go:29.41,30.30 1 14 -grains/grains.go:34.2,36.42 2 10 grains/grains.go:30.30,32.3 1 4 +grains/grains.go:34.2,36.42 2 10 grains/grains.go:41.21,59.2 5 2 diff --git a/go/grains/grains-doc.md b/go/grains/grains-doc.md index d59a4d0d..d8b45453 100755 --- a/go/grains/grains-doc.md +++ b/go/grains/grains-doc.md @@ -6,7 +6,7 @@ import "grains" ``` -Package grains calculates the number of grains of wheat on a given chessboard square or on the whole chessboard given that the number on each square doubles\. +Package grains calculates the number of grains of wheat on a given chessboard square or on the whole chessboard given that the number on each square doubles. ## Index @@ -20,7 +20,7 @@ Package grains calculates the number of grains of wheat on a given chessboard sq func Square(number int) (uint64, error) ``` -Square returns the number of grains for the given square on a chessboard\. +Square returns the number of grains for the given square on a chessboard.

Example

@@ -53,7 +53,7 @@ Square returns the number of grains for the given square on a chessboard\. func Total() uint64 ``` -Total returns the number of grans for a while chessboard\. https://en.wikipedia.org/wiki/Wheat_and_chessboard_problem#:~:text=The%20number%20of%20grains%20of,of%20one%20grain%20of%20wheat\)\. +Total returns the number of grans for a while chessboard. https://en.wikipedia.org/wiki/Wheat_and_chessboard_problem#:~:text=The%20number%20of%20grains%20of,of%20one%20grain%20of%20wheat\).

Example

diff --git a/go/grains/grains-doc.txt b/go/grains/grains-doc.txt index 94d10ffe..baaec856 100644 --- a/go/grains/grains-doc.txt +++ b/go/grains/grains-doc.txt @@ -1,8 +1,7 @@ package grains // import "grains" -Package grains calculates the number of grains of wheat on a given -chessboard square or on the whole chessboard given that the number on each -square doubles. +Package grains calculates the number of grains of wheat on a given chessboard +square or on the whole chessboard given that the number on each square doubles. FUNCTIONS diff --git a/go/grains/run-tests-go.txt b/go/grains/run-tests-go.txt index da3469f6..bfdde704 100644 --- a/go/grains/run-tests-go.txt +++ b/go/grains/run-tests-go.txt @@ -5,15 +5,614 @@ Go packages: grains =============================================================================== -golint grains +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.038s +user 0m0.032s +sys 0m0.041s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +grains_test.go:40:10: Error return value is not checked (errcheck) + Square(test.input) + ^ +cases_test.go:6:46: Comment should end in a period (godot) +// returns the number of grains on the square + ^ +grains.go:40: line is 133 characters (lll) +// https://en.wikipedia.org/wiki/Wheat_and_chessboard_problem#:~:text=The%20number%20of%20grains%20of,of%20one%20grain%20of%20wheat). +grains.go:42:79: `substract` is a misspelling of `subtract` (misspell) + // Can't use gemetric sequences because we need a number larger than 2^64 to substract 1 from. + ^ +grains.go:34:12: var-declaration: should omit type float64 from declaration of var power; it will be inferred from the right-hand side (revive) + var power float64 = float64(number - 1) + ^ +grains.go:55:12: var-declaration: should omit type *big.Int from declaration of var total; it will be inferred from the right-hand side (revive) + var total *big.Int = new(big.Int).Exp(two, size, nil) + ^ +grains_test.go:10:35: Using the variable on range scope `tc` in function literal (scopelint) + actualVal, actualErr := Square(tc.input) + ^ +grains_test.go:11:7: Using the variable on range scope `tc` in function literal (scopelint) + if tc.expectError { + ^ +grains_test.go:13:56: Using the variable on range scope `tc` in function literal (scopelint) + t.Errorf("Square(%d) expected an error, got: %d", tc.input, actualVal) + ^ +grains.go:41:21: block should not start with a whitespace (wsl) +func Total() uint64 { + ^ +grains.go:56:2: expressions should not be cuddled with declarations or returns (wsl) + total.Sub(total, big.NewInt(int64(1))) + ^ +grains_test.go:49:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:7:5: squareTests is a global variable (gochecknoglobals) +var squareTests = []struct { + ^ +grains.go:31:13: err113: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"[%d] is not a valid square id on our chess board\", number)" (goerr113) + return 0, fmt.Errorf("[%d] is not a valid square id on our chess board", number) + ^ +grains.go:36:25: mnd: Magic number: 2.0, in detected (gomnd) + return uint64(math.Pow(2.0, power)), nil + ^ +grains.go:52:26: mnd: Magic number: 2, in detected (gomnd) + two := big.NewInt(int64(2)) + ^ +grains_test.go:7:1: Function TestSquare missing the call to method parallel (paralleltest) +func TestSquare(t *testing.T) { +^ +grains_test.go:8:2: Range statement for test TestSquare missing the call to method parallel in test Run (paralleltest) + for _, tc := range squareTests { + ^ +grains_test.go:26:1: Function TestTotal missing the call to method parallel (paralleltest) +func TestTotal(t *testing.T) { +^ +cases_test.go:1:9: package should be `grains_test` instead of `grains` (testpackage) +package grains + ^ +grains_examples_test.go:1:9: package should be `grains_test` instead of `grains` (testpackage) +package grains + ^ +grains_test.go:1:9: package should be `grains_test` instead of `grains` (testpackage) +package grains + ^ + +real 0m0.741s +user 0m1.045s +sys 0m0.542s + + + ============================================================================== + +Exit code: -1 + +real 0m0.799s +user 0m1.084s +sys 0m0.600s + +real 0m0.801s +user 0m1.085s +sys 0m0.601s -real 0m0.283s -user 0m0.283s -sys 0m0.311s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.021s +sys 0m0.025s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +grains.go + (34, 12) https://revive.run/r#var-declaration should omit type float64 from declaration of var power; it will be inferred from the right-hand side + + + ✖ 1 problem (0 errors) (1 warnings) + +real 0m0.080s +user 0m0.035s +sys 0m0.046s + + + ============================================================================== + +Exit code: 0 + +real 0m0.113s +user 0m0.061s +sys 0m0.082s + +real 0m0.115s +user 0m0.062s +sys 0m0.083s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out grains +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.021s +sys 0m0.027s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "grains" + +real 0m0.088s +user 0m0.109s +sys 0m0.090s + + + ============================================================================== + +Exit code: -1 + +real 0m0.122s +user 0m0.140s +sys 0m0.122s + +real 0m0.125s +user 0m0.141s +sys 0m0.124s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.021s +sys 0m0.023s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +grains.go:34:12: should omit type float64 from declaration; it will be inferred from the right-hand side (ST1023) +grains.go:55:12: should omit type *big.Int from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.236s +user 0m0.333s +sys 0m0.132s + + + ============================================================================== + +Exit code: -1 + +real 0m0.270s +user 0m0.359s +sys 0m0.164s + +real 0m0.271s +user 0m0.361s +sys 0m0.164s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.024s +sys 0m0.028s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.882s +user 0m1.925s +sys 0m0.306s + + + ============================================================================== + +Exit code: 0 + +real 0m0.921s +user 0m1.952s +sys 0m0.347s + +real 0m0.922s +user 0m1.954s +sys 0m0.347s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.025s +sys 0m0.030s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.132s +user 0m0.203s +sys 0m0.117s + + + ============================================================================== + +Exit code: 0 + +real 0m0.170s +user 0m0.235s +sys 0m0.155s + +real 0m0.172s +user 0m0.236s +sys 0m0.156s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.030s +sys 0m0.026s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.040s +user 0m0.032s +sys 0m0.042s + + + ============================================================================== + +Exit code: 0 + +real 0m0.083s +user 0m0.067s +sys 0m0.079s + +real 0m0.085s +user 0m0.067s +sys 0m0.081s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.042s +user 0m0.036s +sys 0m0.044s + + + ============================================================================== + +Running: errcheck ./... + +grains_test.go:40:10: Square(test.input) + +real 0m0.480s +user 0m1.421s +sys 0m0.266s + + + ============================================================================== + +Exit code: -1 + +real 0m0.537s +user 0m1.463s +sys 0m0.326s + +real 0m0.540s +user 0m1.465s +sys 0m0.326s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.023s +sys 0m0.029s + + + ============================================================================== + +Running: gocyclo . + +6 grains TestSquare grains_test.go:7:1 +4 grains BenchmarkSquare grains_test.go:33:1 +3 grains BenchmarkTotal grains_test.go:45:1 +3 grains isValidSquareID grains.go:20:1 +2 grains TestTotal grains_test.go:26:1 +2 grains Square grains.go:29:1 +1 grains ExampleTotal grains_examples_test.go:19:1 +1 grains ExampleSquare grains_examples_test.go:7:1 +1 grains Total grains.go:41:1 + +real 0m0.002s +user 0m0.001s +sys 0m0.001s + + + ============================================================================== + +Exit code: 0 + +real 0m0.037s +user 0m0.029s +sys 0m0.039s + +real 0m0.039s +user 0m0.030s +sys 0m0.040s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + +grains.go:42:78: "substract" is a misspelling of "subtract" +coverage.html:122:85: "substract" is a misspelling of "subtract" +run-tests-go.txt:49:18: "substract" is a misspelling of "subtract" +run-tests-go.txt:50:78: "substract" is a misspelling of "subtract" + +real 0m0.031s +user 0m0.031s +sys 0m0.014s + + + ============================================================================== + +Exit code: 0 + +real 0m0.041s +user 0m0.039s +sys 0m0.021s + +real 0m0.043s +user 0m0.040s +sys 0m0.021s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.022s +sys 0m0.041s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:23:27 Including rules: default +[gosec] 2023/09/07 00:23:27 Excluding rules: default +[gosec] 2023/09/07 00:23:27 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/grains +[gosec] 2023/09/07 00:23:27 Checking package: grains +[gosec] 2023/09/07 00:23:27 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/grains/grains.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 91 + Nosec : 0 + Issues : 0 + + +real 0m0.113s +user 0m0.125s +sys 0m0.097s + + + ============================================================================== + +Exit code: 0 + +real 0m0.159s +user 0m0.155s +sys 0m0.151s + +real 0m0.161s +user 0m0.156s +sys 0m0.152s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.020s +sys 0m0.017s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestSquare === RUN TestSquare/grains_on_square_1 === RUN TestSquare/grains_on_square_2 @@ -44,35 +643,56 @@ go test -v -covermode=count -coverprofile coverage.out grains --- PASS: ExampleTotal (0.00s) PASS coverage: 100.0% of statements -ok grains 0.013s coverage: 100.0% of statements +ok grains 0.002s coverage: 100.0% of statements -real 0m1.082s -user 0m1.198s -sys 0m0.832s +real 0m0.173s +user 0m0.279s +sys 0m0.148s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + grains/grains.go:20: isValidSquareID 100.0% grains/grains.go:29: Square 100.0% grains/grains.go:41: Total 100.0% total: (statements) 100.0% -real 0m0.504s -user 0m0.690s -sys 0m0.492s +real 0m0.052s +user 0m0.050s +sys 0m0.087s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.564s -user 0m0.642s -sys 0m0.553s +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.062s +user 0m0.074s +sys 0m0.076s -=============================================================================== -go test -v -race -covermode=atomic grains + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.024s +user 0m0.024s +sys 0m0.029s + +real 0m0.024s +user 0m0.024s +sys 0m0.029s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestSquare === RUN TestSquare/grains_on_square_1 === RUN TestSquare/grains_on_square_2 @@ -84,7 +704,7 @@ go test -v -race -covermode=atomic grains === RUN TestSquare/square_0_raises_an_exception === RUN TestSquare/negative_square_raises_an_exception === RUN TestSquare/square_greater_than_64_raises_an_exception ---- PASS: TestSquare (0.01s) +--- PASS: TestSquare (0.00s) --- PASS: TestSquare/grains_on_square_1 (0.00s) --- PASS: TestSquare/grains_on_square_2 (0.00s) --- PASS: TestSquare/grains_on_square_3 (0.00s) @@ -103,110 +723,155 @@ go test -v -race -covermode=atomic grains --- PASS: ExampleTotal (0.00s) PASS coverage: 100.0% of statements -ok grains 0.066s coverage: 100.0% of statements +ok grains 1.018s coverage: 100.0% of statements -real 0m1.464s -user 0m2.078s -sys 0m1.039s +real 0m1.703s +user 0m0.857s +sys 0m0.188s + + + ============================================================================== + +Exit code: 0 + +real 0m2.048s +user 0m1.308s +sys 0m0.556s + +real 0m2.051s +user 0m1.309s +sys 0m0.558s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: grains -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkSquare-4 729800 2388 ns/op 200 B/op 7 allocs/op -BenchmarkTotal-4 1238496 914.7 ns/op 128 B/op 6 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkSquare +BenchmarkSquare-8 2515102 489.0 ns/op 200 B/op 7 allocs/op +BenchmarkTotal +BenchmarkTotal-8 9378760 120.8 ns/op 104 B/op 3 allocs/op PASS -ok grains 4.018s +ok grains 2.981s -real 0m4.916s -user 0m7.169s -sys 0m1.355s +real 0m3.145s +user 0m3.276s +sys 0m0.214s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestSquare +=== RUN TestSquare/grains_on_square_1 +=== RUN TestSquare/grains_on_square_2 +=== RUN TestSquare/grains_on_square_3 +=== RUN TestSquare/grains_on_square_4 +=== RUN TestSquare/grains_on_square_16 +=== RUN TestSquare/grains_on_square_32 +=== RUN TestSquare/grains_on_square_64 +=== RUN TestSquare/square_0_raises_an_exception +=== RUN TestSquare/negative_square_raises_an_exception +=== RUN TestSquare/square_greater_than_64_raises_an_exception +--- PASS: TestSquare (0.00s) + --- PASS: TestSquare/grains_on_square_1 (0.00s) + --- PASS: TestSquare/grains_on_square_2 (0.00s) + --- PASS: TestSquare/grains_on_square_3 (0.00s) + --- PASS: TestSquare/grains_on_square_4 (0.00s) + --- PASS: TestSquare/grains_on_square_16 (0.00s) + --- PASS: TestSquare/grains_on_square_32 (0.00s) + --- PASS: TestSquare/grains_on_square_64 (0.00s) + --- PASS: TestSquare/square_0_raises_an_exception (0.00s) + --- PASS: TestSquare/negative_square_raises_an_exception (0.00s) + --- PASS: TestSquare/square_greater_than_64_raises_an_exception (0.00s) +=== RUN TestTotal +--- PASS: TestTotal (0.00s) +=== RUN ExampleSquare +--- PASS: ExampleSquare (0.00s) +=== RUN ExampleTotal +--- PASS: ExampleTotal (0.00s) PASS -ok grains 0.009s +ok grains 0.002s -real 0m0.913s -user 0m1.207s -sys 0m0.720s +real 0m0.125s +user 0m0.162s +sys 0m0.143s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m1.048s -user 0m1.019s -sys 0m0.578s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -Square-4 1.52µs ± 0% 2.39µs ± 0% ~ (p=1.000 n=1+1) -Total-4 687ns ± 0% 915ns ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -Square-4 200B ± 0% 200B ± 0% ~ (all equal) -Total-4 128B ± 0% 128B ± 0% ~ (all equal) - -name old allocs/op new allocs/op delta -Square-4 7.00 ± 0% 7.00 ± 0% ~ (all equal) -Total-4 6.00 ± 0% 6.00 ± 0% ~ (all equal) - -real 0m0.072s -user 0m0.049s -sys 0m0.071s - -=============================================================================== - -go vet grains - -real 0m0.906s -user 0m1.140s -sys 0m0.620s - -=============================================================================== - -go fix grains - -real 0m0.377s -user 0m0.314s -sys 0m0.276s - -=============================================================================== - -gosec ./grains -[gosec] 2022/07/27 12:33:10 Including rules: default -[gosec] 2022/07/27 12:33:10 Excluding rules: default -[gosec] 2022/07/27 12:33:10 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/grains -2022/07/27 12:33:11 internal error: package "fmt" without types was imported from "command-line-arguments" +benchstat-new.txt:5: missing iteration count +benchstat-new.txt:7: missing iteration count +goos: linux +goarch: amd64 +pkg: grains +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Square-8 489.0n ± ∞ ¹ +Total-8 120.8n ± ∞ ¹ +geomean 243.0n +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Square-8 200.0 ± ∞ ¹ +Total-8 104.0 ± ∞ ¹ +geomean 144.2 +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Square-8 7.000 ± ∞ ¹ +Total-8 3.000 ± ∞ ¹ +geomean 4.583 +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.912s -user 0m1.122s -sys 0m0.682s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Square-4 2.388µ ± ∞ ¹ +Total-4 914.7n ± ∞ ¹ +geomean 1.478µ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ B/op │ +Square-4 200.0 ± ∞ ¹ +Total-4 128.0 ± ∞ ¹ +geomean 160.0 +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ allocs/op │ +Square-4 7.000 ± ∞ ¹ +Total-4 6.000 ± ∞ ¹ +geomean 6.481 +¹ need >= 6 samples for confidence interval at level 0.95 + +real 0m0.003s +user 0m0.002s +sys 0m0.001s =============================================================================== gomarkdoc --output grains-doc.md -real 0m0.050s -user 0m0.040s -sys 0m0.035s +real 0m0.014s +user 0m0.010s +sys 0m0.004s =============================================================================== go doc -all grains package grains // import "grains" -Package grains calculates the number of grains of wheat on a given -chessboard square or on the whole chessboard given that the number on each -square doubles. +Package grains calculates the number of grains of wheat on a given chessboard +square or on the whole chessboard given that the number on each square doubles. FUNCTIONS @@ -218,9 +883,9 @@ func Total() uint64 https://en.wikipedia.org/wiki/Wheat_and_chessboard_problem#:~:text=The%20number%20of%20grains%20of,of%20one%20grain%20of%20wheat). -real 0m0.370s -user 0m0.402s -sys 0m0.420s +real 0m0.034s +user 0m0.026s +sys 0m0.028s =============================================================================== diff --git a/go/gross-store/benchstat-new.txt b/go/gross-store/benchstat-new.txt new file mode 100644 index 00000000..b693e52f --- /dev/null +++ b/go/gross-store/benchstat-new.txt @@ -0,0 +1,2 @@ +PASS +ok gross 0.003s diff --git a/go/gross-store/coverage-annotations.txt b/go/gross-store/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/gross-store/coverage.html b/go/gross-store/coverage.html new file mode 100644 index 00000000..a2059268 --- /dev/null +++ b/go/gross-store/coverage.html @@ -0,0 +1,201 @@ + + + + + + gross: Go Coverage Report + + + +

+ +
+ not tracked + + no coverage + low coverage + * + * + * + * + * + * + * + * + high coverage + +
+
+
+ + + +
+ + + diff --git a/go/gross-store/coverage.out b/go/gross-store/coverage.out index 90aee651..dd14cce0 100644 --- a/go/gross-store/coverage.out +++ b/go/gross-store/coverage.out @@ -3,20 +3,20 @@ gross/gross_store.go:4.29,15.2 2 6 gross/gross_store.go:18.31,22.2 2 14 gross/gross_store.go:25.50,29.2 2 77 gross/gross_store.go:32.66,38.11 4 15 -gross/gross_store.go:50.2,50.15 1 15 gross/gross_store.go:38.11,41.12 2 11 gross/gross_store.go:41.12,43.4 1 2 gross/gross_store.go:43.9,45.4 1 9 gross/gross_store.go:46.8,48.3 1 4 +gross/gross_store.go:50.2,50.15 1 15 gross/gross_store.go:54.69,57.45 2 20 -gross/gross_store.go:73.2,73.15 1 20 gross/gross_store.go:57.45,62.22 3 15 gross/gross_store.go:62.22,64.4 1 5 gross/gross_store.go:64.9,64.29 1 10 gross/gross_store.go:64.29,66.4 1 3 gross/gross_store.go:66.9,68.4 1 7 gross/gross_store.go:69.8,71.3 1 5 +gross/gross_store.go:73.2,73.15 1 20 gross/gross_store.go:77.60,81.23 3 9 -gross/gross_store.go:88.2,88.25 1 9 gross/gross_store.go:81.23,84.3 2 7 gross/gross_store.go:84.8,86.3 1 2 +gross/gross_store.go:88.2,88.25 1 9 diff --git a/go/gross-store/gross-doc.md b/go/gross-store/gross-doc.md index 7524a97c..734fd26f 100755 --- a/go/gross-store/gross-doc.md +++ b/go/gross-store/gross-doc.md @@ -21,7 +21,7 @@ import "gross" func AddItem(bill, units map[string]int, item, unit string) bool ``` -AddItem adds an item to customer bill\. +AddItem adds an item to customer bill.
Example

@@ -56,7 +56,7 @@ false func GetItem(bill map[string]int, item string) (int, bool) ``` -GetItem returns the quantity of an item that the customer has in his/her bill\. +GetItem returns the quantity of an item that the customer has in his/her bill.

Example

@@ -90,7 +90,7 @@ GetItem returns the quantity of an item that the customer has in his/her bill\. func NewBill() map[string]int ``` -NewBill creates a new bill\. +NewBill creates a new bill.

Example

@@ -118,7 +118,7 @@ map[] func RemoveItem(bill, units map[string]int, item, unit string) bool ``` -RemoveItem removes an item from customer bill\. +RemoveItem removes an item from customer bill.

Example

@@ -154,7 +154,7 @@ true func Units() map[string]int ``` -Units stores the Gross Store unit measurements\. +Units stores the Gross Store unit measurements.

Example

diff --git a/go/gross-store/run-tests-go.txt b/go/gross-store/run-tests-go.txt index 369c5350..19a776c3 100644 --- a/go/gross-store/run-tests-go.txt +++ b/go/gross-store/run-tests-go.txt @@ -5,15 +5,649 @@ Go packages: gross =============================================================================== -golint gross +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.008s +sys 0m0.015s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +gross_store_test.go:102: Function 'TestRemoveItem' is too long (77 > 60) (funlen) +func TestRemoveItem(t *testing.T) { +gross_store.go:62:3: ifElseChain: rewrite if-else to switch statement (gocritic) + if newQuantity < 0 { + ^ +gross_store_test.go:39: File is not `gofumpt`-ed (gofumpt) + +} +gross_store_test.go:115: File is not `gofumpt`-ed (gofumpt) + {"Item Not found in bill", +gross_store_test.go:121: File is not `gofumpt`-ed (gofumpt) + {"Invalid measurement unit", +gross_store.go:33:12: var-declaration: should omit type bool from declaration of var found; it will be inferred from the right-hand side (revive) + var found bool = inMap(bill, item) + ^ +gross_store.go:34:12: var-declaration: should omit type bool from declaration of var valid; it will be inferred from the right-hand side (revive) + var valid bool = inMap(units, unit) + ^ +gross_store_test.go:83:25: Using the variable on range scope `tt` in function literal (scopelint) + for _, item := range tt.entry { + ^ +gross_store_test.go:85:14: Using the variable on range scope `tt` in function literal (scopelint) + if ok != tt.expected { + ^ +gross_store_test.go:86:59: Using the variable on range scope `tt` in function literal (scopelint) + t.Errorf("Expected %t from AddItem, found %t at %v", tt.expected, ok, item.name) + ^ +gross_store.go:79:2: declarations should never be cuddled (wsl) + var quantity int + ^ +gross_store_test.go:40:1: block should not end with a whitespace (or comment) (wsl) +} +^ +gross_store_test.go:80:2: only one cuddle assignment allowed before range statement (wsl) + for _, tt := range tests { + ^ +gross_store_test.go:161:2: ranges should only be cuddled with assignments used in the iteration (wsl) + for _, tt := range tests { + ^ +gross_store_test.go:254:2: return statements should not be cuddled if block has more than two lines (wsl) + return bill + ^ +gross_store.go:6:25: mnd: Magic number: 3, in detected (gomnd) + "quarter_of_a_dozen": 3, + ^ +gross_store.go:7:25: mnd: Magic number: 6, in detected (gomnd) + "half_of_a_dozen": 6, + ^ +gross_store.go:8:25: mnd: Magic number: 12, in detected (gomnd) + "dozen": 12, + ^ +gross_store.go:9:25: mnd: Magic number: 120, in detected (gomnd) + "small_gross": 120, + ^ +gross_store.go:10:25: mnd: Magic number: 144, in detected (gomnd) + "gross": 144, + ^ +gross_store.go:11:25: mnd: Magic number: 1728, in detected (gomnd) + "great_gross": 1728, + ^ +gross_store_test.go:32:4: continue with no blank line before (nlreturn) + continue + ^ +gross_store_test.go:13:1: Function TestUnits missing the call to method parallel (paralleltest) +func TestUnits(t *testing.T) { +^ +gross_store_test.go:41:1: Function TestAddItem missing the call to method parallel (paralleltest) +func TestAddItem(t *testing.T) { +^ +gross_store_test.go:182:1: Function TestNewBill missing the call to method parallel (paralleltest) +func TestNewBill(t *testing.T) { +^ +gross_store_test.go:193:1: Function TestGetItem missing the call to method parallel (paralleltest) +func TestGetItem(t *testing.T) { +^ +gross_store_test.go:223:2: Range statement for test TestGetItem missing the call to method parallel in test Run (paralleltest) + for _, tt := range test { + ^ +gross_store_examples_test.go:1:9: package should be `gross_test` instead of `gross` (testpackage) +package gross + ^ +gross_store_test.go:1:9: package should be `gross_test` instead of `gross` (testpackage) +package gross + ^ +gross_store_test.go:27:6: variable name 'tt' is too short for the scope of its usage (varnamelen) + for _, tt := range tests { + ^ +gross_store_test.go:165:5: variable name 'ok' is too short for the scope of its usage (varnamelen) + ok := RemoveItem(bill, units, item.name, item.unit) + ^ +gross_store_test.go:84:5: variable name 'ok' is too short for the scope of its usage (varnamelen) + ok := AddItem(bill, units, item.name, item.unit) + ^ + +real 0m0.513s +user 0m0.862s +sys 0m0.393s + + + ============================================================================== + +Exit code: -1 + +real 0m0.541s +user 0m0.879s +sys 0m0.414s + +real 0m0.542s +user 0m0.879s +sys 0m0.415s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.008s +sys 0m0.016s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +gross_store.go + (1, 1) https://revive.run/r#package-comments should have a package comment + (33, 12) https://revive.run/r#var-declaration should omit type bool from declaration of var found; it will be inferred from the right-hand side + (34, 12) https://revive.run/r#var-declaration should omit type bool from declaration of var valid; it will be inferred from the right-hand side + + + ✖ 3 problems (0 errors) (3 warnings) + +real 0m0.027s +user 0m0.013s +sys 0m0.022s + + + ============================================================================== + +Exit code: 0 + +real 0m0.060s +user 0m0.025s +sys 0m0.052s + +real 0m0.063s +user 0m0.028s +sys 0m0.052s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.005s +sys 0m0.014s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "gross [gross.test]" + +real 0m0.090s +user 0m0.141s +sys 0m0.119s + + + ============================================================================== + +Exit code: -1 + +real 0m0.118s +user 0m0.154s +sys 0m0.144s + +real 0m0.121s +user 0m0.155s +sys 0m0.145s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.008s +sys 0m0.011s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +gross_store.go:1:1: at least one file in a package should have a package comment (ST1000) +gross_store.go:33:12: should omit type bool from declaration; it will be inferred from the right-hand side (ST1023) +gross_store.go:34:12: should omit type bool from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.170s +user 0m0.214s +sys 0m0.106s + + + ============================================================================== + +Exit code: -1 + +real 0m0.197s +user 0m0.228s +sys 0m0.129s + +real 0m0.199s +user 0m0.230s +sys 0m0.129s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.008s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./gross_store.go:62:3: ifElseChain: rewrite if-else to switch statement + +real 0m0.802s +user 0m2.039s +sys 0m0.259s + + + ============================================================================== + +Exit code: -1 + +real 0m0.824s +user 0m2.051s +sys 0m0.275s + +real 0m0.826s +user 0m2.052s +sys 0m0.277s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.005s +sys 0m0.009s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.072s +user 0m0.115s +sys 0m0.094s + + + ============================================================================== + +Exit code: 0 + +real 0m0.094s +user 0m0.124s +sys 0m0.113s + +real 0m0.096s +user 0m0.124s +sys 0m0.115s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.010s +user 0m0.005s +sys 0m0.007s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.021s +user 0m0.013s +sys 0m0.013s + + + ============================================================================== + +Exit code: 0 + +real 0m0.041s +user 0m0.022s +sys 0m0.028s + +real 0m0.043s +user 0m0.023s +sys 0m0.029s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.009s +sys 0m0.020s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.442s +user 0m1.233s +sys 0m0.250s + + + ============================================================================== + +Exit code: 0 + +real 0m0.483s +user 0m1.254s +sys 0m0.283s + +real 0m0.487s +user 0m1.255s +sys 0m0.285s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.008s +sys 0m0.009s + + + ============================================================================== + +Running: gocyclo . + +6 gross TestGetItem gross_store_test.go:193:1 +6 gross TestRemoveItem gross_store_test.go:102:1 +6 gross TestAddItem gross_store_test.go:41:1 +5 gross RemoveItem gross_store.go:54:1 +4 gross TestUnits gross_store_test.go:13:1 +3 gross AddItem gross_store.go:32:1 +2 gross TestNewBill gross_store_test.go:182:1 +2 gross ExampleGetItem gross_store_examples_test.go:50:1 +2 gross GetItem gross_store.go:77:1 +1 gross setupInitialBillData gross_store_test.go:246:1 +1 gross ExampleRemoveItem gross_store_examples_test.go:35:1 +1 gross ExampleAddItem gross_store_examples_test.go:21:1 +1 gross ExampleNewBill gross_store_examples_test.go:14:1 +1 gross ExampleUnits gross_store_examples_test.go:7:1 +1 gross inMap gross_store.go:25:1 +1 gross NewBill gross_store.go:18:1 +1 gross Units gross_store.go:4:1 + +real 0m0.002s +user 0m0.001s +sys 0m0.001s + + + ============================================================================== + +Exit code: 0 + +real 0m0.027s +user 0m0.010s +sys 0m0.026s + +real 0m0.029s +user 0m0.011s +sys 0m0.027s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.029s +user 0m0.036s +sys 0m0.011s + + + ============================================================================== + +Exit code: 0 + +real 0m0.042s +user 0m0.041s +sys 0m0.024s + +real 0m0.044s +user 0m0.041s +sys 0m0.025s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.009s +sys 0m0.008s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:23:35 Including rules: default +[gosec] 2023/09/07 00:23:35 Excluding rules: default +[gosec] 2023/09/07 00:23:35 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/gross-store +[gosec] 2023/09/07 00:23:35 Checking package: gross +[gosec] 2023/09/07 00:23:35 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/gross-store/gross_store.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 89 + Nosec : 0 + Issues : 0 + real 0m0.100s -user 0m0.074s -sys 0m0.071s +user 0m0.080s +sys 0m0.077s + + + ============================================================================== + +Exit code: 0 + +real 0m0.124s +user 0m0.094s +sys 0m0.095s + +real 0m0.126s +user 0m0.095s +sys 0m0.096s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out gross +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.009s +sys 0m0.006s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestUnits --- PASS: TestUnits (0.00s) === RUN TestAddItem @@ -58,15 +692,17 @@ go test -v -covermode=count -coverprofile coverage.out gross --- PASS: ExampleGetItem (0.00s) PASS coverage: 100.0% of statements -ok gross 0.012s coverage: 100.0% of statements +ok gross 0.002s coverage: 100.0% of statements -real 0m0.653s -user 0m0.800s -sys 0m0.524s +real 0m0.194s +user 0m0.272s +sys 0m0.153s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + gross/gross_store.go:4: Units 100.0% gross/gross_store.go:18: NewBill 100.0% gross/gross_store.go:25: inMap 100.0% @@ -75,13 +711,40 @@ gross/gross_store.go:54: RemoveItem 100.0% gross/gross_store.go:77: GetItem 100.0% total: (statements) 100.0% -real 0m0.092s -user 0m0.038s -sys 0m0.118s +real 0m0.025s +user 0m0.009s +sys 0m0.025s -=============================================================================== -go test -v -race -covermode=atomic gross + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.031s +user 0m0.013s +sys 0m0.026s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.014s +user 0m0.007s +sys 0m0.014s + +real 0m0.014s +user 0m0.007s +sys 0m0.014s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestUnits --- PASS: TestUnits (0.00s) === RUN TestAddItem @@ -126,78 +789,98 @@ go test -v -race -covermode=atomic gross --- PASS: ExampleGetItem (0.00s) PASS coverage: 100.0% of statements -ok gross 0.041s coverage: 100.0% of statements +ok gross 1.016s coverage: 100.0% of statements -real 0m0.789s -user 0m0.959s -sys 0m0.480s +real 0m1.286s +user 0m0.340s +sys 0m0.182s -=============================================================================== -go test --bench . --benchmem -PASS -ok gross 0.024s + ============================================================================== -real 0m0.701s -user 0m0.882s -sys 0m0.537s +Exit code: 0 -=============================================================================== +real 0m1.574s +user 0m0.659s +sys 0m0.415s -go test -tags bonus -PASS -ok gross 0.014s - -real 0m0.570s -user 0m0.686s -sys 0m0.501s +real 0m1.577s +user 0m0.660s +sys 0m0.418s =============================================================================== -go vet gross +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok gross 0.003s -real 0m0.465s -user 0m0.596s -sys 0m0.383s +real 0m0.171s +user 0m0.213s +sys 0m0.170s =============================================================================== -go fix gross +gotest -v -tags bonus +=== RUN TestUnits +--- PASS: TestUnits (0.00s) +=== RUN TestAddItem +=== RUN TestAddItem/Invalid_measurement_unit +=== RUN TestAddItem/Valid_measurement_unit +=== RUN TestAddItem/check_quantity_of_item_added_twice +--- PASS: TestAddItem (0.00s) + --- PASS: TestAddItem/Invalid_measurement_unit (0.00s) + --- PASS: TestAddItem/Valid_measurement_unit (0.00s) + --- PASS: TestAddItem/check_quantity_of_item_added_twice (0.00s) +=== RUN TestRemoveItem +=== RUN TestRemoveItem/Item_Not_found_in_bill +=== RUN TestRemoveItem/Invalid_measurement_unit +=== RUN TestRemoveItem/Resulted_qty_less_than_0 +=== RUN TestRemoveItem/Should_delete_the_item_if_0 +=== RUN TestRemoveItem/Should_reduce_the_qty +--- PASS: TestRemoveItem (0.00s) + --- PASS: TestRemoveItem/Item_Not_found_in_bill (0.00s) + --- PASS: TestRemoveItem/Invalid_measurement_unit (0.00s) + --- PASS: TestRemoveItem/Resulted_qty_less_than_0 (0.00s) + --- PASS: TestRemoveItem/Should_delete_the_item_if_0 (0.00s) + --- PASS: TestRemoveItem/Should_reduce_the_qty (0.00s) +=== RUN TestNewBill +=== RUN TestNewBill/Should_reset_customerbill +--- PASS: TestNewBill (0.00s) + --- PASS: TestNewBill/Should_reset_customerbill (0.00s) +=== RUN TestGetItem +=== RUN TestGetItem/Item_Not_found_in_bill +=== RUN TestGetItem/Success +--- PASS: TestGetItem (0.00s) + --- PASS: TestGetItem/Item_Not_found_in_bill (0.00s) + --- PASS: TestGetItem/Success (0.00s) +=== RUN ExampleUnits +--- PASS: ExampleUnits (0.00s) +=== RUN ExampleNewBill +--- PASS: ExampleNewBill (0.00s) +=== RUN ExampleAddItem +--- PASS: ExampleAddItem (0.00s) +=== RUN ExampleRemoveItem +--- PASS: ExampleRemoveItem (0.00s) +=== RUN ExampleGetItem +--- PASS: ExampleGetItem (0.00s) +PASS +ok gross 0.002s -real 0m0.124s -user 0m0.070s -sys 0m0.121s +real 0m0.168s +user 0m0.219s +sys 0m0.174s =============================================================================== -gosec ./gross-store -[gosec] 2022/06/20 23:28:06 Including rules: default -[gosec] 2022/06/20 23:28:06 Excluding rules: default -[gosec] 2022/06/20 23:28:06 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/gross-store -[gosec] 2022/06/20 23:28:06 Checking package: gross -[gosec] 2022/06/20 23:28:06 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/gross-store/gross_store.go -Results: - - -Summary: - Gosec : dev - Files : 1 - Lines : 89 - Nosec : 0 - Issues : 0 - - -real 0m0.322s -user 0m0.295s -sys 0m0.256s +No old benchmarks to run benchstat against. =============================================================================== gomarkdoc --output gross-doc.md -real 0m0.053s -user 0m0.034s -sys 0m0.025s +real 0m0.011s +user 0m0.005s +sys 0m0.006s =============================================================================== @@ -224,9 +907,9 @@ func Units() map[string]int Units stores the Gross Store unit measurements. -real 0m0.191s -user 0m0.084s -sys 0m0.186s +real 0m0.029s +user 0m0.012s +sys 0m0.022s =============================================================================== diff --git a/go/hamming/benchstat-new.txt b/go/hamming/benchstat-new.txt index 603656e5..bed6de59 100644 --- a/go/hamming/benchstat-new.txt +++ b/go/hamming/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: hamming -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkHamming-4 12760 99563 ns/op 20355 B/op 308 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkHamming +BenchmarkHamming-8 71739 18625 ns/op 20486 B/op 308 allocs/op PASS -ok hamming 2.238s +ok hamming 1.510s diff --git a/go/hamming/benchstat-old.txt b/go/hamming/benchstat-old.txt new file mode 100644 index 00000000..603656e5 --- /dev/null +++ b/go/hamming/benchstat-old.txt @@ -0,0 +1,7 @@ +goos: linux +goarch: amd64 +pkg: hamming +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkHamming-4 12760 99563 ns/op 20355 B/op 308 allocs/op +PASS +ok hamming 2.238s diff --git a/go/hamming/coverage-annotations.txt b/go/hamming/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/hamming/coverage.out b/go/hamming/coverage.out index e4d7262a..e1e032a2 100644 --- a/go/hamming/coverage.out +++ b/go/hamming/coverage.out @@ -1,14 +1,14 @@ mode: count hamming/hamming.go:9.56,13.2 2 18 hamming/hamming.go:16.41,20.22 2 15 -hamming/hamming.go:25.2,25.24 1 10 -hamming/hamming.go:30.2,30.39 1 9 -hamming/hamming.go:35.2,35.39 1 7 -hamming/hamming.go:41.2,41.19 1 6 -hamming/hamming.go:47.2,47.22 1 6 hamming/hamming.go:20.22,22.3 1 5 +hamming/hamming.go:25.2,25.24 1 10 hamming/hamming.go:25.24,27.3 1 1 +hamming/hamming.go:30.2,30.39 1 9 hamming/hamming.go:30.39,32.3 1 2 +hamming/hamming.go:35.2,35.39 1 7 hamming/hamming.go:35.39,37.3 1 1 +hamming/hamming.go:41.2,41.19 1 6 hamming/hamming.go:41.19,42.19 1 52 hamming/hamming.go:42.19,44.4 1 19 +hamming/hamming.go:47.2,47.22 1 6 diff --git a/go/hamming/hamming-doc.md b/go/hamming/hamming-doc.md index b22eefc1..ced67c85 100755 --- a/go/hamming/hamming-doc.md +++ b/go/hamming/hamming-doc.md @@ -38,7 +38,7 @@ true func Distance(a, b string) (int, error) ``` -Distance returns an int for the Hamming Distance or 0 and an error if there aer issues\. +Distance returns an int for the Hamming Distance or 0 and an error if there aer issues.

Example

diff --git a/go/hamming/run-tests-go.txt b/go/hamming/run-tests-go.txt index ef58c3df..f5a66aec 100644 --- a/go/hamming/run-tests-go.txt +++ b/go/hamming/run-tests-go.txt @@ -5,15 +5,588 @@ Go packages: hamming =============================================================================== -golint hamming +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.022s +sys 0m0.030s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +hamming_test.go:8:25: Using the variable on range scope `tc` in function literal (scopelint) + got, err := Distance(tc.s1, tc.s2) + ^ +hamming_test.go:10:9: Using the variable on range scope `tc` in function literal (scopelint) + case tc.expectError: + ^ +hamming_test.go:12:59: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("Distance(%q, %q) expected error, got: %d", tc.s1, tc.s2, got) + ^ +hamming_test.go:27:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +hamming.go:21:13: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"strings need to be of equal length\")" (goerr113) + return 0, errors.New("strings need to be of equal length") + ^ +hamming.go:31:13: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"sequence a isn't valid\")" (goerr113) + return 0, errors.New("sequence a isn't valid") + ^ +hamming.go:36:13: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"sequence b isn't valid\")" (goerr113) + return 0, errors.New("sequence b isn't valid") + ^ +hamming_examples_test.go:7:6: Example_isValidDNASequence contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func Example_isValidDNASequence() { + ^ +hamming_test.go:5:1: Function TestHamming missing the call to method parallel (paralleltest) +func TestHamming(t *testing.T) { +^ +hamming_test.go:6:2: Range statement for test TestHamming missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +cases_test.go:1:9: package should be `hamming_test` instead of `hamming` (testpackage) +package hamming + ^ +hamming_examples_test.go:1:9: package should be `hamming_test` instead of `hamming` (testpackage) +package hamming + ^ +hamming_test.go:1:9: package should be `hamming_test` instead of `hamming` (testpackage) +package hamming + ^ +hamming.go:16:15: parameter name 'a' is too short for the scope of its usage (varnamelen) +func Distance(a, b string) (int, error) { + ^ +hamming.go:12:16: error returned from external package is unwrapped: sig: func regexp.MatchString(pattern string, s string) (matched bool, err error) (wrapcheck) + return match, err + ^ + +real 0m0.536s +user 0m0.812s +sys 0m0.530s + + + ============================================================================== + +Exit code: -1 + +real 0m0.583s +user 0m0.843s +sys 0m0.574s + +real 0m0.586s +user 0m0.845s +sys 0m0.575s -real 0m0.282s -user 0m0.356s -sys 0m0.256s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.010s +sys 0m0.022s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +hamming.go + (1, 1) https://revive.run/r#package-comments should have a package comment + + + ✖ 1 problem (0 errors) (1 warnings) + +real 0m0.057s +user 0m0.028s +sys 0m0.043s + + + ============================================================================== + +Exit code: 0 + +real 0m0.089s +user 0m0.043s +sys 0m0.076s + +real 0m0.092s +user 0m0.045s +sys 0m0.077s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.021s +sys 0m0.019s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "errors" without types was imported from "hamming" + +real 0m0.092s +user 0m0.131s +sys 0m0.130s + + + ============================================================================== + +Exit code: -1 + +real 0m0.134s +user 0m0.158s +sys 0m0.163s + +real 0m0.136s +user 0m0.160s +sys 0m0.163s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.012s +sys 0m0.017s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +hamming.go:1:1: at least one file in a package should have a package comment (ST1000) + +real 0m0.172s +user 0m0.217s +sys 0m0.112s + + + ============================================================================== + +Exit code: -1 + +real 0m0.200s +user 0m0.235s +sys 0m0.137s + +real 0m0.202s +user 0m0.235s +sys 0m0.139s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.015s +sys 0m0.022s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.811s +user 0m1.920s +sys 0m0.280s + + + ============================================================================== + +Exit code: 0 + +real 0m0.846s +user 0m1.938s +sys 0m0.316s + +real 0m0.848s +user 0m1.940s +sys 0m0.317s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.017s +sys 0m0.023s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.071s +user 0m0.092s +sys 0m0.090s + + + ============================================================================== + +Exit code: 0 + +real 0m0.108s +user 0m0.117s +sys 0m0.122s + +real 0m0.110s +user 0m0.118s +sys 0m0.123s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.016s +sys 0m0.019s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.021s +user 0m0.016s +sys 0m0.018s + + + ============================================================================== + +Exit code: 0 + +real 0m0.056s +user 0m0.041s +sys 0m0.046s + +real 0m0.057s +user 0m0.042s +sys 0m0.046s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.012s +sys 0m0.021s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.480s +user 0m1.442s +sys 0m0.283s + + + ============================================================================== + +Exit code: 0 + +real 0m0.512s +user 0m1.460s +sys 0m0.314s + +real 0m0.514s +user 0m1.462s +sys 0m0.314s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.015s +sys 0m0.022s + + + ============================================================================== + +Running: gocyclo . + +8 hamming Distance hamming.go:16:1 +6 hamming TestHamming hamming_test.go:5:1 +4 hamming BenchmarkHamming hamming_test.go:23:1 +1 hamming ExampleDistance hamming_examples_test.go:15:1 +1 hamming Example_isValidDNASequence hamming_examples_test.go:7:1 +1 hamming isValidDNASequence hamming.go:9:1 + +real 0m0.002s +user 0m0.000s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.048s +user 0m0.023s +sys 0m0.047s + +real 0m0.050s +user 0m0.024s +sys 0m0.048s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.029s +user 0m0.037s +sys 0m0.012s + + + ============================================================================== + +Exit code: 0 + +real 0m0.040s +user 0m0.046s +sys 0m0.018s + +real 0m0.042s +user 0m0.047s +sys 0m0.019s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.017s +sys 0m0.030s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:23:40 Including rules: default +[gosec] 2023/09/07 00:23:40 Excluding rules: default +[gosec] 2023/09/07 00:23:40 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/hamming +[gosec] 2023/09/07 00:23:40 Checking package: hamming +[gosec] 2023/09/07 00:23:40 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/hamming/hamming.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 48 + Nosec : 0 + Issues : 0 + + +real 0m0.107s +user 0m0.103s +sys 0m0.101s + + + ============================================================================== + +Exit code: 0 + +real 0m0.153s +user 0m0.133s +sys 0m0.143s + +real 0m0.156s +user 0m0.133s +sys 0m0.145s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out hamming +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.011s +sys 0m0.016s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestHamming === RUN TestHamming/empty_strands === RUN TestHamming/single_letter_identical_strands @@ -40,34 +613,55 @@ go test -v -covermode=count -coverprofile coverage.out hamming --- PASS: ExampleDistance (0.00s) PASS coverage: 100.0% of statements -ok hamming 0.004s coverage: 100.0% of statements +ok hamming 0.003s coverage: 100.0% of statements -real 0m0.944s -user 0m1.197s -sys 0m0.705s +real 0m0.193s +user 0m0.250s +sys 0m0.155s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + hamming/hamming.go:9: isValidDNASequence 100.0% hamming/hamming.go:16: Distance 100.0% total: (statements) 100.0% -real 0m0.433s -user 0m0.487s -sys 0m0.396s +real 0m0.046s +user 0m0.058s +sys 0m0.060s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.312s -user 0m0.343s -sys 0m0.284s +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.046s +user 0m0.050s +sys 0m0.051s -=============================================================================== -go test -v -race -covermode=atomic hamming + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.021s +user 0m0.015s +sys 0m0.022s + +real 0m0.022s +user 0m0.015s +sys 0m0.022s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestHamming === RUN TestHamming/empty_strands === RUN TestHamming/single_letter_identical_strands @@ -78,7 +672,7 @@ go test -v -race -covermode=atomic hamming === RUN TestHamming/disallow_second_strand_longer === RUN TestHamming/disallow_empty_first_strand === RUN TestHamming/disallow_empty_second_strand ---- PASS: TestHamming (0.01s) +--- PASS: TestHamming (0.00s) --- PASS: TestHamming/empty_strands (0.00s) --- PASS: TestHamming/single_letter_identical_strands (0.00s) --- PASS: TestHamming/single_letter_different_strands (0.00s) @@ -94,76 +688,128 @@ go test -v -race -covermode=atomic hamming --- PASS: ExampleDistance (0.00s) PASS coverage: 100.0% of statements -ok hamming 0.097s coverage: 100.0% of statements +ok hamming 1.013s coverage: 100.0% of statements -real 0m1.250s -user 0m1.447s -sys 0m0.865s +real 0m1.277s +user 0m0.330s +sys 0m0.181s + + + ============================================================================== + +Exit code: 0 + +real 0m1.612s +user 0m0.717s +sys 0m0.497s + +real 0m1.614s +user 0m0.719s +sys 0m0.498s =============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: hamming -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkHamming-4 12760 99563 ns/op 20355 B/op 308 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkHamming +BenchmarkHamming-8 71739 18625 ns/op 20486 B/op 308 allocs/op PASS -ok hamming 2.238s +ok hamming 1.510s -real 0m3.073s -user 0m5.245s -sys 0m1.083s +real 0m1.681s +user 0m1.827s +sys 0m0.188s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestHamming +=== RUN TestHamming/empty_strands +=== RUN TestHamming/single_letter_identical_strands +=== RUN TestHamming/single_letter_different_strands +=== RUN TestHamming/long_identical_strands +=== RUN TestHamming/long_different_strands +=== RUN TestHamming/disallow_first_strand_longer +=== RUN TestHamming/disallow_second_strand_longer +=== RUN TestHamming/disallow_empty_first_strand +=== RUN TestHamming/disallow_empty_second_strand +--- PASS: TestHamming (0.00s) + --- PASS: TestHamming/empty_strands (0.00s) + --- PASS: TestHamming/single_letter_identical_strands (0.00s) + --- PASS: TestHamming/single_letter_different_strands (0.00s) + --- PASS: TestHamming/long_identical_strands (0.00s) + --- PASS: TestHamming/long_different_strands (0.00s) + --- PASS: TestHamming/disallow_first_strand_longer (0.00s) + --- PASS: TestHamming/disallow_second_strand_longer (0.00s) + --- PASS: TestHamming/disallow_empty_first_strand (0.00s) + --- PASS: TestHamming/disallow_empty_second_strand (0.00s) +=== RUN Example_isValidDNASequence +--- PASS: Example_isValidDNASequence (0.00s) +=== RUN ExampleDistance +--- PASS: ExampleDistance (0.00s) PASS -ok hamming 0.015s +ok hamming 0.002s -real 0m0.698s -user 0m0.838s -sys 0m0.570s +real 0m0.135s +user 0m0.198s +sys 0m0.127s =============================================================================== -No old benchmarks to run benchstat against. - -=============================================================================== - -go vet hamming - -real 0m0.530s -user 0m0.530s -sys 0m0.533s - -=============================================================================== - -go fix hamming +benchstat benchstat-old.txt benchstat-new.txt +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: hamming +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Hamming-8 18.63µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Hamming-8 20.01Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Hamming-8 308.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.232s -user 0m0.218s -sys 0m0.205s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Hamming-4 99.56µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +Hamming-4 19.88Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./hamming -[gosec] 2022/07/27 12:31:40 Including rules: default -[gosec] 2022/07/27 12:31:40 Excluding rules: default -[gosec] 2022/07/27 12:31:40 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/hamming -2022/07/27 12:31:41 internal error: package "errors" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +Hamming-4 308.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.770s -user 0m0.903s -sys 0m0.543s +real 0m0.002s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output hamming-doc.md -real 0m0.061s -user 0m0.045s -sys 0m0.025s +real 0m0.013s +user 0m0.006s +sys 0m0.008s =============================================================================== @@ -178,9 +824,9 @@ func Distance(a, b string) (int, error) aer issues. -real 0m0.302s -user 0m0.312s -sys 0m0.255s +real 0m0.043s +user 0m0.031s +sys 0m0.036s =============================================================================== diff --git a/go/hello-world/benchstat-new.txt b/go/hello-world/benchstat-new.txt new file mode 100644 index 00000000..e15eb7b7 --- /dev/null +++ b/go/hello-world/benchstat-new.txt @@ -0,0 +1,8 @@ +goos: linux +goarch: amd64 +pkg: greeting +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkHelloWorld +BenchmarkHelloWorld-8 1000000000 0.1213 ns/op 0 B/op 0 allocs/op +PASS +ok greeting 0.146s diff --git a/go/hello-world/coverage-annotations.txt b/go/hello-world/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/hello-world/coverage.html b/go/hello-world/coverage.html new file mode 100644 index 00000000..4c091af1 --- /dev/null +++ b/go/hello-world/coverage.html @@ -0,0 +1,118 @@ + + + + + + greeting: Go Coverage Report + + + +

+ +
+ not tracked + + no coverage + low coverage + * + * + * + * + * + * + * + * + high coverage + +
+
+
+ + + +
+ + + diff --git a/go/hello-world/greeting-doc.md b/go/hello-world/greeting-doc.md index 7671cf8c..545b7246 100755 --- a/go/hello-world/greeting-doc.md +++ b/go/hello-world/greeting-doc.md @@ -17,7 +17,7 @@ import "greeting" func HelloWorld() string ``` -HelloWorld greets the world\. +HelloWorld greets the world.
Example

diff --git a/go/hello-world/run-tests-go.txt b/go/hello-world/run-tests-go.txt index d5cdfc91..0f30eee7 100644 --- a/go/hello-world/run-tests-go.txt +++ b/go/hello-world/run-tests-go.txt @@ -5,101 +5,500 @@ Go packages: greeting =============================================================================== -golint greeting +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.191s -user 0m0.085s -sys 0m0.103s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.008s +sys 0m0.008s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +hello_world_test.go:37:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +hello_world_test.go:11:2: variable 'expected' is only used in the if-statement (hello_world_test.go:12:2); consider using short syntax (ifshort) + expected := "Hello, World!" + ^ +hello_world_test.go:10:1: Function TestHelloWorld missing the call to method parallel (paralleltest) +func TestHelloWorld(t *testing.T) { +^ +hello_world_examples_test.go:1:9: package should be `greeting_test` instead of `greeting` (testpackage) +package greeting + ^ +hello_world_test.go:1:9: package should be `greeting_test` instead of `greeting` (testpackage) +package greeting + ^ + +real 0m0.440s +user 0m0.633s +sys 0m0.375s + + + ============================================================================== + +Exit code: -1 + +real 0m0.475s +user 0m0.653s +sys 0m0.401s + +real 0m0.479s +user 0m0.654s +sys 0m0.404s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out greeting -=== RUN TestHelloWorld ---- PASS: TestHelloWorld (0.00s) -=== RUN ExampleHelloWorld ---- PASS: ExampleHelloWorld (0.00s) -PASS -coverage: 100.0% of statements -ok greeting 0.029s coverage: 100.0% of statements +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.005s +sys 0m0.012s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +hello_world.go + (1, 1) https://revive.run/r#package-comments should have a package comment + + + ✖ 1 problem (0 errors) (1 warnings) -real 0m1.420s -user 0m0.781s -sys 0m0.998s +real 0m0.025s +user 0m0.014s +sys 0m0.017s + + + ============================================================================== + +Exit code: 0 + +real 0m0.051s +user 0m0.026s +sys 0m0.038s + +real 0m0.053s +user 0m0.027s +sys 0m0.039s =============================================================================== -go tool cover -func=coverage.out -greeting/hello_world.go:4: HelloWorld 100.0% -total: (statements) 100.0% +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.146s -user 0m0.044s -sys 0m0.142s +real 0m0.001s +user 0m0.000s +sys 0m0.001s =============================================================================== -go test -v -race -covermode=atomic greeting -=== RUN TestHelloWorld ---- PASS: TestHelloWorld (0.00s) -=== RUN ExampleHelloWorld ---- PASS: ExampleHelloWorld (0.00s) -PASS -coverage: 100.0% of statements -ok greeting 0.044s coverage: 100.0% of statements +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... -real 0m0.957s -user 0m0.851s -sys 0m0.585s + +real 0m0.013s +user 0m0.001s +sys 0m0.015s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "greeting [greeting.test]" + +real 0m0.081s +user 0m0.118s +sys 0m0.099s + + + ============================================================================== + +Exit code: -1 + +real 0m0.105s +user 0m0.126s +sys 0m0.122s + +real 0m0.108s +user 0m0.127s +sys 0m0.125s =============================================================================== -go test --bench . --benchmem -goos: linux -goarch: amd64 -pkg: greeting -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkHelloWorld-4 1000000000 0.4114 ns/op 0 B/op 0 allocs/op -PASS -ok greeting 0.558s +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 -real 0m1.198s -user 0m1.411s -sys 0m0.598s + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.005s +sys 0m0.013s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +hello_world.go:1:1: at least one file in a package should have a package comment (ST1000) + +real 0m0.179s +user 0m0.211s +sys 0m0.111s + + + ============================================================================== + +Exit code: -1 + +real 0m0.207s +user 0m0.221s +sys 0m0.137s + +real 0m0.209s +user 0m0.222s +sys 0m0.139s =============================================================================== -go test -tags bonus -PASS -ok greeting 0.004s +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + -real 0m0.570s -user 0m0.665s -sys 0m0.522s + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.009s +sys 0m0.010s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.857s +user 0m1.960s +sys 0m0.318s + + + ============================================================================== + +Exit code: 0 + +real 0m0.890s +user 0m1.980s +sys 0m0.341s + +real 0m0.892s +user 0m1.981s +sys 0m0.342s =============================================================================== -go vet greeting +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== -real 0m0.354s -user 0m0.399s -sys 0m0.327s +Running: go clean ./... + + +real 0m0.016s +user 0m0.009s +sys 0m0.011s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.079s +user 0m0.131s +sys 0m0.112s + + + ============================================================================== + +Exit code: 0 + +real 0m0.106s +user 0m0.149s +sys 0m0.129s + +real 0m0.108s +user 0m0.150s +sys 0m0.129s =============================================================================== -go fix greeting +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... -real 0m0.059s -user 0m0.030s -sys 0m0.054s + +real 0m0.011s +user 0m0.004s +sys 0m0.011s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.018s +user 0m0.006s +sys 0m0.016s + + + ============================================================================== + +Exit code: 0 + +real 0m0.043s +user 0m0.018s +sys 0m0.036s + +real 0m0.045s +user 0m0.019s +sys 0m0.038s =============================================================================== -gosec ./hello-world -[gosec] 2022/06/20 22:11:03 Including rules: default -[gosec] 2022/06/20 22:11:03 Excluding rules: default -[gosec] 2022/06/20 22:11:03 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/hello-world -[gosec] 2022/06/20 22:11:03 Checking package: greeting -[gosec] 2022/06/20 22:11:03 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/hello-world/hello_world.go +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.012s +sys 0m0.014s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.486s +user 0m1.440s +sys 0m0.279s + + + ============================================================================== + +Exit code: 0 + +real 0m0.522s +user 0m1.456s +sys 0m0.310s + +real 0m0.525s +user 0m1.457s +sys 0m0.311s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.011s +sys 0m0.014s + + + ============================================================================== + +Running: gocyclo . + +3 greeting BenchmarkHelloWorld hello_world_test.go:33:1 +2 greeting TestHelloWorld hello_world_test.go:10:1 +1 greeting ExampleHelloWorld hello_world_examples_test.go:7:1 +1 greeting HelloWorld hello_world.go:4:1 + +real 0m0.004s +user 0m0.001s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.036s +user 0m0.018s +sys 0m0.027s + +real 0m0.039s +user 0m0.020s +sys 0m0.029s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.025s +user 0m0.021s +sys 0m0.016s + + + ============================================================================== + +Exit code: 0 + +real 0m0.041s +user 0m0.028s +sys 0m0.033s + +real 0m0.044s +user 0m0.029s +sys 0m0.035s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.009s +sys 0m0.008s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:23:46 Including rules: default +[gosec] 2023/09/07 00:23:46 Excluding rules: default +[gosec] 2023/09/07 00:23:46 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/hello-world +[gosec] 2023/09/07 00:23:46 Checking package: greeting +[gosec] 2023/09/07 00:23:46 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/hello-world/hello_world.go Results: @@ -111,17 +510,168 @@ Results: Issues : 0 -real 0m0.284s -user 0m0.292s -sys 0m0.240s +real 0m0.077s +user 0m0.059s +sys 0m0.043s + + + ============================================================================== + +Exit code: 0 + +real 0m0.103s +user 0m0.074s +sys 0m0.061s + +real 0m0.104s +user 0m0.074s +sys 0m0.062s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.005s +sys 0m0.011s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + +=== RUN TestHelloWorld +--- PASS: TestHelloWorld (0.00s) +=== RUN ExampleHelloWorld +--- PASS: ExampleHelloWorld (0.00s) +PASS +coverage: 100.0% of statements +ok greeting 0.002s coverage: 100.0% of statements + +real 0m0.168s +user 0m0.214s +sys 0m0.146s + + + ============================================================================== + +Running: go tool cover -func=coverage.out + +greeting/hello_world.go:4: HelloWorld 100.0% +total: (statements) 100.0% + +real 0m0.020s +user 0m0.006s +sys 0m0.020s + + + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.021s +user 0m0.006s +sys 0m0.020s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.009s +user 0m0.005s +sys 0m0.009s + +real 0m0.009s +user 0m0.005s +sys 0m0.009s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + +=== RUN TestHelloWorld +--- PASS: TestHelloWorld (0.00s) +=== RUN ExampleHelloWorld +--- PASS: ExampleHelloWorld (0.00s) +PASS +coverage: 100.0% of statements +ok greeting 1.011s coverage: 100.0% of statements + +real 0m1.221s +user 0m0.278s +sys 0m0.177s + + + ============================================================================== + +Exit code: 0 + +real 0m1.462s +user 0m0.516s +sys 0m0.394s + +real 0m1.464s +user 0m0.516s +sys 0m0.396s + +=============================================================================== + +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +goos: linux +goarch: amd64 +pkg: greeting +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkHelloWorld +BenchmarkHelloWorld-8 1000000000 0.1213 ns/op 0 B/op 0 allocs/op +PASS +ok greeting 0.146s + +real 0m0.292s +user 0m0.345s +sys 0m0.155s + +=============================================================================== + +gotest -v -tags bonus +=== RUN TestHelloWorld +--- PASS: TestHelloWorld (0.00s) +=== RUN ExampleHelloWorld +--- PASS: ExampleHelloWorld (0.00s) +PASS +ok greeting 0.002s + +real 0m0.112s +user 0m0.152s +sys 0m0.100s + +=============================================================================== + +No old benchmarks to run benchstat against. =============================================================================== gomarkdoc --output greeting-doc.md -real 0m0.036s -user 0m0.024s -sys 0m0.026s +real 0m0.011s +user 0m0.004s +sys 0m0.008s =============================================================================== @@ -135,9 +685,9 @@ func HelloWorld() string HelloWorld greets the world. -real 0m0.164s -user 0m0.066s -sys 0m0.121s +real 0m0.027s +user 0m0.011s +sys 0m0.023s =============================================================================== diff --git a/go/house/benchstat-new.txt b/go/house/benchstat-new.txt index 775d5335..992b1734 100644 --- a/go/house/benchstat-new.txt +++ b/go/house/benchstat-new.txt @@ -1,10 +1,10 @@ goos: linux goarch: amd64 pkg: house -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkVerse -BenchmarkVerse-4 12996 98897 ns/op 27315 B/op 382 allocs/op +BenchmarkVerse-8 36183 31771 ns/op 33333 B/op 379 allocs/op BenchmarkSong -BenchmarkSong-4 10000 127415 ns/op 34383 B/op 391 allocs/op +BenchmarkSong-8 35149 31843 ns/op 40391 B/op 387 allocs/op PASS -ok house 3.457s +ok house 2.956s diff --git a/go/house/benchstat-old.txt b/go/house/benchstat-old.txt new file mode 100644 index 00000000..775d5335 --- /dev/null +++ b/go/house/benchstat-old.txt @@ -0,0 +1,10 @@ +goos: linux +goarch: amd64 +pkg: house +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkVerse +BenchmarkVerse-4 12996 98897 ns/op 27315 B/op 382 allocs/op +BenchmarkSong +BenchmarkSong-4 10000 127415 ns/op 34383 B/op 391 allocs/op +PASS +ok house 3.457s diff --git a/go/house/coverage.out b/go/house/coverage.out index 0e4bdf14..aa670719 100644 --- a/go/house/coverage.out +++ b/go/house/coverage.out @@ -1,14 +1,14 @@ mode: count house/house.go:10.30,13.29 2 38 -house/house.go:17.2,50.52 4 38 -house/house.go:66.2,66.23 1 38 house/house.go:13.29,15.3 1 0 +house/house.go:17.2,50.52 4 38 house/house.go:50.52,53.13 2 247 -house/house.go:59.3,61.17 2 247 house/house.go:53.13,55.4 1 38 house/house.go:55.9,57.4 1 209 +house/house.go:59.3,61.17 2 247 house/house.go:61.17,63.4 1 209 +house/house.go:66.2,66.23 1 38 house/house.go:70.20,73.27 2 2 -house/house.go:83.2,83.47 1 2 house/house.go:73.27,77.14 3 24 house/house.go:77.14,79.4 1 22 +house/house.go:83.2,83.47 1 2 diff --git a/go/house/run-tests-go.txt b/go/house/run-tests-go.txt index edfc8c56..9c139309 100644 --- a/go/house/run-tests-go.txt +++ b/go/house/run-tests-go.txt @@ -5,56 +5,607 @@ Go packages: house =============================================================================== -golint ./... +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.023s +sys 0m0.020s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +house_examples_test.go:26: Function 'ExampleSong' is too long (92 > 60) (funlen) +func ExampleSong() { +house_test.go:20:28: Comment should end in a period (godot) + // song copied from README + ^ +house_test.go:117:20: Using the variable on range scope `v` in function literal (scopelint) + if got := Verse(v + 1); got != expectedVerses[v] { + ^ +house_test.go:118:48: Using the variable on range scope `v` in function literal (scopelint) + t.Fatalf("Verse(%d)\ngot:\n%q\nwant:\n%q", v+1, got, expectedVerses[v]) + ^ +house_test.go:132:2: only one cuddle assignment allowed before if statement (wsl) + if wantStanzas != gotStanzas { + ^ +house_test.go:135:2: assignments should only be cuddled with other assignments (wsl) + got := strings.Split(s, "\n") + ^ +house_test.go:137:2: declarations should never be cuddled (wsl) + var g, w string + ^ +house_test.go:138:2: declarations should never be cuddled (wsl) + var i int + ^ +house_test.go:144:3: if statements should only be cuddled with assignments (wsl) + if g = got[i]; g != w { + ^ +house_test.go:139:2: only one cuddle assignment allowed before range statement (wsl) + for i, w = range want { + ^ +house_test.go:148:2: expressions should not be cuddled with blocks (wsl) + t.Fatalf("Song() line %d =\n[%q]\n want \n[%q]", i+1, g, w) + ^ +house_test.go:155:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +house_test.go:166:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +house_test.go:2:1: Duplicate words (using) found (dupword) +// Try using using programmatic recursion to generate the verses of the song, +^ +house_test.go:21:2: expectedSong is a global variable (gochecknoglobals) + expectedSong = `This is the house that Jack built. + ^ +house_test.go:111:2: expectedVerses is a global variable (gochecknoglobals) + expectedVerses = strings.Split(expectedSong, "\n\n") + ^ +house.go:77:11: mnd: Magic number: 12, in detected (gomnd) + if i != 12 { + ^ +house_test.go:142:4: break with no blank line before (nlreturn) + break + ^ +house_test.go:114:1: Function TestVerse missing the call to method parallel (paralleltest) +func TestVerse(t *testing.T) { +^ +house_test.go:124:1: Function TestSong missing the call to method parallel (paralleltest) +func TestSong(t *testing.T) { +^ +house_examples_test.go:1:9: package should be `house_test` instead of `house` (testpackage) +package house + ^ +house_test.go:11:9: package should be `house_test` instead of `house` (testpackage) +package house + ^ +house.go:50:6: variable name 'i' is too short for the scope of its usage (varnamelen) + for i, j := 0, level; i <= level; i, j = i+1, j-1 { + ^ +house_test.go:125:2: variable name 's' is too short for the scope of its usage (varnamelen) + s := Song() + ^ -real 0m0.096s -user 0m0.069s -sys 0m0.054s +real 0m0.468s +user 0m0.745s +sys 0m0.419s + + + ============================================================================== + +Exit code: -1 + +real 0m0.504s +user 0m0.776s +sys 0m0.446s + +real 0m0.505s +user 0m0.777s +sys 0m0.447s =============================================================================== -revive ./... +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.018s +sys 0m0.028s + + + ============================================================================== + +Running: revive -formatter=stylish ./... -real 0m0.043s -user 0m0.015s -sys 0m0.015s + +real 0m0.038s +user 0m0.021s +sys 0m0.027s + + + ============================================================================== + +Exit code: 0 + +real 0m0.072s +user 0m0.041s +sys 0m0.066s + +real 0m0.074s +user 0m0.042s +sys 0m0.067s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.282s -user 0m0.302s -sys 0m0.266s +real 0m0.001s +user 0m0.001s +sys 0m0.000s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.024s +sys 0m0.027s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." +internal error: package "fmt" without types was imported from "house" + +real 0m0.083s +user 0m0.119s +sys 0m0.113s + + + ============================================================================== + +Exit code: -1 -real 0m0.473s -user 0m0.529s -sys 0m0.491s +real 0m0.124s +user 0m0.151s +sys 0m0.153s + +real 0m0.126s +user 0m0.152s +sys 0m0.154s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.022s +sys 0m0.022s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.162s +user 0m0.199s +sys 0m0.115s + + + ============================================================================== + +Exit code: 0 + +real 0m0.195s +user 0m0.225s +sys 0m0.149s + +real 0m0.197s +user 0m0.225s +sys 0m0.150s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.025s +sys 0m0.030s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.834s +user 0m2.162s +sys 0m0.307s + + + ============================================================================== + +Exit code: 0 + +real 0m0.878s +user 0m2.193s +sys 0m0.348s + +real 0m0.880s +user 0m2.194s +sys 0m0.349s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.019s +sys 0m0.022s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.082s +user 0m0.109s +sys 0m0.077s + + + ============================================================================== + +Exit code: 0 + +real 0m0.116s +user 0m0.135s +sys 0m0.108s + +real 0m0.117s +user 0m0.136s +sys 0m0.109s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.019s +sys 0m0.023s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.024s +user 0m0.016s +sys 0m0.022s + + + ============================================================================== + +Exit code: 0 + +real 0m0.058s +user 0m0.042s +sys 0m0.056s + +real 0m0.061s +user 0m0.042s +sys 0m0.059s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.034s +user 0m0.030s +sys 0m0.036s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.444s +user 0m1.233s +sys 0m0.263s -real 0m0.468s -user 0m0.443s -sys 0m0.375s + + ============================================================================== + +Exit code: 0 + +real 0m0.491s +user 0m1.271s +sys 0m0.307s + +real 0m0.493s +user 0m1.272s +sys 0m0.308s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.018s +sys 0m0.021s + + + ============================================================================== + +Running: gocyclo . + +6 house TestSong house_test.go:124:1 +6 house Verse house.go:10:1 +4 house BenchmarkVerse house_test.go:151:1 +3 house BenchmarkSong house_test.go:162:1 +3 house TestVerse house_test.go:114:1 +3 house Song house.go:70:1 +1 house ExampleSong house_examples_test.go:26:1 +1 house ExampleVerse house_examples_test.go:5:1 + +real 0m0.003s +user 0m0.001s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.041s +user 0m0.024s +sys 0m0.036s + +real 0m0.043s +user 0m0.024s +sys 0m0.038s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.025s +user 0m0.031s +sys 0m0.006s + + + ============================================================================== + +Exit code: 0 + +real 0m0.038s +user 0m0.038s +sys 0m0.016s + +real 0m0.040s +user 0m0.040s +sys 0m0.016s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.027s +sys 0m0.022s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:23:51 Including rules: default +[gosec] 2023/09/07 00:23:51 Excluding rules: default +[gosec] 2023/09/07 00:23:51 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/house +[gosec] 2023/09/07 00:23:51 Checking package: house +[gosec] 2023/09/07 00:23:51 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/house/house.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 84 + Nosec : 0 + Issues : 0 + + +real 0m0.129s +user 0m0.141s +sys 0m0.100s + + + ============================================================================== + +Exit code: 0 + +real 0m0.167s +user 0m0.174s +sys 0m0.132s -real 0m2.459s -user 0m4.019s -sys 0m1.180s +real 0m0.169s +user 0m0.176s +sys 0m0.132s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.021s +sys 0m0.020s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestVerse === RUN TestVerse/verse_1 === RUN TestVerse/verse_2 @@ -89,34 +640,41 @@ gotest -v -covermode=count -coverprofile coverage.out ./... --- PASS: ExampleSong (0.00s) PASS coverage: 95.5% of statements -ok house 0.027s coverage: 95.5% of statements +ok house 0.002s coverage: 95.5% of statements -real 0m0.712s -user 0m0.819s -sys 0m0.569s +real 0m0.180s +user 0m0.233s +sys 0m0.142s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + house/house.go:10: Verse 93.3% house/house.go:70: Song 100.0% total: (statements) 95.5% -real 0m0.262s -user 0m0.205s -sys 0m0.374s +real 0m0.061s +user 0m0.073s +sys 0m0.080s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.218s -user 0m0.154s -sys 0m0.195s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +real 0m0.047s +user 0m0.049s +sys 0m0.072s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt 10 func Verse(level int) string { 11 level-- @@ -178,13 +736,19 @@ gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annota 67 } -real 0m0.112s -user 0m0.066s -sys 0m0.156s +real 0m0.019s +user 0m0.019s +sys 0m0.020s -=============================================================================== +real 0m0.020s +user 0m0.019s +sys 0m0.020s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestVerse === RUN TestVerse/verse_1 === RUN TestVerse/verse_2 @@ -219,11 +783,24 @@ gotest -v -race -covermode=atomic ./... --- PASS: ExampleSong (0.00s) PASS coverage: 95.5% of statements -ok house 0.048s coverage: 95.5% of statements +ok house 1.012s coverage: 95.5% of statements -real 0m1.118s -user 0m0.886s -sys 0m0.712s +real 0m1.230s +user 0m0.265s +sys 0m0.141s + + + ============================================================================== + +Exit code: 0 + +real 0m1.571s +user 0m0.666s +sys 0m0.485s + +real 0m1.574s +user 0m0.668s +sys 0m0.486s =============================================================================== @@ -234,17 +811,17 @@ gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: house -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkVerse -BenchmarkVerse-4 10000 113670 ns/op 27324 B/op 382 allocs/op +BenchmarkVerse-8 36183 31771 ns/op 33333 B/op 379 allocs/op BenchmarkSong -BenchmarkSong-4 10000 118872 ns/op 34377 B/op 390 allocs/op +BenchmarkSong-8 35149 31843 ns/op 40391 B/op 387 allocs/op PASS -ok house 2.435s +ok house 2.956s -real 0m2.847s -user 0m4.099s -sys 0m0.884s +real 0m3.114s +user 0m3.305s +sys 0m0.275s =============================================================================== @@ -282,90 +859,77 @@ gotest -v -tags bonus === RUN ExampleSong --- PASS: ExampleSong (0.00s) PASS -ok house 0.010s +ok house 0.002s -real 0m0.532s -user 0m0.588s -sys 0m0.442s +real 0m0.131s +user 0m0.171s +sys 0m0.110s =============================================================================== benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -Verse-4 98.9µs ± 0% 113.7µs ± 0% ~ (p=1.000 n=1+1) -Song-4 127µs ± 0% 119µs ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -Verse-4 27.3kB ± 0% 27.3kB ± 0% ~ (p=1.000 n=1+1) -Song-4 34.4kB ± 0% 34.4kB ± 0% ~ (p=1.000 n=1+1) - -name old allocs/op new allocs/op delta -Verse-4 382 ± 0% 382 ± 0% ~ (all equal) -Song-4 391 ± 0% 390 ± 0% ~ (p=1.000 n=1+1) - -real 0m0.054s -user 0m0.021s -sys 0m0.034s - -=============================================================================== - -go vet ./... - -real 0m0.334s -user 0m0.351s -sys 0m0.271s - -=============================================================================== - -go fix ./... - -real 0m0.123s -user 0m0.063s -sys 0m0.080s - -=============================================================================== - -gocyclo . -6 house TestSong house_test.go:124:1 -6 house Verse house.go:10:1 -4 house BenchmarkVerse house_test.go:151:1 -3 house BenchmarkSong house_test.go:162:1 -3 house TestVerse house_test.go:114:1 -3 house Song house.go:70:1 -1 house ExampleSong house_examples_test.go:26:1 -1 house ExampleVerse house_examples_test.go:5:1 - -real 0m0.063s -user 0m0.014s -sys 0m0.022s - -=============================================================================== - -misspell . - -real 0m0.122s -user 0m0.082s -sys 0m0.105s - -=============================================================================== - -gosec ./... -[gosec] 2022/08/26 19:46:35 Including rules: default -[gosec] 2022/08/26 19:46:35 Excluding rules: default -[gosec] 2022/08/26 19:46:35 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/house -2022/08/26 19:46:35 internal error: package "fmt" without types was imported from "command-line-arguments" +benchstat-old.txt:5: missing iteration count +benchstat-old.txt:7: missing iteration count +benchstat-new.txt:5: missing iteration count +benchstat-new.txt:7: missing iteration count +goos: linux +goarch: amd64 +pkg: house +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Verse-8 31.77µ ± ∞ ¹ +Song-8 31.84µ ± ∞ ¹ +geomean 31.81µ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Verse-8 32.55Ki ± ∞ ¹ +Song-8 39.44Ki ± ∞ ¹ +geomean 35.83Ki +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Verse-8 379.0 ± ∞ ¹ +Song-8 387.0 ± ∞ ¹ +geomean 383.0 +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.498s -user 0m0.502s -sys 0m0.418s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Verse-4 98.90µ ± ∞ ¹ +Song-4 127.4µ ± ∞ ¹ +geomean 112.3µ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ B/op │ +Verse-4 26.67Ki ± ∞ ¹ +Song-4 33.58Ki ± ∞ ¹ +geomean 29.93Ki +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ allocs/op │ +Verse-4 382.0 ± ∞ ¹ +Song-4 391.0 ± ∞ ¹ +geomean 386.5 +¹ need >= 6 samples for confidence interval at level 0.95 + +real 0m0.002s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output house-doc.md -real 0m0.071s -user 0m0.031s -sys 0m0.030s +real 0m0.009s +user 0m0.005s +sys 0m0.004s =============================================================================== @@ -383,9 +947,9 @@ func Verse(level int) string Verse returns a specific verse from the nursery rhyme. -real 0m0.215s -user 0m0.096s -sys 0m0.204s +real 0m0.037s +user 0m0.025s +sys 0m0.032s =============================================================================== diff --git a/go/interest-is-interesting/benchstat-new.txt b/go/interest-is-interesting/benchstat-new.txt index 40cc956d..03c89ec9 100644 --- a/go/interest-is-interesting/benchstat-new.txt +++ b/go/interest-is-interesting/benchstat-new.txt @@ -1,2 +1,2 @@ PASS -ok interest 0.014s +ok interest 0.002s diff --git a/go/interest-is-interesting/benchstat-old.txt b/go/interest-is-interesting/benchstat-old.txt new file mode 100644 index 00000000..40cc956d --- /dev/null +++ b/go/interest-is-interesting/benchstat-old.txt @@ -0,0 +1,2 @@ +PASS +ok interest 0.014s diff --git a/go/interest-is-interesting/coverage-annotations.txt b/go/interest-is-interesting/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/interest-is-interesting/coverage.out b/go/interest-is-interesting/coverage.out index e8e012cf..e5120eed 100644 --- a/go/interest-is-interesting/coverage.out +++ b/go/interest-is-interesting/coverage.out @@ -1,6 +1,5 @@ mode: count interest/interest_is_interesting.go:4.44,7.17 2 193 -interest/interest_is_interesting.go:19.2,19.13 1 193 interest/interest_is_interesting.go:7.17,9.3 1 10 interest/interest_is_interesting.go:9.8,9.44 1 183 interest/interest_is_interesting.go:9.44,12.3 1 70 @@ -8,8 +7,9 @@ interest/interest_is_interesting.go:12.8,12.48 1 113 interest/interest_is_interesting.go:12.48,15.3 1 63 interest/interest_is_interesting.go:15.8,15.29 1 50 interest/interest_is_interesting.go:15.29,17.3 1 50 +interest/interest_is_interesting.go:19.2,19.13 1 193 interest/interest_is_interesting.go:23.40,25.2 1 176 interest/interest_is_interesting.go:28.51,30.2 1 11 interest/interest_is_interesting.go:33.68,37.36 3 6 -interest/interest_is_interesting.go:42.2,42.20 1 6 interest/interest_is_interesting.go:37.36,40.3 2 157 +interest/interest_is_interesting.go:42.2,42.20 1 6 diff --git a/go/interest-is-interesting/interest-doc.md b/go/interest-is-interesting/interest-doc.md index 67187152..c449ccf0 100755 --- a/go/interest-is-interesting/interest-doc.md +++ b/go/interest-is-interesting/interest-doc.md @@ -20,7 +20,7 @@ import "interest" func AnnualBalanceUpdate(balance float64) float64 ``` -AnnualBalanceUpdate calculates the annual balance update\, taking into account the interest rate\. +AnnualBalanceUpdate calculates the annual balance update, taking into account the interest rate.

Example

@@ -53,7 +53,7 @@ AnnualBalanceUpdate calculates the annual balance update\, taking into account t func Interest(balance float64) float64 ``` -Interest calculates the interest for the provided balance\. +Interest calculates the interest for the provided balance.

Example

@@ -86,7 +86,7 @@ Interest calculates the interest for the provided balance\. func InterestRate(balance float64) float32 ``` -InterestRate returns the interest rate for the provided balance\. +InterestRate returns the interest rate for the provided balance.

Example

diff --git a/go/interest-is-interesting/run-tests-go.txt b/go/interest-is-interesting/run-tests-go.txt index 10e150a9..09d3c1de 100644 --- a/go/interest-is-interesting/run-tests-go.txt +++ b/go/interest-is-interesting/run-tests-go.txt @@ -5,16 +5,617 @@ Go packages: interest =============================================================================== -golint interest -/home/vpayno/git_vpayno/exercism-workspace/go/interest-is-interesting/interest_is_interesting.go:4:6: func name will be used as interest.InterestRate by other packages, and that stutters; consider calling this Rate +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.005s +sys 0m0.019s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +interest_is_interesting_test.go:16: Function 'TestInterestRate' is too long (85 > 60) (funlen) +func TestInterestRate(t *testing.T) { +interest_is_interesting.go:7:2: ifElseChain: rewrite if-else to switch statement (gocritic) + if balance < 0 { + ^ +interest_is_interesting.go:32:107: Comment should end in a period (godot) +// YearsBeforeDesiredBalance calculates the minimum number of years required to reach the desired balance: + ^ +interest_is_interesting.go:11: File is not `gofumpt`-ed (gofumpt) + +interest_is_interesting.go:14: File is not `gofumpt`-ed (gofumpt) + +interest_is_interesting.go:4:6: func name will be used as interest.InterestRate by other packages, and that stutters; consider calling this Rate (golint) +func InterestRate(balance float64) float32 { + ^ +interest_is_interesting.go:34:20: var-declaration: should omit type float64 from declaration of var movingBalance; it will be inferred from the right-hand side (revive) + var movingBalance float64 = balance + ^ +interest_is_interesting_test.go:91:24: Using the variable on range scope `tt` in function literal (scopelint) + got := InterestRate(tt.balance) + ^ +interest_is_interesting_test.go:92:50: Using the variable on range scope `tt` in function literal (scopelint) + if !floatingPointEquals(float64(got), float64(tt.want)) { + ^ +interest_is_interesting_test.go:95:6: Using the variable on range scope `tt` in function literal (scopelint) + tt.balance, + ^ +interest_is_interesting.go:35:2: declarations should never be cuddled (wsl) + var yearsNeeded int + ^ +interest_is_interesting_test.go:13:2: return statements should not be cuddled if block has more than two lines (wsl) + return absoluteDifferenceBelowThreshold || relativeDifferenceBelowThreshold + ^ +interest_is_interesting.go:24:49: mnd: Magic number: 100, in detected (gomnd) + return balance * float64(InterestRate(balance)/100) + ^ +interest_is_interesting.go:15:23: mnd: Magic number: 5_000, in detected (gomnd) + } else if balance >= 5_000 { + ^ +interest_is_interesting_test.go:89:2: Range statement for test TestInterestRate missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +interest_is_interesting_test.go:104:1: Function TestInterest missing the call to method parallel (paralleltest) +func TestInterest(t *testing.T) { +^ +interest_is_interesting_test.go:132:2: Range statement for test TestInterest missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +interest_is_interesting_test.go:147:1: Function TestAnnualBalanceUpdate missing the call to method parallel (paralleltest) +func TestAnnualBalanceUpdate(t *testing.T) { +^ +interest_is_interesting_test.go:190:2: Range statement for test TestAnnualBalanceUpdate missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +interest_is_interesting_test.go:205:1: Function TestYearsBeforeDesiredBalance missing the call to method parallel (paralleltest) +func TestYearsBeforeDesiredBalance(t *testing.T) { +^ +interest_is_interesting_test.go:244:2: Range statement for test TestYearsBeforeDesiredBalance missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +interest_is_interesting_examples_test.go:1:9: package should be `interest_test` instead of `interest` (testpackage) +package interest + ^ +interest_is_interesting_test.go:1:9: package should be `interest_test` instead of `interest` (testpackage) +package interest + ^ + +real 0m0.482s +user 0m0.779s +sys 0m0.447s + + + ============================================================================== + +Exit code: -1 + +real 0m0.515s +user 0m0.791s +sys 0m0.481s + +real 0m0.519s +user 0m0.792s +sys 0m0.484s -real 0m0.143s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.006s +sys 0m0.010s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +interest_is_interesting.go + (34, 20) https://revive.run/r#var-declaration should omit type float64 from declaration of var movingBalance; it will be inferred from the right-hand side + (1, 1) https://revive.run/r#package-comments should have a package comment + (4, 6) https://revive.run/r#exported func name will be used as interest.InterestRate by other packages, and that stutters; consider calling this Rate + + + ✖ 3 problems (0 errors) (3 warnings) + +real 0m0.048s +user 0m0.027s +sys 0m0.033s + + + ============================================================================== + +Exit code: 0 + +real 0m0.073s +user 0m0.038s +sys 0m0.052s + +real 0m0.075s +user 0m0.038s +sys 0m0.054s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.005s +sys 0m0.020s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "interest [interest.test]" + +real 0m0.096s +user 0m0.093s +sys 0m0.132s + + + ============================================================================== + +Exit code: -1 + +real 0m0.135s +user 0m0.106s +sys 0m0.173s + +real 0m0.138s user 0m0.109s -sys 0m0.126s +sys 0m0.173s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.003s +sys 0m0.012s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +interest_is_interesting.go:1:1: at least one file in a package should have a package comment (ST1000) +interest_is_interesting.go:34:20: should omit type float64 from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.174s +user 0m0.215s +sys 0m0.138s + + + ============================================================================== + +Exit code: -1 + +real 0m0.197s +user 0m0.221s +sys 0m0.162s + +real 0m0.199s +user 0m0.221s +sys 0m0.163s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.005s +sys 0m0.009s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./interest_is_interesting.go:7:2: ifElseChain: rewrite if-else to switch statement + +real 0m0.822s +user 0m1.801s +sys 0m0.252s + + + ============================================================================== + +Exit code: -1 + +real 0m0.844s +user 0m1.815s +sys 0m0.270s + +real 0m0.847s +user 0m1.817s +sys 0m0.271s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.009s +sys 0m0.010s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.087s +user 0m0.126s +sys 0m0.124s + + + ============================================================================== + +Exit code: 0 + +real 0m0.116s +user 0m0.143s +sys 0m0.147s + +real 0m0.119s +user 0m0.144s +sys 0m0.148s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out interest +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.016s +user 0m0.009s +sys 0m0.010s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.019s +user 0m0.009s +sys 0m0.015s + + + ============================================================================== + +Exit code: 0 + +real 0m0.046s +user 0m0.024s +sys 0m0.033s + +real 0m0.047s +user 0m0.025s +sys 0m0.033s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.010s +sys 0m0.016s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.459s +user 0m1.448s +sys 0m0.310s + + + ============================================================================== + +Exit code: 0 + +real 0m0.493s +user 0m1.467s +sys 0m0.338s + +real 0m0.496s +user 0m1.468s +sys 0m0.339s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.004s +sys 0m0.013s + + + ============================================================================== + +Running: gocyclo . + +7 interest InterestRate interest_is_interesting.go:4:1 +3 interest TestYearsBeforeDesiredBalance interest_is_interesting_test.go:205:1 +3 interest TestAnnualBalanceUpdate interest_is_interesting_test.go:147:1 +3 interest TestInterest interest_is_interesting_test.go:104:1 +3 interest TestInterestRate interest_is_interesting_test.go:16:1 +2 interest floatingPointEquals interest_is_interesting_test.go:10:1 +2 interest YearsBeforeDesiredBalance interest_is_interesting.go:33:1 +1 interest ExampleYearsBeforeDesiredBalance interest_is_interesting_examples_test.go:43:1 +1 interest ExampleAnnualBalanceUpdate interest_is_interesting_examples_test.go:31:1 +1 interest ExampleInterest interest_is_interesting_examples_test.go:19:1 +1 interest ExampleInterestRate interest_is_interesting_examples_test.go:7:1 +1 interest AnnualBalanceUpdate interest_is_interesting.go:28:1 +1 interest Interest interest_is_interesting.go:23:1 + +real 0m0.003s +user 0m0.001s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.025s +user 0m0.011s +sys 0m0.021s + +real 0m0.026s +user 0m0.012s +sys 0m0.022s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.029s +user 0m0.038s +sys 0m0.013s + + + ============================================================================== + +Exit code: 0 + +real 0m0.039s +user 0m0.044s +sys 0m0.021s + +real 0m0.041s +user 0m0.045s +sys 0m0.022s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.006s +sys 0m0.014s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:23:58 Including rules: default +[gosec] 2023/09/07 00:23:58 Excluding rules: default +[gosec] 2023/09/07 00:23:58 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/interest-is-interesting +[gosec] 2023/09/07 00:23:58 Checking package: interest +[gosec] 2023/09/07 00:23:58 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/interest-is-interesting/interest_is_interesting.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 43 + Nosec : 0 + Issues : 0 + + +real 0m0.079s +user 0m0.054s +sys 0m0.056s + + + ============================================================================== + +Exit code: 0 + +real 0m0.108s +user 0m0.067s +sys 0m0.081s + +real 0m0.109s +user 0m0.067s +sys 0m0.083s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.008s +sys 0m0.007s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestInterestRate === RUN TestInterestRate/Minimal_first_interest_rate === RUN TestInterestRate/Tiny_first_interest_rate @@ -93,34 +694,55 @@ PASS coverage: 100.0% of statements ok interest 0.005s coverage: 100.0% of statements -real 0m1.030s -user 0m1.445s -sys 0m0.764s +real 0m0.167s +user 0m0.228s +sys 0m0.155s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + interest/interest_is_interesting.go:4: InterestRate 100.0% interest/interest_is_interesting.go:23: Interest 100.0% interest/interest_is_interesting.go:28: AnnualBalanceUpdate 100.0% interest/interest_is_interesting.go:33: YearsBeforeDesiredBalance 100.0% total: (statements) 100.0% -real 0m0.169s -user 0m0.091s -sys 0m0.093s +real 0m0.021s +user 0m0.012s +sys 0m0.016s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.178s -user 0m0.091s -sys 0m0.138s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic interest +real 0m0.025s +user 0m0.012s +sys 0m0.018s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.010s +user 0m0.008s +sys 0m0.006s + +real 0m0.010s +user 0m0.008s +sys 0m0.006s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestInterestRate === RUN TestInterestRate/Minimal_first_interest_rate === RUN TestInterestRate/Tiny_first_interest_rate @@ -181,7 +803,7 @@ go test -v -race -covermode=atomic interest === RUN TestYearsBeforeDesiredBalance/Years_before_desired_balance_for_large_start_balance === RUN TestYearsBeforeDesiredBalance/Years_before_large_difference_between_start_and_target_balance === RUN TestYearsBeforeDesiredBalance/Balance_is_already_above_target ---- PASS: TestYearsBeforeDesiredBalance (0.01s) +--- PASS: TestYearsBeforeDesiredBalance (0.00s) --- PASS: TestYearsBeforeDesiredBalance/Years_before_desired_balance_for_small_start_balance (0.00s) --- PASS: TestYearsBeforeDesiredBalance/Years_before_desired_balance_for_average_start_balance (0.00s) --- PASS: TestYearsBeforeDesiredBalance/Years_before_desired_balance_for_large_start_balance (0.00s) @@ -197,81 +819,137 @@ go test -v -race -covermode=atomic interest --- PASS: ExampleYearsBeforeDesiredBalance (0.00s) PASS coverage: 100.0% of statements -ok interest 0.078s coverage: 100.0% of statements +ok interest 1.027s coverage: 100.0% of statements -real 0m1.269s -user 0m1.599s -sys 0m0.863s +real 0m1.286s +user 0m0.316s +sys 0m0.203s -=============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -PASS -ok interest 0.014s + ============================================================================== -real 0m0.906s -user 0m1.158s -sys 0m0.685s +Exit code: 0 -=============================================================================== - -go test -tags bonus -PASS -ok interest 0.017s +real 0m1.534s +user 0m0.589s +sys 0m0.417s -real 0m0.902s -user 0m1.231s -sys 0m0.662s +real 0m1.536s +user 0m0.590s +sys 0m0.419s =============================================================================== -No old benchmarks to run benchstat against. +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -=============================================================================== - -go vet interest +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok interest 0.002s -real 0m0.676s -user 0m0.772s -sys 0m0.626s +real 0m0.163s +user 0m0.206s +sys 0m0.144s =============================================================================== -go fix interest +gotest -v -tags bonus +=== RUN TestInterestRate +=== RUN TestInterestRate/Minimal_first_interest_rate +=== RUN TestInterestRate/Tiny_first_interest_rate +=== RUN TestInterestRate/Maximum_first_interest_rate +=== RUN TestInterestRate/Minimal_second_interest_rate +=== RUN TestInterestRate/Tiny_second_interest_rate +=== RUN TestInterestRate/Maximum_second_interest_rate +=== RUN TestInterestRate/Minimal_third_interest_rate +=== RUN TestInterestRate/Tiny_third_interest_rate +=== RUN TestInterestRate/Large_third_interest_rate +=== RUN TestInterestRate/Rate_on_minimal_negative_balance +=== RUN TestInterestRate/Rate_on_small_negative_balance +=== RUN TestInterestRate/Rate_on_regular_negative_balance +=== RUN TestInterestRate/Rate_on_large_negative_balance +--- PASS: TestInterestRate (0.00s) + --- PASS: TestInterestRate/Minimal_first_interest_rate (0.00s) + --- PASS: TestInterestRate/Tiny_first_interest_rate (0.00s) + --- PASS: TestInterestRate/Maximum_first_interest_rate (0.00s) + --- PASS: TestInterestRate/Minimal_second_interest_rate (0.00s) + --- PASS: TestInterestRate/Tiny_second_interest_rate (0.00s) + --- PASS: TestInterestRate/Maximum_second_interest_rate (0.00s) + --- PASS: TestInterestRate/Minimal_third_interest_rate (0.00s) + --- PASS: TestInterestRate/Tiny_third_interest_rate (0.00s) + --- PASS: TestInterestRate/Large_third_interest_rate (0.00s) + --- PASS: TestInterestRate/Rate_on_minimal_negative_balance (0.00s) + --- PASS: TestInterestRate/Rate_on_small_negative_balance (0.00s) + --- PASS: TestInterestRate/Rate_on_regular_negative_balance (0.00s) + --- PASS: TestInterestRate/Rate_on_large_negative_balance (0.00s) +=== RUN TestInterest +=== RUN TestInterest/Interest_on_negative_balance +=== RUN TestInterest/Interest_on_small_balance +=== RUN TestInterest/Interest_on_medium_balance +=== RUN TestInterest/Interest_on_large_balance +--- PASS: TestInterest (0.00s) + --- PASS: TestInterest/Interest_on_negative_balance (0.00s) + --- PASS: TestInterest/Interest_on_small_balance (0.00s) + --- PASS: TestInterest/Interest_on_medium_balance (0.00s) + --- PASS: TestInterest/Interest_on_large_balance (0.00s) +=== RUN TestAnnualBalanceUpdate +=== RUN TestAnnualBalanceUpdate/Annual_balance_update_for_empty_start_balance +=== RUN TestAnnualBalanceUpdate/Annual_balance_update_for_small_positive_start_balance +=== RUN TestAnnualBalanceUpdate/Annual_balance_update_for_average_positive_start_balance +=== RUN TestAnnualBalanceUpdate/Annual_balance_update_for_large_positive_start_balance +=== RUN TestAnnualBalanceUpdate/Annual_balance_update_for_huge_positive_start_balance +=== RUN TestAnnualBalanceUpdate/Annual_balance_update_for_small_negative_start_balance +=== RUN TestAnnualBalanceUpdate/Annual_balance_update_for_large_negative_start_balance +--- PASS: TestAnnualBalanceUpdate (0.00s) + --- PASS: TestAnnualBalanceUpdate/Annual_balance_update_for_empty_start_balance (0.00s) + --- PASS: TestAnnualBalanceUpdate/Annual_balance_update_for_small_positive_start_balance (0.00s) + --- PASS: TestAnnualBalanceUpdate/Annual_balance_update_for_average_positive_start_balance (0.00s) + --- PASS: TestAnnualBalanceUpdate/Annual_balance_update_for_large_positive_start_balance (0.00s) + --- PASS: TestAnnualBalanceUpdate/Annual_balance_update_for_huge_positive_start_balance (0.00s) + --- PASS: TestAnnualBalanceUpdate/Annual_balance_update_for_small_negative_start_balance (0.00s) + --- PASS: TestAnnualBalanceUpdate/Annual_balance_update_for_large_negative_start_balance (0.00s) +=== RUN TestYearsBeforeDesiredBalance +=== RUN TestYearsBeforeDesiredBalance/Years_before_desired_balance_for_small_start_balance +=== RUN TestYearsBeforeDesiredBalance/Years_before_desired_balance_for_average_start_balance +=== RUN TestYearsBeforeDesiredBalance/Years_before_desired_balance_for_large_start_balance +=== RUN TestYearsBeforeDesiredBalance/Years_before_large_difference_between_start_and_target_balance +=== RUN TestYearsBeforeDesiredBalance/Balance_is_already_above_target +--- PASS: TestYearsBeforeDesiredBalance (0.00s) + --- PASS: TestYearsBeforeDesiredBalance/Years_before_desired_balance_for_small_start_balance (0.00s) + --- PASS: TestYearsBeforeDesiredBalance/Years_before_desired_balance_for_average_start_balance (0.00s) + --- PASS: TestYearsBeforeDesiredBalance/Years_before_desired_balance_for_large_start_balance (0.00s) + --- PASS: TestYearsBeforeDesiredBalance/Years_before_large_difference_between_start_and_target_balance (0.00s) + --- PASS: TestYearsBeforeDesiredBalance/Balance_is_already_above_target (0.00s) +=== RUN ExampleInterestRate +--- PASS: ExampleInterestRate (0.00s) +=== RUN ExampleInterest +--- PASS: ExampleInterest (0.00s) +=== RUN ExampleAnnualBalanceUpdate +--- PASS: ExampleAnnualBalanceUpdate (0.00s) +=== RUN ExampleYearsBeforeDesiredBalance +--- PASS: ExampleYearsBeforeDesiredBalance (0.00s) +PASS +ok interest 0.003s -real 0m0.070s -user 0m0.051s -sys 0m0.055s +real 0m0.130s +user 0m0.180s +sys 0m0.120s =============================================================================== -gosec ./interest-is-interesting -[gosec] 2022/07/27 12:27:52 Including rules: default -[gosec] 2022/07/27 12:27:52 Excluding rules: default -[gosec] 2022/07/27 12:27:52 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/interest-is-interesting -[gosec] 2022/07/27 12:27:52 Checking package: interest -[gosec] 2022/07/27 12:27:52 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/interest-is-interesting/interest_is_interesting.go -Results: - - -Summary: - Files: 1 - Lines: 43 - Nosec: 0 - Issues: 0 - +benchstat benchstat-old.txt benchstat-new.txt -real 0m0.426s -user 0m0.636s -sys 0m0.323s +real 0m0.002s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output interest-doc.md -real 0m0.045s -user 0m0.036s -sys 0m0.024s +real 0m0.012s +user 0m0.008s +sys 0m0.004s =============================================================================== @@ -296,9 +974,9 @@ func YearsBeforeDesiredBalance(balance, targetBalance float64) int reach the desired balance: -real 0m0.201s -user 0m0.089s -sys 0m0.153s +real 0m0.029s +user 0m0.013s +sys 0m0.021s =============================================================================== diff --git a/go/isbn-verifier/benchstat-new.txt b/go/isbn-verifier/benchstat-new.txt index 61bc9b00..9530dea4 100644 --- a/go/isbn-verifier/benchstat-new.txt +++ b/go/isbn-verifier/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: isbn -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkIsValidISBN-4 5523 220961 ns/op 80090 B/op 995 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkIsValidISBN +BenchmarkIsValidISBN-8 18230 62404 ns/op 79851 B/op 917 allocs/op PASS -ok isbn 2.083s +ok isbn 1.744s diff --git a/go/isbn-verifier/benchstat-old.txt b/go/isbn-verifier/benchstat-old.txt index e7c3bf4b..61bc9b00 100644 --- a/go/isbn-verifier/benchstat-old.txt +++ b/go/isbn-verifier/benchstat-old.txt @@ -2,6 +2,6 @@ goos: linux goarch: amd64 pkg: isbn cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkIsValidISBN-4 6186 230539 ns/op 71705 B/op 899 allocs/op +BenchmarkIsValidISBN-4 5523 220961 ns/op 80090 B/op 995 allocs/op PASS -ok isbn 2.420s +ok isbn 2.083s diff --git a/go/isbn-verifier/coverage-annotations.txt b/go/isbn-verifier/coverage-annotations.txt new file mode 100644 index 00000000..31a886db --- /dev/null +++ b/go/isbn-verifier/coverage-annotations.txt @@ -0,0 +1,55 @@ + +11 func IsValidISBN(isbn string) bool { +12 var sum int +13 +14 reStr := `^[0-9][0-9-]+([0-9]|X)$` +15 +16 match, error := regexp.MatchString(reStr, isbn) +17 +18 if error != nil { +19 MISS panic(error) +20 } +21 +22 if !match { +23 return false +24 } +25 +26 isbn = strings.ReplaceAll(isbn, "-", "") +27 +28 if len(isbn) == 0 || len(isbn) < 10 { +29 return false +30 } +31 +32 for i, r := range isbn { +33 if r == '-' { +34 MISS continue +35 } +36 +37 var n int +38 +39 if r == 'X' { +40 n = 10 +41 } else { +42 n, error = strconv.Atoi(string(r)) +43 +44 if error != nil { +45 MISS panic(error) +46 } +47 } +48 +49 d := 10 - i +50 +51 if d < 1 { +52 return false +53 } +54 +55 sum += n * d +56 } +57 +58 if sum%11 == 0 { +59 return true +60 } +61 +62 return false +63 } + diff --git a/go/isbn-verifier/coverage.out b/go/isbn-verifier/coverage.out index 1b8e0f92..a8426e00 100644 --- a/go/isbn-verifier/coverage.out +++ b/go/isbn-verifier/coverage.out @@ -1,20 +1,20 @@ mode: count isbn/isbn_verifier.go:11.36,18.18 4 22 -isbn/isbn_verifier.go:22.2,22.12 1 22 -isbn/isbn_verifier.go:26.2,28.38 2 14 -isbn/isbn_verifier.go:32.2,32.25 1 11 -isbn/isbn_verifier.go:58.2,58.17 1 9 -isbn/isbn_verifier.go:62.2,62.14 1 3 isbn/isbn_verifier.go:18.18,19.15 1 0 +isbn/isbn_verifier.go:22.2,22.12 1 22 isbn/isbn_verifier.go:22.12,24.3 1 8 +isbn/isbn_verifier.go:26.2,28.38 2 14 isbn/isbn_verifier.go:28.38,30.3 1 3 +isbn/isbn_verifier.go:32.2,32.25 1 11 isbn/isbn_verifier.go:32.25,33.15 1 112 -isbn/isbn_verifier.go:37.3,39.15 2 112 -isbn/isbn_verifier.go:49.3,51.12 2 112 -isbn/isbn_verifier.go:55.3,55.15 1 110 isbn/isbn_verifier.go:33.15,34.12 1 0 +isbn/isbn_verifier.go:37.3,39.15 2 112 isbn/isbn_verifier.go:39.15,41.4 1 5 isbn/isbn_verifier.go:41.9,44.20 2 107 isbn/isbn_verifier.go:44.20,45.17 1 0 +isbn/isbn_verifier.go:49.3,51.12 2 112 isbn/isbn_verifier.go:51.12,53.4 1 2 +isbn/isbn_verifier.go:55.3,55.15 1 110 +isbn/isbn_verifier.go:58.2,58.17 1 9 isbn/isbn_verifier.go:58.17,60.3 1 6 +isbn/isbn_verifier.go:62.2,62.14 1 3 diff --git a/go/isbn-verifier/isbn-doc.md b/go/isbn-verifier/isbn-doc.md index 5534e4c4..bdd04cd0 100755 --- a/go/isbn-verifier/isbn-doc.md +++ b/go/isbn-verifier/isbn-doc.md @@ -6,7 +6,7 @@ import "isbn" ``` -Package isbn is used to validate book id numbers\. +Package isbn is used to validate book id numbers. ## Index @@ -19,7 +19,7 @@ Package isbn is used to validate book id numbers\. func IsValidISBN(isbn string) bool ``` -IsValidISBN returns true if the book id number is valid\. +IsValidISBN returns true if the book id number is valid.

Example

diff --git a/go/isbn-verifier/run-tests-go.txt b/go/isbn-verifier/run-tests-go.txt index 76271907..a89b06df 100644 --- a/go/isbn-verifier/run-tests-go.txt +++ b/go/isbn-verifier/run-tests-go.txt @@ -5,15 +5,583 @@ Go packages: isbn =============================================================================== -golint isbn +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.200s -user 0m0.175s -sys 0m0.187s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.022s +sys 0m0.022s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +isbn_verifier_test.go:10:26: Using the variable on range scope `tc` in function literal (scopelint) + actual := IsValidISBN(tc.isbn) + ^ +isbn_verifier_test.go:11:17: Using the variable on range scope `tc` in function literal (scopelint) + if actual != tc.expected { + ^ +isbn_verifier_test.go:12:46: Using the variable on range scope `tc` in function literal (scopelint) + t.Errorf("IsValidISBN(%q)=%t, want: %t", tc.isbn, actual, tc.expected) + ^ +isbn_verifier_test.go:22:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +isbn_verifier.go:11:1: calculated cyclomatic complexity for function IsValidISBN is 11, max is 10 (cyclop) +func IsValidISBN(isbn string) bool { +^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +isbn_verifier.go:49:8: mnd: Magic number: 10, in detected (gomnd) + d := 10 - i + ^ +isbn_verifier.go:58:2: S1008: should use 'return sum%11 == 0' instead of 'if sum%11 == 0 { return true }; return false' (gosimple) + if sum%11 == 0 { + ^ +isbn_verifier_test.go:7:1: Function TestIsValidISBN missing the call to method parallel (paralleltest) +func TestIsValidISBN(t *testing.T) { +^ +isbn_verifier_test.go:8:2: Range statement for test TestIsValidISBN missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +isbn_verifier.go:16:9: variable error has same name as predeclared identifier (predeclared) + match, error := regexp.MatchString(reStr, isbn) + ^ +cases_test.go:1:9: package should be `isbn_test` instead of `isbn` (testpackage) +package isbn + ^ +isbn_verifier_examples_test.go:1:9: package should be `isbn_test` instead of `isbn` (testpackage) +package isbn + ^ +isbn_verifier_test.go:1:9: package should be `isbn_test` instead of `isbn` (testpackage) +package isbn + ^ +isbn_verifier.go:37:7: variable name 'n' is too short for the scope of its usage (varnamelen) + var n int + ^ +isbn_verifier.go:32:6: variable name 'i' is too short for the scope of its usage (varnamelen) + for i, r := range isbn { + ^ + +real 0m0.584s +user 0m0.883s +sys 0m0.557s + + + ============================================================================== + +Exit code: -1 + +real 0m0.625s +user 0m0.913s +sys 0m0.589s + +real 0m0.627s +user 0m0.915s +sys 0m0.590s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.010s +sys 0m0.021s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.069s +user 0m0.034s +sys 0m0.055s + + + ============================================================================== + +Exit code: 0 + +real 0m0.101s +user 0m0.052s +sys 0m0.083s + +real 0m0.103s +user 0m0.054s +sys 0m0.084s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.022s +sys 0m0.030s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "regexp" without types was imported from "isbn" + +real 0m0.092s +user 0m0.126s +sys 0m0.121s + + + ============================================================================== + +Exit code: -1 + +real 0m0.146s +user 0m0.158s +sys 0m0.172s + +real 0m0.150s +user 0m0.160s +sys 0m0.174s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.013s +sys 0m0.016s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +isbn_verifier.go:58:2: should use 'return sum%11 == 0' instead of 'if sum%11 == 0 { return true }; return false' (S1008) + +real 0m0.191s +user 0m0.233s +sys 0m0.159s + + + ============================================================================== + +Exit code: -1 + +real 0m0.219s +user 0m0.251s +sys 0m0.185s + +real 0m0.221s +user 0m0.252s +sys 0m0.186s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.014s +sys 0m0.019s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./isbn_verifier.go:16:9: builtinShadow: shadowing of predeclared identifier: error +./isbn_verifier.go:28:5: emptyStringTest: replace `len(isbn) == 0` with `isbn == ""` + +real 0m0.801s +user 0m1.965s +sys 0m0.278s + + + ============================================================================== + +Exit code: -1 + +real 0m0.837s +user 0m1.985s +sys 0m0.308s + +real 0m0.840s +user 0m1.985s +sys 0m0.311s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.014s +sys 0m0.015s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.072s +user 0m0.131s +sys 0m0.109s + + + ============================================================================== + +Exit code: 0 + +real 0m0.109s +user 0m0.150s +sys 0m0.134s + +real 0m0.112s +user 0m0.150s +sys 0m0.136s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.013s +sys 0m0.020s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.027s +user 0m0.022s +sys 0m0.024s + + + ============================================================================== + +Exit code: 0 + +real 0m0.058s +user 0m0.041s +sys 0m0.052s + +real 0m0.059s +user 0m0.042s +sys 0m0.053s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.020s +sys 0m0.028s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.454s +user 0m1.320s +sys 0m0.287s + + + ============================================================================== + +Exit code: 0 + +real 0m0.503s +user 0m1.346s +sys 0m0.331s + +real 0m0.506s +user 0m1.348s +sys 0m0.332s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.010s +sys 0m0.017s + + + ============================================================================== + +Running: gocyclo . + +11 isbn IsValidISBN isbn_verifier.go:11:1 +4 isbn BenchmarkIsValidISBN isbn_verifier_test.go:18:1 +3 isbn TestIsValidISBN isbn_verifier_test.go:7:1 +1 isbn ExampleIsValidISBN isbn_verifier_examples_test.go:7:1 + +real 0m0.003s +user 0m0.000s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.032s +user 0m0.017s +sys 0m0.030s + +real 0m0.033s +user 0m0.017s +sys 0m0.031s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out isbn +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.029s +user 0m0.034s +sys 0m0.010s + + + ============================================================================== + +Exit code: 0 + +real 0m0.040s +user 0m0.041s +sys 0m0.018s + +real 0m0.043s +user 0m0.043s +sys 0m0.018s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.025s +sys 0m0.025s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:24:03 Including rules: default +[gosec] 2023/09/07 00:24:03 Excluding rules: default +[gosec] 2023/09/07 00:24:03 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/isbn-verifier +[gosec] 2023/09/07 00:24:03 Checking package: isbn +[gosec] 2023/09/07 00:24:03 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/isbn-verifier/isbn_verifier.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 63 + Nosec : 0 + Issues : 0 + + +real 0m0.125s +user 0m0.123s +sys 0m0.127s + + + ============================================================================== + +Exit code: 0 + +real 0m0.175s +user 0m0.157s +sys 0m0.169s + +real 0m0.179s +user 0m0.160s +sys 0m0.171s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.034s +user 0m0.021s +sys 0m0.031s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestIsValidISBN === RUN TestIsValidISBN/valid_isbn === RUN TestIsValidISBN/invalid_isbn_check_digit @@ -58,33 +626,109 @@ go test -v -covermode=count -coverprofile coverage.out isbn --- PASS: ExampleIsValidISBN (0.00s) PASS coverage: 88.5% of statements -ok isbn 0.007s coverage: 88.5% of statements +ok isbn 0.003s coverage: 88.5% of statements -real 0m0.534s -user 0m0.614s -sys 0m0.414s +real 0m0.187s +user 0m0.248s +sys 0m0.162s -=============================================================================== - -go tool cover -func=coverage.out -isbn/isbn_verifier.go:11: IsValidISBN 88.5% -total: (statements) 88.5% - -real 0m0.202s -user 0m0.161s -sys 0m0.190s -=============================================================================== + ============================================================================== -go tool cover -html coverage.out -o coverage.html +Running: go tool cover -func=coverage.out -real 0m0.192s -user 0m0.165s -sys 0m0.178s +isbn/isbn_verifier.go:11: IsValidISBN 88.5% +total: (statements) 88.5% -=============================================================================== +real 0m0.047s +user 0m0.059s +sys 0m0.070s + + + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.045s +user 0m0.042s +sys 0m0.058s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +11 func IsValidISBN(isbn string) bool { +12 var sum int +13 +14 reStr := `^[0-9][0-9-]+([0-9]|X)$` +15 +16 match, error := regexp.MatchString(reStr, isbn) +17 +18 if error != nil { +19 MISS panic(error) +20 } +21 +22 if !match { +23 return false +24 } +25 +26 isbn = strings.ReplaceAll(isbn, "-", "") +27 +28 if len(isbn) == 0 || len(isbn) < 10 { +29 return false +30 } +31 +32 for i, r := range isbn { +33 if r == '-' { +34 MISS continue +35 } +36 +37 var n int +38 +39 if r == 'X' { +40 n = 10 +41 } else { +42 n, error = strconv.Atoi(string(r)) +43 +44 if error != nil { +45 MISS panic(error) +46 } +47 } +48 +49 d := 10 - i +50 +51 if d < 1 { +52 return false +53 } +54 +55 sum += n * d +56 } +57 +58 if sum%11 == 0 { +59 return true +60 } +61 +62 return false +63 } + + +real 0m0.018s +user 0m0.017s +sys 0m0.013s + +real 0m0.019s +user 0m0.017s +sys 0m0.013s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -go test -v -race -covermode=atomic isbn === RUN TestIsValidISBN === RUN TestIsValidISBN/valid_isbn === RUN TestIsValidISBN/invalid_isbn_check_digit @@ -105,7 +749,7 @@ go test -v -race -covermode=atomic isbn === RUN TestIsValidISBN/invalid_characters_are_not_ignored_after_checking_length === RUN TestIsValidISBN/invalid_characters_are_not_ignored_before_checking_length === RUN TestIsValidISBN/input_is_too_long_but_contains_a_valid_isbn ---- PASS: TestIsValidISBN (0.04s) +--- PASS: TestIsValidISBN (0.00s) --- PASS: TestIsValidISBN/valid_isbn (0.00s) --- PASS: TestIsValidISBN/invalid_isbn_check_digit (0.00s) --- PASS: TestIsValidISBN/valid_isbn_with_a_check_digit_of_10 (0.00s) @@ -129,97 +773,146 @@ go test -v -race -covermode=atomic isbn --- PASS: ExampleIsValidISBN (0.00s) PASS coverage: 88.5% of statements -ok isbn 0.080s coverage: 88.5% of statements +ok isbn 1.017s coverage: 88.5% of statements -real 0m0.678s -user 0m0.711s -sys 0m0.454s +real 0m1.228s +user 0m0.279s +sys 0m0.160s + + + ============================================================================== + +Exit code: 0 + +real 0m1.580s +user 0m0.675s +sys 0m0.512s + +real 0m1.583s +user 0m0.676s +sys 0m0.514s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: isbn -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkIsValidISBN-4 5523 220961 ns/op 80090 B/op 995 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkIsValidISBN +BenchmarkIsValidISBN-8 18230 62404 ns/op 79851 B/op 917 allocs/op PASS -ok isbn 2.083s +ok isbn 1.744s -real 0m2.593s -user 0m3.723s -sys 0m0.734s +real 0m1.897s +user 0m2.043s +sys 0m0.208s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestIsValidISBN +=== RUN TestIsValidISBN/valid_isbn +=== RUN TestIsValidISBN/invalid_isbn_check_digit +=== RUN TestIsValidISBN/valid_isbn_with_a_check_digit_of_10 +=== RUN TestIsValidISBN/check_digit_is_a_character_other_than_X +=== RUN TestIsValidISBN/invalid_check_digit_in_isbn_is_not_treated_as_zero +=== RUN TestIsValidISBN/invalid_character_in_isbn_is_not_treated_as_zero +=== RUN TestIsValidISBN/X_is_only_valid_as_a_check_digit +=== RUN TestIsValidISBN/valid_isbn_without_separating_dashes +=== RUN TestIsValidISBN/isbn_without_separating_dashes_and_X_as_check_digit +=== RUN TestIsValidISBN/isbn_without_check_digit_and_dashes +=== RUN TestIsValidISBN/too_long_isbn_and_no_dashes +=== RUN TestIsValidISBN/too_short_isbn +=== RUN TestIsValidISBN/isbn_without_check_digit +=== RUN TestIsValidISBN/check_digit_of_X_should_not_be_used_for_0 +=== RUN TestIsValidISBN/empty_isbn +=== RUN TestIsValidISBN/input_is_9_characters +=== RUN TestIsValidISBN/invalid_characters_are_not_ignored_after_checking_length +=== RUN TestIsValidISBN/invalid_characters_are_not_ignored_before_checking_length +=== RUN TestIsValidISBN/input_is_too_long_but_contains_a_valid_isbn +--- PASS: TestIsValidISBN (0.00s) + --- PASS: TestIsValidISBN/valid_isbn (0.00s) + --- PASS: TestIsValidISBN/invalid_isbn_check_digit (0.00s) + --- PASS: TestIsValidISBN/valid_isbn_with_a_check_digit_of_10 (0.00s) + --- PASS: TestIsValidISBN/check_digit_is_a_character_other_than_X (0.00s) + --- PASS: TestIsValidISBN/invalid_check_digit_in_isbn_is_not_treated_as_zero (0.00s) + --- PASS: TestIsValidISBN/invalid_character_in_isbn_is_not_treated_as_zero (0.00s) + --- PASS: TestIsValidISBN/X_is_only_valid_as_a_check_digit (0.00s) + --- PASS: TestIsValidISBN/valid_isbn_without_separating_dashes (0.00s) + --- PASS: TestIsValidISBN/isbn_without_separating_dashes_and_X_as_check_digit (0.00s) + --- PASS: TestIsValidISBN/isbn_without_check_digit_and_dashes (0.00s) + --- PASS: TestIsValidISBN/too_long_isbn_and_no_dashes (0.00s) + --- PASS: TestIsValidISBN/too_short_isbn (0.00s) + --- PASS: TestIsValidISBN/isbn_without_check_digit (0.00s) + --- PASS: TestIsValidISBN/check_digit_of_X_should_not_be_used_for_0 (0.00s) + --- PASS: TestIsValidISBN/empty_isbn (0.00s) + --- PASS: TestIsValidISBN/input_is_9_characters (0.00s) + --- PASS: TestIsValidISBN/invalid_characters_are_not_ignored_after_checking_length (0.00s) + --- PASS: TestIsValidISBN/invalid_characters_are_not_ignored_before_checking_length (0.00s) + --- PASS: TestIsValidISBN/input_is_too_long_but_contains_a_valid_isbn (0.00s) +=== RUN ExampleIsValidISBN +--- PASS: ExampleIsValidISBN (0.00s) PASS -ok isbn 0.006s +ok isbn 0.002s -real 0m0.520s -user 0m0.635s -sys 0m0.372s +real 0m0.126s +user 0m0.179s +sys 0m0.116s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m3.801s -user 0m0.730s -sys 0m0.340s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -IsValidISBN-4 231µs ± 0% 221µs ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -IsValidISBN-4 71.7kB ± 0% 80.1kB ± 0% ~ (p=1.000 n=1+1) - -name old allocs/op new allocs/op delta -IsValidISBN-4 899 ± 0% 995 ± 0% ~ (p=1.000 n=1+1) - -real 0m0.028s -user 0m0.015s -sys 0m0.011s - -=============================================================================== - -go vet isbn - -real 0m0.295s -user 0m0.365s -sys 0m0.218s - -=============================================================================== +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: isbn +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +IsValidISBN-8 62.40µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +IsValidISBN-8 77.98Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +IsValidISBN-8 917.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -go fix isbn +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +IsValidISBN-4 221.0µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.123s -user 0m0.072s -sys 0m0.149s + │ benchstat-old.txt │ + │ B/op │ +IsValidISBN-4 78.21Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ allocs/op │ +IsValidISBN-4 995.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./isbn-verifier -[gosec] 2022/07/24 00:37:28 Including rules: default -[gosec] 2022/07/24 00:37:28 Excluding rules: default -[gosec] 2022/07/24 00:37:28 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/isbn-verifier -2022/07/24 00:37:28 internal error: package "regexp" without types was imported from "command-line-arguments" - -real 0m0.361s -user 0m0.387s -sys 0m0.294s +real 0m0.003s +user 0m0.001s +sys 0m0.002s =============================================================================== gomarkdoc --output isbn-doc.md -real 0m0.030s -user 0m0.022s -sys 0m0.011s +real 0m0.009s +user 0m0.005s +sys 0m0.004s =============================================================================== @@ -234,9 +927,9 @@ func IsValidISBN(isbn string) bool IsValidISBN returns true if the book id number is valid. -real 0m0.169s -user 0m0.109s -sys 0m0.172s +real 0m0.035s +user 0m0.021s +sys 0m0.030s =============================================================================== diff --git a/go/isogram/benchstat-new.txt b/go/isogram/benchstat-new.txt index e701b6bb..6136fef0 100644 --- a/go/isogram/benchstat-new.txt +++ b/go/isogram/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: isogram -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkIsIsogram-4 13100 76355 ns/op 11375 B/op 190 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkIsIsogram +BenchmarkIsIsogram-8 68550 15683 ns/op 11596 B/op 190 allocs/op PASS -ok isogram 1.984s +ok isogram 1.266s diff --git a/go/isogram/benchstat-old.txt b/go/isogram/benchstat-old.txt new file mode 100644 index 00000000..e701b6bb --- /dev/null +++ b/go/isogram/benchstat-old.txt @@ -0,0 +1,7 @@ +goos: linux +goarch: amd64 +pkg: isogram +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkIsIsogram-4 13100 76355 ns/op 11375 B/op 190 allocs/op +PASS +ok isogram 1.984s diff --git a/go/isogram/coverage-annotations.txt b/go/isogram/coverage-annotations.txt new file mode 100644 index 00000000..7497b4ed --- /dev/null +++ b/go/isogram/coverage-annotations.txt @@ -0,0 +1,33 @@ + +11 func IsIsogram(word string) bool { +12 r, e := regexp.Compile(`[^a-z]`) +13 +14 if e != nil { +15 MISS panic(e) +16 } +17 +18 repl := func(match string) string { +19 if match == "-" || match == " " { +20 return "" +21 } +22 +23 return strings.ToLower(match) +24 } +25 +26 word = r.ReplaceAllStringFunc(word, repl) +27 +28 for i1, l1 := range word { +29 for i2, l2 := range word { +30 if i1 == i2 { +31 continue +32 } +33 +34 if l1 == l2 { +35 return false +36 } +37 } +38 } +39 +40 return true +41 } + diff --git a/go/isogram/coverage.out b/go/isogram/coverage.out index 0bcda6cc..b7e83aa0 100644 --- a/go/isogram/coverage.out +++ b/go/isogram/coverage.out @@ -1,14 +1,14 @@ mode: count isogram/isogram.go:11.34,14.14 2 20 -isogram/isogram.go:18.2,18.36 1 20 -isogram/isogram.go:26.2,28.27 2 20 -isogram/isogram.go:40.2,40.13 1 10 isogram/isogram.go:14.14,15.11 1 0 +isogram/isogram.go:18.2,18.36 1 20 isogram/isogram.go:18.36,19.35 1 17 -isogram/isogram.go:23.3,23.32 1 6 isogram/isogram.go:19.35,21.4 1 11 +isogram/isogram.go:23.3,23.32 1 6 +isogram/isogram.go:26.2,28.27 2 20 isogram/isogram.go:28.27,29.28 1 132 isogram/isogram.go:29.28,30.16 1 1806 -isogram/isogram.go:34.4,34.16 1 1674 isogram/isogram.go:30.16,31.13 1 132 +isogram/isogram.go:34.4,34.16 1 1674 isogram/isogram.go:34.16,36.5 1 10 +isogram/isogram.go:40.2,40.13 1 10 diff --git a/go/isogram/isogram-doc.md b/go/isogram/isogram-doc.md index 4d8ddb6e..b3148103 100755 --- a/go/isogram/isogram-doc.md +++ b/go/isogram/isogram-doc.md @@ -6,7 +6,7 @@ import "isogram" ``` -Package isogram Determines if a word or phrase is an isogram\. +Package isogram Determines if a word or phrase is an isogram. ## Index @@ -19,7 +19,7 @@ Package isogram Determines if a word or phrase is an isogram\. func IsIsogram(word string) bool ``` -IsIsogram returns true when a word is an isogram\. An isogram \(also known as a "non\-pattern word"\) is a word or phrase without a repeating letter\, however spaces and hyphens are allowed to appear multiple times\. +IsIsogram returns true when a word is an isogram. An isogram \(also known as a "non\-pattern word"\) is a word or phrase without a repeating letter, however spaces and hyphens are allowed to appear multiple times.

Example

diff --git a/go/isogram/isogram-doc.txt b/go/isogram/isogram-doc.txt index 8b0e19d1..d5ed279f 100644 --- a/go/isogram/isogram-doc.txt +++ b/go/isogram/isogram-doc.txt @@ -5,7 +5,7 @@ Package isogram Determines if a word or phrase is an isogram. FUNCTIONS func IsIsogram(word string) bool - IsIsogram returns true when a word is an isogram. An isogram (also known as - a "non-pattern word") is a word or phrase without a repeating letter, + IsIsogram returns true when a word is an isogram. An isogram (also known + as a "non-pattern word") is a word or phrase without a repeating letter, however spaces and hyphens are allowed to appear multiple times. diff --git a/go/isogram/run-tests-go.txt b/go/isogram/run-tests-go.txt index 033698a5..05c89617 100644 --- a/go/isogram/run-tests-go.txt +++ b/go/isogram/run-tests-go.txt @@ -5,15 +5,568 @@ Go packages: isogram =============================================================================== -golint isogram +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.020s +sys 0m0.031s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +isogram.go:12:10: regexpMust: for const patterns like `[^a-z]`, use regexp.MustCompile (gocritic) + r, e := regexp.Compile(`[^a-z]`) + ^ +isogram.go:10: line is 163 characters (lll) +// An isogram (also known as a "non-pattern word") is a word or phrase without a repeating letter, however spaces and hyphens are allowed to appear multiple times. +isogram_test.go:8:27: Using the variable on range scope `tc` in function literal (scopelint) + if actual := IsIsogram(tc.input); actual != tc.expected { + ^ +isogram_test.go:9:46: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("IsIsogram(%q) = %t, want: %t", tc.input, actual, tc.expected) + ^ +isogram_test.go:19:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +isogram_test.go:5:1: Function TestIsIsogram missing the call to method parallel (paralleltest) +func TestIsIsogram(t *testing.T) { +^ +isogram_test.go:6:2: Range statement for test TestIsIsogram missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +cases_test.go:1:9: package should be `isogram_test` instead of `isogram` (testpackage) +package isogram + ^ +isogram_examples_test.go:1:9: package should be `isogram_test` instead of `isogram` (testpackage) +package isogram + ^ +isogram_test.go:1:9: package should be `isogram_test` instead of `isogram` (testpackage) +package isogram + ^ +isogram.go:28:6: variable name 'l1' is too short for the scope of its usage (varnamelen) + for i1, l1 := range word { + ^ + +real 0m0.511s +user 0m0.787s +sys 0m0.457s + + + ============================================================================== + +Exit code: -1 + +real 0m0.554s +user 0m0.813s +sys 0m0.498s + +real 0m0.555s +user 0m0.813s +sys 0m0.500s -real 0m0.314s -user 0m0.353s -sys 0m0.358s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.014s +sys 0m0.015s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.043s +user 0m0.016s +sys 0m0.039s + + + ============================================================================== + +Exit code: 0 + +real 0m0.071s +user 0m0.035s +sys 0m0.064s + +real 0m0.073s +user 0m0.036s +sys 0m0.066s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.015s +sys 0m0.017s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "regexp" without types was imported from "isogram" + +real 0m0.082s +user 0m0.108s +sys 0m0.091s + + + ============================================================================== + +Exit code: -1 + +real 0m0.115s +user 0m0.131s +sys 0m0.116s + +real 0m0.116s +user 0m0.131s +sys 0m0.117s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.012s +sys 0m0.021s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.171s +user 0m0.208s +sys 0m0.162s + + + ============================================================================== + +Exit code: 0 + +real 0m0.205s +user 0m0.224s +sys 0m0.196s + +real 0m0.207s +user 0m0.225s +sys 0m0.197s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.018s +sys 0m0.025s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./isogram.go:12:10: regexpMust: for const patterns like `[^a-z]`, use regexp.MustCompile + +real 0m0.837s +user 0m2.005s +sys 0m0.293s + + + ============================================================================== + +Exit code: -1 + +real 0m0.876s +user 0m2.028s +sys 0m0.329s + +real 0m0.878s +user 0m2.029s +sys 0m0.329s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.014s +sys 0m0.015s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.076s +user 0m0.110s +sys 0m0.118s + + + ============================================================================== + +Exit code: 0 + +real 0m0.106s +user 0m0.132s +sys 0m0.140s + +real 0m0.108s +user 0m0.132s +sys 0m0.142s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.023s +sys 0m0.013s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.021s +user 0m0.020s +sys 0m0.013s + + + ============================================================================== + +Exit code: 0 + +real 0m0.052s +user 0m0.048s +sys 0m0.037s + +real 0m0.054s +user 0m0.048s +sys 0m0.038s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.013s +sys 0m0.020s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.469s +user 0m1.515s +sys 0m0.292s + + + ============================================================================== + +Exit code: 0 + +real 0m0.500s +user 0m1.534s +sys 0m0.319s + +real 0m0.503s +user 0m1.536s +sys 0m0.320s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out isogram +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.007s +sys 0m0.025s + + + ============================================================================== + +Running: gocyclo . + +8 isogram IsIsogram isogram.go:11:1 +4 isogram BenchmarkIsIsogram isogram_test.go:15:1 +3 isogram TestIsIsogram isogram_test.go:5:1 +2 isogram ExampleIsIsogram isogram_examples_test.go:7:1 + +real 0m0.002s +user 0m0.000s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.034s +user 0m0.016s +sys 0m0.034s + +real 0m0.036s +user 0m0.017s +sys 0m0.034s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.026s +user 0m0.025s +sys 0m0.012s + + + ============================================================================== + +Exit code: 0 + +real 0m0.037s +user 0m0.027s +sys 0m0.024s + +real 0m0.039s +user 0m0.028s +sys 0m0.024s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.012s +sys 0m0.021s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:24:09 Including rules: default +[gosec] 2023/09/07 00:24:09 Excluding rules: default +[gosec] 2023/09/07 00:24:09 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/isogram +[gosec] 2023/09/07 00:24:10 Checking package: isogram +[gosec] 2023/09/07 00:24:10 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/isogram/isogram.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 41 + Nosec : 0 + Issues : 0 + + +real 0m0.114s +user 0m0.113s +sys 0m0.123s + + + ============================================================================== + +Exit code: 0 + +real 0m0.149s +user 0m0.132s +sys 0m0.155s + +real 0m0.150s +user 0m0.132s +sys 0m0.156s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.039s +user 0m0.032s +sys 0m0.031s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestIsIsogram === RUN TestIsIsogram/empty_string === RUN TestIsIsogram/isogram_with_only_lower_case_characters @@ -48,33 +601,87 @@ go test -v -covermode=count -coverprofile coverage.out isogram --- PASS: ExampleIsIsogram (0.00s) PASS coverage: 93.3% of statements -ok isogram 0.010s coverage: 93.3% of statements +ok isogram 0.002s coverage: 93.3% of statements -real 0m1.120s -user 0m1.309s -sys 0m0.897s +real 0m0.165s +user 0m0.197s +sys 0m0.137s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + isogram/isogram.go:11: IsIsogram 93.3% total: (statements) 93.3% -real 0m0.348s -user 0m0.436s -sys 0m0.314s +real 0m0.045s +user 0m0.057s +sys 0m0.067s + -=============================================================================== + ============================================================================== -go tool cover -html coverage.out -o coverage.html +Running: go tool cover -html coverage.out -o coverage.html -real 0m0.499s -user 0m0.509s -sys 0m0.395s -=============================================================================== +real 0m0.051s +user 0m0.053s +sys 0m0.068s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +11 func IsIsogram(word string) bool { +12 r, e := regexp.Compile(`[^a-z]`) +13 +14 if e != nil { +15 MISS panic(e) +16 } +17 +18 repl := func(match string) string { +19 if match == "-" || match == " " { +20 return "" +21 } +22 +23 return strings.ToLower(match) +24 } +25 +26 word = r.ReplaceAllStringFunc(word, repl) +27 +28 for i1, l1 := range word { +29 for i2, l2 := range word { +30 if i1 == i2 { +31 continue +32 } +33 +34 if l1 == l2 { +35 return false +36 } +37 } +38 } +39 +40 return true +41 } + + +real 0m0.023s +user 0m0.020s +sys 0m0.019s + +real 0m0.023s +user 0m0.020s +sys 0m0.019s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -go test -v -race -covermode=atomic isogram === RUN TestIsIsogram === RUN TestIsIsogram/empty_string === RUN TestIsIsogram/isogram_with_only_lower_case_characters @@ -90,7 +697,7 @@ go test -v -race -covermode=atomic isogram === RUN TestIsIsogram/duplicated_character_in_the_middle === RUN TestIsIsogram/same_first_and_last_characters === RUN TestIsIsogram/word_with_duplicated_character_and_with_two_hyphens ---- PASS: TestIsIsogram (0.03s) +--- PASS: TestIsIsogram (0.00s) --- PASS: TestIsIsogram/empty_string (0.00s) --- PASS: TestIsIsogram/isogram_with_only_lower_case_characters (0.00s) --- PASS: TestIsIsogram/word_with_one_duplicated_character (0.00s) @@ -106,79 +713,139 @@ go test -v -race -covermode=atomic isogram --- PASS: TestIsIsogram/same_first_and_last_characters (0.00s) --- PASS: TestIsIsogram/word_with_duplicated_character_and_with_two_hyphens (0.00s) === RUN ExampleIsIsogram ---- PASS: ExampleIsIsogram (0.01s) +--- PASS: ExampleIsIsogram (0.00s) PASS coverage: 93.3% of statements -ok isogram 0.094s coverage: 93.3% of statements +ok isogram 1.016s coverage: 93.3% of statements + +real 0m1.236s +user 0m0.257s +sys 0m0.170s + + + ============================================================================== -real 0m1.551s -user 0m1.476s -sys 0m1.019s +Exit code: 0 + +real 0m1.583s +user 0m0.626s +sys 0m0.514s + +real 0m1.585s +user 0m0.626s +sys 0m0.516s =============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: isogram -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkIsIsogram-4 13100 76355 ns/op 11375 B/op 190 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkIsIsogram +BenchmarkIsIsogram-8 68550 15683 ns/op 11596 B/op 190 allocs/op PASS -ok isogram 1.984s +ok isogram 1.266s -real 0m2.859s -user 0m3.916s -sys 0m0.990s +real 0m1.424s +user 0m1.521s +sys 0m0.167s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestIsIsogram +=== RUN TestIsIsogram/empty_string +=== RUN TestIsIsogram/isogram_with_only_lower_case_characters +=== RUN TestIsIsogram/word_with_one_duplicated_character +=== RUN TestIsIsogram/word_with_one_duplicated_character_from_the_end_of_the_alphabet +=== RUN TestIsIsogram/longest_reported_english_isogram +=== RUN TestIsIsogram/word_with_duplicated_character_in_mixed_case +=== RUN TestIsIsogram/word_with_duplicated_character_in_mixed_case,_lowercase_first +=== RUN TestIsIsogram/hypothetical_isogrammic_word_with_hyphen +=== RUN TestIsIsogram/hypothetical_word_with_duplicated_character_following_hyphen +=== RUN TestIsIsogram/isogram_with_duplicated_hyphen +=== RUN TestIsIsogram/made-up_name_that_is_an_isogram +=== RUN TestIsIsogram/duplicated_character_in_the_middle +=== RUN TestIsIsogram/same_first_and_last_characters +=== RUN TestIsIsogram/word_with_duplicated_character_and_with_two_hyphens +--- PASS: TestIsIsogram (0.00s) + --- PASS: TestIsIsogram/empty_string (0.00s) + --- PASS: TestIsIsogram/isogram_with_only_lower_case_characters (0.00s) + --- PASS: TestIsIsogram/word_with_one_duplicated_character (0.00s) + --- PASS: TestIsIsogram/word_with_one_duplicated_character_from_the_end_of_the_alphabet (0.00s) + --- PASS: TestIsIsogram/longest_reported_english_isogram (0.00s) + --- PASS: TestIsIsogram/word_with_duplicated_character_in_mixed_case (0.00s) + --- PASS: TestIsIsogram/word_with_duplicated_character_in_mixed_case,_lowercase_first (0.00s) + --- PASS: TestIsIsogram/hypothetical_isogrammic_word_with_hyphen (0.00s) + --- PASS: TestIsIsogram/hypothetical_word_with_duplicated_character_following_hyphen (0.00s) + --- PASS: TestIsIsogram/isogram_with_duplicated_hyphen (0.00s) + --- PASS: TestIsIsogram/made-up_name_that_is_an_isogram (0.00s) + --- PASS: TestIsIsogram/duplicated_character_in_the_middle (0.00s) + --- PASS: TestIsIsogram/same_first_and_last_characters (0.00s) + --- PASS: TestIsIsogram/word_with_duplicated_character_and_with_two_hyphens (0.00s) +=== RUN ExampleIsIsogram +--- PASS: ExampleIsIsogram (0.00s) PASS -ok isogram 0.005s - -real 0m1.191s -user 0m1.161s -sys 0m0.626s - -=============================================================================== - -No old benchmarks to run benchstat against. - -=============================================================================== +ok isogram 0.002s -go vet isogram - -real 0m0.596s -user 0m0.754s -sys 0m0.570s +real 0m0.133s +user 0m0.181s +sys 0m0.123s =============================================================================== -go fix isogram +benchstat benchstat-old.txt benchstat-new.txt +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: isogram +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +IsIsogram-8 15.68µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +IsIsogram-8 11.32Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +IsIsogram-8 190.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.217s -user 0m0.238s -sys 0m0.193s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +IsIsogram-4 76.36µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +IsIsogram-4 11.11Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./isogram -[gosec] 2022/07/27 12:27:07 Including rules: default -[gosec] 2022/07/27 12:27:07 Excluding rules: default -[gosec] 2022/07/27 12:27:07 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/isogram -2022/07/27 12:27:08 internal error: package "regexp" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +IsIsogram-4 190.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.595s -user 0m0.630s -sys 0m0.427s +real 0m0.003s +user 0m0.000s +sys 0m0.003s =============================================================================== gomarkdoc --output isogram-doc.md -real 0m0.045s -user 0m0.032s -sys 0m0.024s +real 0m0.009s +user 0m0.003s +sys 0m0.006s =============================================================================== @@ -190,14 +857,14 @@ Package isogram Determines if a word or phrase is an isogram. FUNCTIONS func IsIsogram(word string) bool - IsIsogram returns true when a word is an isogram. An isogram (also known as - a "non-pattern word") is a word or phrase without a repeating letter, + IsIsogram returns true when a word is an isogram. An isogram (also known + as a "non-pattern word") is a word or phrase without a repeating letter, however spaces and hyphens are allowed to appear multiple times. -real 0m0.421s -user 0m0.287s -sys 0m0.313s +real 0m0.037s +user 0m0.026s +sys 0m0.028s =============================================================================== diff --git a/go/largest-series-product/benchstat-new.txt b/go/largest-series-product/benchstat-new.txt index aa1b9fac..084bee82 100644 --- a/go/largest-series-product/benchstat-new.txt +++ b/go/largest-series-product/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: lsproduct -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkLargestSeriesProduct-4 5664 249738 ns/op 72955 B/op 1619 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkLargestSeriesProduct +BenchmarkLargestSeriesProduct-8 18795 63192 ns/op 71693 B/op 1226 allocs/op PASS -ok lsproduct 2.347s +ok lsproduct 1.837s diff --git a/go/largest-series-product/benchstat-old.txt b/go/largest-series-product/benchstat-old.txt new file mode 100644 index 00000000..aa1b9fac --- /dev/null +++ b/go/largest-series-product/benchstat-old.txt @@ -0,0 +1,7 @@ +goos: linux +goarch: amd64 +pkg: lsproduct +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkLargestSeriesProduct-4 5664 249738 ns/op 72955 B/op 1619 allocs/op +PASS +ok lsproduct 2.347s diff --git a/go/largest-series-product/coverage-annotations.txt b/go/largest-series-product/coverage-annotations.txt new file mode 100644 index 00000000..d5fc3378 --- /dev/null +++ b/go/largest-series-product/coverage-annotations.txt @@ -0,0 +1,71 @@ + +13 func LargestSeriesProduct(digits string, span int) (int64, error) { +14 if span < 0 { +15 return 0, errors.New("span must not be negative") +16 } +17 +18 if span > len(digits) { +19 return 0, errors.New("span must be smaller than string length") +20 } +21 +22 if len(digits) == 0 { +23 return 1, nil +24 } +25 +26 if span == 0 && len(digits) > 0 { +27 return 1, nil +28 } +29 +30 match, e := regexp.MatchString(`^[[:digit:]]+$`, digits) +31 if e != nil { +32 MISS return 0, e +33 } +34 if !match { +35 return 0, errors.New("digits input must only contain digits") +36 } +37 +38 match, e = regexp.MatchString(`^0+$`, digits) +39 if e != nil { +40 MISS return 0, e +41 } +42 if match { +43 return 0, nil +44 } +45 +46 match, e = regexp.MatchString(`^1+$`, digits) +47 if e != nil { +48 MISS return 0, e +49 } +50 if match { +51 MISS return 1, nil +52 } +53 +54 var result int64 +55 for len(digits) >= span { +56 numbers := []int64{} +57 +58 for _, digit := range digits[:span] { +59 number, e := strconv.Atoi(string(digit)) +60 if e != nil { +61 MISS return 0, e +62 } +63 +64 numbers = append(numbers, int64(number)) +65 } +66 +67 digits = digits[1:] +68 +69 var product int64 = 1 +70 +71 for _, n := range numbers { +72 product *= n +73 } +74 +75 if product > result { +76 result = product +77 } +78 } +79 +80 return result, nil +81 } + diff --git a/go/largest-series-product/coverage.html b/go/largest-series-product/coverage.html index 44bb028d..3cc97204 100644 --- a/go/largest-series-product/coverage.html +++ b/go/largest-series-product/coverage.html @@ -107,43 +107,47 @@ return 1, nil } - m, e := regexp.MatchString(`^[[:digit:]]+$`, digits) + match, e := regexp.MatchString(`^[[:digit:]]+$`, digits) if e != nil { return 0, e } - if !m { + if !match { return 0, errors.New("digits input must only contain digits") } - m, e = regexp.MatchString(`^0+$`, digits) + match, e = regexp.MatchString(`^0+$`, digits) if e != nil { return 0, e } - if m { + if match { return 0, nil } - m, e = regexp.MatchString(`^1+$`, digits) + match, e = regexp.MatchString(`^1+$`, digits) if e != nil { return 0, e } - if m { + if match { return 1, nil } var result int64 for len(digits) >= span { numbers := []int64{} + for _, digit := range digits[:span] { number, e := strconv.Atoi(string(digit)) if e != nil { return 0, e } + numbers = append(numbers, int64(number)) } + digits = digits[1:] var product int64 = 1 + for _, n := range numbers { product *= n } diff --git a/go/largest-series-product/coverage.out b/go/largest-series-product/coverage.out index 3cbff24c..145f7bfc 100644 --- a/go/largest-series-product/coverage.out +++ b/go/largest-series-product/coverage.out @@ -1,31 +1,31 @@ mode: count lsproduct/largest_series_product.go:13.67,14.14 1 16 -lsproduct/largest_series_product.go:18.2,18.24 1 15 -lsproduct/largest_series_product.go:22.2,22.22 1 13 -lsproduct/largest_series_product.go:26.2,26.34 1 12 -lsproduct/largest_series_product.go:30.2,31.14 2 11 -lsproduct/largest_series_product.go:34.2,34.8 1 11 -lsproduct/largest_series_product.go:38.2,39.14 2 10 -lsproduct/largest_series_product.go:42.2,42.7 1 10 -lsproduct/largest_series_product.go:46.2,47.14 2 9 -lsproduct/largest_series_product.go:50.2,50.7 1 9 -lsproduct/largest_series_product.go:54.2,55.26 2 9 -lsproduct/largest_series_product.go:76.2,76.20 1 9 lsproduct/largest_series_product.go:14.14,16.3 1 1 +lsproduct/largest_series_product.go:18.2,18.24 1 15 lsproduct/largest_series_product.go:18.24,20.3 1 2 +lsproduct/largest_series_product.go:22.2,22.22 1 13 lsproduct/largest_series_product.go:22.22,24.3 1 1 +lsproduct/largest_series_product.go:26.2,26.34 1 12 lsproduct/largest_series_product.go:26.34,28.3 1 1 +lsproduct/largest_series_product.go:30.2,31.14 2 11 lsproduct/largest_series_product.go:31.14,33.3 1 0 -lsproduct/largest_series_product.go:34.8,36.3 1 1 +lsproduct/largest_series_product.go:34.2,34.12 1 11 +lsproduct/largest_series_product.go:34.12,36.3 1 1 +lsproduct/largest_series_product.go:38.2,39.14 2 10 lsproduct/largest_series_product.go:39.14,41.3 1 0 -lsproduct/largest_series_product.go:42.7,44.3 1 1 +lsproduct/largest_series_product.go:42.2,42.11 1 10 +lsproduct/largest_series_product.go:42.11,44.3 1 1 +lsproduct/largest_series_product.go:46.2,47.14 2 9 lsproduct/largest_series_product.go:47.14,49.3 1 0 -lsproduct/largest_series_product.go:50.7,52.3 1 0 -lsproduct/largest_series_product.go:55.26,57.39 2 96 -lsproduct/largest_series_product.go:64.3,67.29 3 96 -lsproduct/largest_series_product.go:71.3,71.23 1 96 -lsproduct/largest_series_product.go:57.39,59.16 2 417 -lsproduct/largest_series_product.go:62.4,62.44 1 417 -lsproduct/largest_series_product.go:59.16,61.5 1 0 -lsproduct/largest_series_product.go:67.29,69.4 1 417 -lsproduct/largest_series_product.go:71.23,73.4 1 40 +lsproduct/largest_series_product.go:50.2,50.11 1 9 +lsproduct/largest_series_product.go:50.11,52.3 1 0 +lsproduct/largest_series_product.go:54.2,55.26 2 9 +lsproduct/largest_series_product.go:55.26,58.39 2 96 +lsproduct/largest_series_product.go:58.39,60.16 2 417 +lsproduct/largest_series_product.go:60.16,62.5 1 0 +lsproduct/largest_series_product.go:64.4,64.44 1 417 +lsproduct/largest_series_product.go:67.3,71.29 3 96 +lsproduct/largest_series_product.go:71.29,73.4 1 417 +lsproduct/largest_series_product.go:75.3,75.23 1 96 +lsproduct/largest_series_product.go:75.23,77.4 1 40 +lsproduct/largest_series_product.go:80.2,80.20 1 9 diff --git a/go/largest-series-product/lsproduct-doc.md b/go/largest-series-product/lsproduct-doc.md index d7be8e06..b5e29883 100755 --- a/go/largest-series-product/lsproduct-doc.md +++ b/go/largest-series-product/lsproduct-doc.md @@ -6,7 +6,7 @@ import "lsproduct" ``` -Package lsproduct is used to calculate the largest product from a series of numbers\. +Package lsproduct is used to calculate the largest product from a series of numbers. ## Index @@ -19,7 +19,7 @@ Package lsproduct is used to calculate the largest product from a series of numb func LargestSeriesProduct(digits string, span int) (int64, error) ``` -LargestSeriesProduct returns the largest product for a contiguous substring of digits of length n\. +LargestSeriesProduct returns the largest product for a contiguous substring of digits of length n.

Example

diff --git a/go/largest-series-product/run-tests-go.txt b/go/largest-series-product/run-tests-go.txt index c210502c..d732662e 100644 --- a/go/largest-series-product/run-tests-go.txt +++ b/go/largest-series-product/run-tests-go.txt @@ -5,15 +5,605 @@ Go packages: lsproduct =============================================================================== -golint lsproduct +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.015s +sys 0m0.020s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +largest_series_product_test.go:32:24: Error return value is not checked (errcheck) + LargestSeriesProduct(test.digits, test.span) + ^ +largest_series_product.go:13: Function 'LargestSeriesProduct' is too long (67 > 60) (funlen) +func LargestSeriesProduct(digits string, span int) (int64, error) { +largest_series_product_test.go:8:40: Using the variable on range scope `tc` in function literal (scopelint) + actual, err := LargestSeriesProduct(tc.digits, tc.span) + ^ +largest_series_product_test.go:9:7: Using the variable on range scope `tc` in function literal (scopelint) + if tc.error == "" { + ^ +largest_series_product_test.go:12:76: Using the variable on range scope `tc` in function literal (scopelint) + t.Errorf("LargestSeriesProduct(%q, %d) returned error: %v\nwant: %d", tc.digits, tc.span, err, tc.expected) + ^ +largest_series_product.go:34:2: if statements should only be cuddled with assignments (wsl) + if !match { + ^ +largest_series_product.go:42:2: if statements should only be cuddled with assignments (wsl) + if match { + ^ +largest_series_product.go:50:2: if statements should only be cuddled with assignments (wsl) + if match { + ^ +largest_series_product.go:55:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for len(digits) >= span { + ^ +largest_series_product_test.go:30:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +largest_series_product.go:15:13: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"span must not be negative\")" (goerr113) + return 0, errors.New("span must not be negative") + ^ +largest_series_product.go:19:13: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"span must be smaller than string length\")" (goerr113) + return 0, errors.New("span must be smaller than string length") + ^ +largest_series_product.go:35:13: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"digits input must only contain digits\")" (goerr113) + return 0, errors.New("digits input must only contain digits") + ^ +largest_series_product_test.go:5:1: Function TestLargestSeriesProduct missing the call to method parallel (paralleltest) +func TestLargestSeriesProduct(t *testing.T) { +^ +largest_series_product_test.go:6:2: Range statement for test TestLargestSeriesProduct missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +cases_test.go:1:9: package should be `lsproduct_test` instead of `lsproduct` (testpackage) +package lsproduct + ^ +largest_series_product_examples_test.go:1:9: package should be `lsproduct_test` instead of `lsproduct` (testpackage) +package lsproduct + ^ +largest_series_product_test.go:1:9: package should be `lsproduct_test` instead of `lsproduct` (testpackage) +package lsproduct + ^ +largest_series_product.go:30:2: variable name 'e' is too short for the scope of its usage (varnamelen) + match, e := regexp.MatchString(`^[[:digit:]]+$`, digits) + ^ +largest_series_product.go:32:13: error returned from external package is unwrapped: sig: func regexp.MatchString(pattern string, s string) (matched bool, err error) (wrapcheck) + return 0, e + ^ +largest_series_product.go:40:13: error returned from external package is unwrapped: sig: func regexp.MatchString(pattern string, s string) (matched bool, err error) (wrapcheck) + return 0, e + ^ +largest_series_product.go:48:13: error returned from external package is unwrapped: sig: func regexp.MatchString(pattern string, s string) (matched bool, err error) (wrapcheck) + return 0, e + ^ +largest_series_product.go:61:15: error returned from external package is unwrapped: sig: func strconv.Atoi(s string) (int, error) (wrapcheck) + return 0, e + ^ + +real 0m0.562s +user 0m0.775s +sys 0m0.531s + + + ============================================================================== + +Exit code: -1 + +real 0m0.596s +user 0m0.799s +sys 0m0.556s + +real 0m0.598s +user 0m0.801s +sys 0m0.556s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.019s +sys 0m0.014s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.060s +user 0m0.036s +sys 0m0.038s + + + ============================================================================== + +Exit code: 0 + +real 0m0.091s +user 0m0.060s +sys 0m0.063s + +real 0m0.094s +user 0m0.061s +sys 0m0.064s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.015s +sys 0m0.017s -real 0m0.162s -user 0m0.152s -sys 0m0.155s + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "errors" without types was imported from "lsproduct" + +real 0m0.076s +user 0m0.109s +sys 0m0.080s + + + ============================================================================== + +Exit code: -1 + +real 0m0.109s +user 0m0.130s +sys 0m0.109s + +real 0m0.112s +user 0m0.133s +sys 0m0.109s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out lsproduct +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.015s +sys 0m0.024s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.190s +user 0m0.221s +sys 0m0.127s + + + ============================================================================== + +Exit code: 0 + +real 0m0.225s +user 0m0.240s +sys 0m0.162s + +real 0m0.227s +user 0m0.241s +sys 0m0.163s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.016s +sys 0m0.017s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./largest_series_product.go:22:5: emptyStringTest: replace `len(digits) == 0` with `digits == ""` + +real 0m0.835s +user 0m1.965s +sys 0m0.284s + + + ============================================================================== + +Exit code: -1 + +real 0m0.876s +user 0m1.992s +sys 0m0.317s + +real 0m0.879s +user 0m1.993s +sys 0m0.319s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.020s +sys 0m0.012s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.077s +user 0m0.118s +sys 0m0.084s + + + ============================================================================== + +Exit code: 0 + +real 0m0.105s +user 0m0.143s +sys 0m0.105s + +real 0m0.107s +user 0m0.143s +sys 0m0.107s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.012s +sys 0m0.022s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.027s +user 0m0.020s +sys 0m0.026s + + + ============================================================================== + +Exit code: 0 + +real 0m0.062s +user 0m0.038s +sys 0m0.059s + +real 0m0.063s +user 0m0.039s +sys 0m0.060s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.018s +sys 0m0.033s + + + ============================================================================== + +Running: errcheck ./... + +largest_series_product_test.go:32:24: LargestSeriesProduct(test.digits, test.span) + +real 0m0.469s +user 0m1.394s +sys 0m0.311s + + + ============================================================================== + +Exit code: -1 + +real 0m0.510s +user 0m1.414s +sys 0m0.356s + +real 0m0.512s +user 0m1.414s +sys 0m0.358s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.016s +sys 0m0.015s + + + ============================================================================== + +Running: gocyclo . + +17 lsproduct LargestSeriesProduct largest_series_product.go:13:1 +6 lsproduct TestLargestSeriesProduct largest_series_product_test.go:5:1 +4 lsproduct BenchmarkLargestSeriesProduct largest_series_product_test.go:26:1 +1 lsproduct ExampleLargestSeriesProduct largest_series_product_examples_test.go:7:1 + +real 0m0.004s +user 0m0.004s +sys 0m0.000s + + + ============================================================================== + +Exit code: 0 + +real 0m0.036s +user 0m0.027s +sys 0m0.023s + +real 0m0.038s +user 0m0.028s +sys 0m0.024s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.028s +user 0m0.030s +sys 0m0.014s + + + ============================================================================== + +Exit code: 0 + +real 0m0.041s +user 0m0.037s +sys 0m0.026s + +real 0m0.045s +user 0m0.039s +sys 0m0.027s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.021s +sys 0m0.022s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:24:16 Including rules: default +[gosec] 2023/09/07 00:24:16 Excluding rules: default +[gosec] 2023/09/07 00:24:16 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/largest-series-product +[gosec] 2023/09/07 00:24:16 Checking package: lsproduct +[gosec] 2023/09/07 00:24:16 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/largest-series-product/largest_series_product.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 81 + Nosec : 0 + Issues : 0 + + +real 0m0.106s +user 0m0.115s +sys 0m0.093s + + + ============================================================================== + +Exit code: 0 + +real 0m0.151s +user 0m0.145s +sys 0m0.129s + +real 0m0.153s +user 0m0.145s +sys 0m0.132s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.014s +sys 0m0.020s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestLargestSeriesProduct === RUN TestLargestSeriesProduct/finds_the_largest_product_if_span_equals_length === RUN TestLargestSeriesProduct/can_find_the_largest_product_of_2_with_numbers_in_order @@ -50,33 +640,125 @@ go test -v -covermode=count -coverprofile coverage.out lsproduct --- PASS: ExampleLargestSeriesProduct (0.00s) PASS coverage: 86.8% of statements -ok lsproduct 0.039s coverage: 86.8% of statements +ok lsproduct 0.003s coverage: 86.8% of statements -real 0m0.687s -user 0m0.764s -sys 0m0.536s +real 0m0.177s +user 0m0.269s +sys 0m0.153s -=============================================================================== -go tool cover -func=coverage.out -lsproduct/largest_series_product.go:13: LargestSeriesProduct 86.8% -total: (statements) 86.8% + ============================================================================== -real 0m0.274s -user 0m0.228s -sys 0m0.224s +Running: go tool cover -func=coverage.out -=============================================================================== - -go tool cover -html coverage.out -o coverage.html - -real 0m0.207s -user 0m0.212s -sys 0m0.210s +lsproduct/largest_series_product.go:13: LargestSeriesProduct 86.8% +total: (statements) 86.8% -=============================================================================== +real 0m0.053s +user 0m0.069s +sys 0m0.078s + + + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.054s +user 0m0.067s +sys 0m0.066s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +13 func LargestSeriesProduct(digits string, span int) (int64, error) { +14 if span < 0 { +15 return 0, errors.New("span must not be negative") +16 } +17 +18 if span > len(digits) { +19 return 0, errors.New("span must be smaller than string length") +20 } +21 +22 if len(digits) == 0 { +23 return 1, nil +24 } +25 +26 if span == 0 && len(digits) > 0 { +27 return 1, nil +28 } +29 +30 match, e := regexp.MatchString(`^[[:digit:]]+$`, digits) +31 if e != nil { +32 MISS return 0, e +33 } +34 if !match { +35 return 0, errors.New("digits input must only contain digits") +36 } +37 +38 match, e = regexp.MatchString(`^0+$`, digits) +39 if e != nil { +40 MISS return 0, e +41 } +42 if match { +43 return 0, nil +44 } +45 +46 match, e = regexp.MatchString(`^1+$`, digits) +47 if e != nil { +48 MISS return 0, e +49 } +50 if match { +51 MISS return 1, nil +52 } +53 +54 var result int64 +55 for len(digits) >= span { +56 numbers := []int64{} +57 +58 for _, digit := range digits[:span] { +59 number, e := strconv.Atoi(string(digit)) +60 if e != nil { +61 MISS return 0, e +62 } +63 +64 numbers = append(numbers, int64(number)) +65 } +66 +67 digits = digits[1:] +68 +69 var product int64 = 1 +70 +71 for _, n := range numbers { +72 product *= n +73 } +74 +75 if product > result { +76 result = product +77 } +78 } +79 +80 return result, nil +81 } + + +real 0m0.020s +user 0m0.015s +sys 0m0.021s + +real 0m0.021s +user 0m0.015s +sys 0m0.021s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -go test -v -race -covermode=atomic lsproduct === RUN TestLargestSeriesProduct === RUN TestLargestSeriesProduct/finds_the_largest_product_if_span_equals_length === RUN TestLargestSeriesProduct/can_find_the_largest_product_of_2_with_numbers_in_order @@ -93,7 +775,7 @@ go test -v -race -covermode=atomic lsproduct === RUN TestLargestSeriesProduct/rejects_empty_string_and_nonzero_span === RUN TestLargestSeriesProduct/rejects_invalid_character_in_digits === RUN TestLargestSeriesProduct/rejects_negative_span ---- PASS: TestLargestSeriesProduct (0.02s) +--- PASS: TestLargestSeriesProduct (0.00s) --- PASS: TestLargestSeriesProduct/finds_the_largest_product_if_span_equals_length (0.00s) --- PASS: TestLargestSeriesProduct/can_find_the_largest_product_of_2_with_numbers_in_order (0.00s) --- PASS: TestLargestSeriesProduct/can_find_the_largest_product_of_2 (0.00s) @@ -110,79 +792,141 @@ go test -v -race -covermode=atomic lsproduct --- PASS: TestLargestSeriesProduct/rejects_invalid_character_in_digits (0.00s) --- PASS: TestLargestSeriesProduct/rejects_negative_span (0.00s) === RUN ExampleLargestSeriesProduct ---- PASS: ExampleLargestSeriesProduct (0.01s) +--- PASS: ExampleLargestSeriesProduct (0.00s) PASS coverage: 86.8% of statements -ok lsproduct 0.085s coverage: 86.8% of statements +ok lsproduct 1.019s coverage: 86.8% of statements + +real 0m1.254s +user 0m0.307s +sys 0m0.196s + -real 0m0.858s -user 0m0.919s -sys 0m0.649s + ============================================================================== + +Exit code: 0 + +real 0m1.592s +user 0m0.749s +sys 0m0.546s + +real 0m1.595s +user 0m0.750s +sys 0m0.547s =============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: lsproduct -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkLargestSeriesProduct-4 5664 249738 ns/op 72955 B/op 1619 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkLargestSeriesProduct +BenchmarkLargestSeriesProduct-8 18795 63192 ns/op 71693 B/op 1226 allocs/op PASS -ok lsproduct 2.347s +ok lsproduct 1.837s -real 0m2.953s -user 0m4.142s -sys 0m0.826s +real 0m1.998s +user 0m2.124s +sys 0m0.222s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestLargestSeriesProduct +=== RUN TestLargestSeriesProduct/finds_the_largest_product_if_span_equals_length +=== RUN TestLargestSeriesProduct/can_find_the_largest_product_of_2_with_numbers_in_order +=== RUN TestLargestSeriesProduct/can_find_the_largest_product_of_2 +=== RUN TestLargestSeriesProduct/can_find_the_largest_product_of_3_with_numbers_in_order +=== RUN TestLargestSeriesProduct/can_find_the_largest_product_of_3 +=== RUN TestLargestSeriesProduct/can_find_the_largest_product_of_5_with_numbers_in_order +=== RUN TestLargestSeriesProduct/can_get_the_largest_product_of_a_big_number +=== RUN TestLargestSeriesProduct/reports_zero_if_the_only_digits_are_zero +=== RUN TestLargestSeriesProduct/reports_zero_if_all_spans_include_zero +=== RUN TestLargestSeriesProduct/rejects_span_longer_than_string_length +=== RUN TestLargestSeriesProduct/reports_1_for_empty_string_and_empty_product_(0_span) +=== RUN TestLargestSeriesProduct/reports_1_for_nonempty_string_and_empty_product_(0_span) +=== RUN TestLargestSeriesProduct/rejects_empty_string_and_nonzero_span +=== RUN TestLargestSeriesProduct/rejects_invalid_character_in_digits +=== RUN TestLargestSeriesProduct/rejects_negative_span +--- PASS: TestLargestSeriesProduct (0.00s) + --- PASS: TestLargestSeriesProduct/finds_the_largest_product_if_span_equals_length (0.00s) + --- PASS: TestLargestSeriesProduct/can_find_the_largest_product_of_2_with_numbers_in_order (0.00s) + --- PASS: TestLargestSeriesProduct/can_find_the_largest_product_of_2 (0.00s) + --- PASS: TestLargestSeriesProduct/can_find_the_largest_product_of_3_with_numbers_in_order (0.00s) + --- PASS: TestLargestSeriesProduct/can_find_the_largest_product_of_3 (0.00s) + --- PASS: TestLargestSeriesProduct/can_find_the_largest_product_of_5_with_numbers_in_order (0.00s) + --- PASS: TestLargestSeriesProduct/can_get_the_largest_product_of_a_big_number (0.00s) + --- PASS: TestLargestSeriesProduct/reports_zero_if_the_only_digits_are_zero (0.00s) + --- PASS: TestLargestSeriesProduct/reports_zero_if_all_spans_include_zero (0.00s) + --- PASS: TestLargestSeriesProduct/rejects_span_longer_than_string_length (0.00s) + --- PASS: TestLargestSeriesProduct/reports_1_for_empty_string_and_empty_product_(0_span) (0.00s) + --- PASS: TestLargestSeriesProduct/reports_1_for_nonempty_string_and_empty_product_(0_span) (0.00s) + --- PASS: TestLargestSeriesProduct/rejects_empty_string_and_nonzero_span (0.00s) + --- PASS: TestLargestSeriesProduct/rejects_invalid_character_in_digits (0.00s) + --- PASS: TestLargestSeriesProduct/rejects_negative_span (0.00s) +=== RUN ExampleLargestSeriesProduct +--- PASS: ExampleLargestSeriesProduct (0.00s) PASS -ok lsproduct 0.007s - -real 0m0.494s -user 0m0.563s -sys 0m0.410s - -=============================================================================== - -No old benchmarks to run benchstat against. - -=============================================================================== +ok lsproduct 0.002s -go vet lsproduct - -real 0m0.512s -user 0m0.533s -sys 0m0.392s +real 0m0.136s +user 0m0.180s +sys 0m0.132s =============================================================================== -go fix lsproduct +benchstat benchstat-old.txt benchstat-new.txt +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: lsproduct +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +LargestSeriesProduct-8 63.19µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +LargestSeriesProduct-8 70.01Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +LargestSeriesProduct-8 1.226k ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.132s -user 0m0.122s -sys 0m0.147s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +LargestSeriesProduct-4 249.7µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +LargestSeriesProduct-4 71.25Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./largest-series-product -[gosec] 2022/07/19 23:05:55 Including rules: default -[gosec] 2022/07/19 23:05:55 Excluding rules: default -[gosec] 2022/07/19 23:05:55 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/largest-series-product -2022/07/19 23:05:55 internal error: package "errors" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +LargestSeriesProduct-4 1.619k ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.433s -user 0m0.458s -sys 0m0.329s +real 0m0.003s +user 0m0.000s +sys 0m0.003s =============================================================================== gomarkdoc --output lsproduct-doc.md -real 0m0.026s -user 0m0.019s -sys 0m0.012s +real 0m0.008s +user 0m0.003s +sys 0m0.005s =============================================================================== @@ -199,9 +943,9 @@ func LargestSeriesProduct(digits string, span int) (int64, error) of digits of length n. -real 0m0.206s -user 0m0.193s -sys 0m0.212s +real 0m0.033s +user 0m0.020s +sys 0m0.027s =============================================================================== diff --git a/go/lasagna-master/benchstat-new.txt b/go/lasagna-master/benchstat-new.txt new file mode 100644 index 00000000..ac3eb903 --- /dev/null +++ b/go/lasagna-master/benchstat-new.txt @@ -0,0 +1,2 @@ +PASS +ok lasagna 0.002s diff --git a/go/lasagna-master/coverage-annotations.txt b/go/lasagna-master/coverage-annotations.txt new file mode 100644 index 00000000..5a7c18ca --- /dev/null +++ b/go/lasagna-master/coverage-annotations.txt @@ -0,0 +1,9 @@ + +32 func AddSecretIngredient(friendList []string, myList []string) { +33 if myList[len(myList)-1] == "?" { +34 myList[len(myList)-1] = friendList[len(friendList)-1] +35 } else { +36 MISS panic("You already know the secret ingredient!") +37 } +38 } + diff --git a/go/lasagna-master/coverage.html b/go/lasagna-master/coverage.html new file mode 100644 index 00000000..7c73c4d3 --- /dev/null +++ b/go/lasagna-master/coverage.html @@ -0,0 +1,175 @@ + + + + + + lasagna: Go Coverage Report + + + +

+ +
+ not tracked + + no coverage + low coverage + * + * + * + * + * + * + * + * + high coverage + +
+
+
+ + + +
+ + + diff --git a/go/lasagna-master/coverage.out b/go/lasagna-master/coverage.out index 691ccdfd..cc1a6066 100644 --- a/go/lasagna-master/coverage.out +++ b/go/lasagna-master/coverage.out @@ -1,22 +1,22 @@ mode: count lasagna/lasagna_master.go:5.60,6.22 1 5 -lasagna/lasagna_master.go:10.2,10.34 1 5 lasagna/lasagna_master.go:6.22,8.3 1 2 +lasagna/lasagna_master.go:10.2,10.34 1 5 lasagna/lasagna_master.go:15.49,19.31 3 5 -lasagna/lasagna_master.go:27.2,27.23 1 5 lasagna/lasagna_master.go:19.31,20.25 1 31 lasagna/lasagna_master.go:20.25,22.4 1 9 lasagna/lasagna_master.go:22.9,22.30 1 22 lasagna/lasagna_master.go:22.30,24.4 1 7 +lasagna/lasagna_master.go:27.2,27.23 1 5 lasagna/lasagna_master.go:32.64,33.34 1 2 lasagna/lasagna_master.go:33.34,35.3 1 2 lasagna/lasagna_master.go:35.8,36.51 1 0 lasagna/lasagna_master.go:42.64,45.35 2 9 -lasagna/lasagna_master.go:62.2,62.22 1 9 lasagna/lasagna_master.go:45.35,47.3 1 1 lasagna/lasagna_master.go:47.8,49.39 1 8 -lasagna/lasagna_master.go:53.3,53.20 1 8 lasagna/lasagna_master.go:49.39,51.4 1 29 +lasagna/lasagna_master.go:53.3,53.20 1 8 lasagna/lasagna_master.go:53.20,55.4 1 2 lasagna/lasagna_master.go:55.9,56.37 1 6 lasagna/lasagna_master.go:56.37,58.5 1 21 +lasagna/lasagna_master.go:62.2,62.22 1 9 diff --git a/go/lasagna-master/lasagna-doc.md b/go/lasagna-master/lasagna-doc.md index c0689598..d49eb6f2 100755 --- a/go/lasagna-master/lasagna-doc.md +++ b/go/lasagna-master/lasagna-doc.md @@ -20,7 +20,7 @@ import "lasagna" func AddSecretIngredient(friendList []string, myList []string) ``` -AddSecretIngredient passes \`MyList\` by reference\. Accepts two slices of ingredients of type \`\[\]string\`\. +AddSecretIngredient passes \`MyList\` by reference. Accepts two slices of ingredients of type \`\[\]string\`.
Example

@@ -51,7 +51,7 @@ AddSecretIngredient passes \`MyList\` by reference\. Accepts two slices of ingre func PreparationTime(layers []string, avgPrepTime int) int ``` -PreparationTime returns the estimate for the total preparation time based on the number of layers as an \`int\`\. Accepts a slice of layers as a \`\[\]string\` and the average preparation time per layer in minutes as an \`int\`\. +PreparationTime returns the estimate for the total preparation time based on the number of layers as an \`int\`. Accepts a slice of layers as a \`\[\]string\` and the average preparation time per layer in minutes as an \`int\`.

Example

@@ -82,7 +82,7 @@ PreparationTime returns the estimate for the total preparation time based on the func Quantities(layers []string) (int, float64) ``` -Quantities returns two values of noodles as an \`int\` and sauce as a \`float64\`\. Accepts a slice of layers as parameter as a \`\[\]string\`\. +Quantities returns two values of noodles as an \`int\` and sauce as a \`float64\`. Accepts a slice of layers as parameter as a \`\[\]string\`.

Example

@@ -112,7 +112,7 @@ Quantities returns two values of noodles as an \`int\` and sauce as a \`float64\ func ScaleRecipe(quantities []float64, portions int) []float64 ``` -ScaleRecipe returns a slice of \`float64\` of the amounts needed for the desired number of portions\. Accepts a slice of \`float64\` amounts needed for 2 portions and the number of portions\, \`int\`\, you want to cook\. +ScaleRecipe returns a slice of \`float64\` of the amounts needed for the desired number of portions. Accepts a slice of \`float64\` amounts needed for 2 portions and the number of portions, \`int\`, you want to cook.

Example

diff --git a/go/lasagna-master/run-tests-go.txt b/go/lasagna-master/run-tests-go.txt index c56e60c8..65d7ca25 100644 --- a/go/lasagna-master/run-tests-go.txt +++ b/go/lasagna-master/run-tests-go.txt @@ -5,15 +5,606 @@ Go packages: lasagna =============================================================================== -golint lasagna +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.005s +sys 0m0.013s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +lasagna_master_test.go:61: File is not `gofumpt`-ed (gofumpt) + +lasagna_master_test.go:94: File is not `gofumpt`-ed (gofumpt) + "mozzarella"}, +lasagna_master_test.go:105: File is not `gofumpt`-ed (gofumpt) + "mozzarella"}, +lasagna_master_test.go:161: line is 127 characters (lll) + t.Errorf("addSecretIngredient permuted friendsList (was %v, now %v), should not alter inputs", tt.friendsList, friendsList) +lasagna_master_test.go:207: line is 128 characters (lll) + t.Errorf("ScaleRecipe(%v, %d) produced slice of length %d, expected %d", inputList, tt.portions, len(got), len(tt.expected)) +lasagna_master_test.go:57:30: Using the variable on range scope `tt` in function literal (scopelint) + if got := PreparationTime(tt.layers, tt.time); got != tt.expected { + ^ +lasagna_master_test.go:58:55: Using the variable on range scope `tt` in function literal (scopelint) + t.Errorf("PreparationTime(%v, %d) = %d; want %d", tt.layers, tt.time, got, tt.expected) + ^ +lasagna_master_test.go:123:39: Using the variable on range scope `tt` in function literal (scopelint) + gotNoodles, gotSauce := Quantities(tt.layers) + ^ +lasagna_master.go:17:2: declarations should never be cuddled (wsl) + var sauce float64 + ^ +lasagna_master_test.go:62:2: block should not end with a whitespace (or comment) (wsl) + } + ^ +lasagna_master.go:50:39: mnd: Magic number: 2.0, in detected (gomnd) + singles = append(singles, quantity/2.0) + ^ +lasagna_master_test.go:15:1: Function TestPreparationTime missing the call to method parallel (paralleltest) +func TestPreparationTime(t *testing.T) { +^ +lasagna_master_test.go:55:2: Range statement for test TestPreparationTime missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +lasagna_master_test.go:72:1: Function TestQuantities missing the call to method parallel (paralleltest) +func TestQuantities(t *testing.T) { +^ +lasagna_master_test.go:121:2: Range statement for test TestQuantities missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +lasagna_master_test.go:141:1: Function TestAddSecretIngredient missing the call to method parallel (paralleltest) +func TestAddSecretIngredient(t *testing.T) { +^ +lasagna_master_test.go:150:2: Range statement for test TestAddSecretIngredient missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +lasagna_master_test.go:174:1: Function TestScaleRecipe missing the call to method parallel (paralleltest) +func TestScaleRecipe(t *testing.T) { +^ +lasagna_master_test.go:201:2: Range statement for test TestScaleRecipe missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +lasagna_master_examples_test.go:1:9: package should be `lasagna_test` instead of `lasagna` (testpackage) +package lasagna + ^ +lasagna_master_test.go:1:9: package should be `lasagna_test` instead of `lasagna` (testpackage) +package lasagna + ^ + +real 0m0.604s +user 0m0.787s +sys 0m0.496s + + + ============================================================================== + +Exit code: -1 + +real 0m0.640s +user 0m0.800s +sys 0m0.532s + +real 0m0.642s +user 0m0.800s +sys 0m0.533s -real 0m0.183s -user 0m0.160s -sys 0m0.193s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.005s +sys 0m0.010s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +lasagna_master.go + (1, 1) https://revive.run/r#package-comments should have a package comment + + + ✖ 1 problem (0 errors) (1 warnings) + +real 0m0.069s +user 0m0.043s +sys 0m0.042s + + + ============================================================================== + +Exit code: 0 + +real 0m0.092s +user 0m0.051s +sys 0m0.065s + +real 0m0.095s +user 0m0.053s +sys 0m0.066s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.009s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "lasagna [lasagna.test]" + +real 0m0.090s +user 0m0.120s +sys 0m0.108s + + + ============================================================================== + +Exit code: -1 + +real 0m0.112s +user 0m0.129s +sys 0m0.128s + +real 0m0.115s +user 0m0.132s +sys 0m0.128s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.009s +sys 0m0.013s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +lasagna_master.go:1:1: at least one file in a package should have a package comment (ST1000) + +real 0m0.180s +user 0m0.214s +sys 0m0.135s + + + ============================================================================== + +Exit code: -1 + +real 0m0.214s +user 0m0.236s +sys 0m0.158s + +real 0m0.216s +user 0m0.236s +sys 0m0.159s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.009s +sys 0m0.015s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./lasagna_master.go:32:1: paramTypeCombine: func(friendList []string, myList []string) could be replaced with func(friendList, myList []string) +./lasagna_master.go:15:1: unnamedResult: consider giving a name to these results + +real 0m0.820s +user 0m2.002s +sys 0m0.322s + + + ============================================================================== + +Exit code: -1 + +real 0m0.853s +user 0m2.017s +sys 0m0.350s + +real 0m0.856s +user 0m2.018s +sys 0m0.351s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.009s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.088s +user 0m0.135s +sys 0m0.112s + + + ============================================================================== + +Exit code: 0 + +real 0m0.109s +user 0m0.146s +sys 0m0.131s + +real 0m0.111s +user 0m0.147s +sys 0m0.132s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.007s +sys 0m0.006s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.016s +user 0m0.011s +sys 0m0.008s + + + ============================================================================== + +Exit code: 0 + +real 0m0.038s +user 0m0.022s +sys 0m0.026s + +real 0m0.040s +user 0m0.022s +sys 0m0.028s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.011s +sys 0m0.015s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.464s +user 0m1.233s +sys 0m0.281s + + + ============================================================================== + +Exit code: 0 + +real 0m0.498s +user 0m1.254s +sys 0m0.307s + +real 0m0.500s +user 0m1.255s +sys 0m0.308s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.004s +sys 0m0.013s + + + ============================================================================== + +Running: gocyclo . + +6 lasagna TestScaleRecipe lasagna_master_test.go:174:1 +6 lasagna ScaleRecipe lasagna_master.go:42:1 +4 lasagna TestAddSecretIngredient lasagna_master_test.go:141:1 +4 lasagna TestQuantities lasagna_master_test.go:72:1 +4 lasagna Quantities lasagna_master.go:15:1 +3 lasagna TestPreparationTime lasagna_master_test.go:15:1 +2 lasagna AddSecretIngredient lasagna_master.go:32:1 +2 lasagna PreparationTime lasagna_master.go:5:1 +1 lasagna ExampleScaleRecipe lasagna_master_examples_test.go:36:1 +1 lasagna ExampleAddSecretIngredient lasagna_master_examples_test.go:26:1 +1 lasagna ExampleQuantities lasagna_master_examples_test.go:17:1 +1 lasagna ExamplePreparationTime lasagna_master_examples_test.go:7:1 + +real 0m0.003s +user 0m0.003s +sys 0m0.000s + + + ============================================================================== + +Exit code: 0 + +real 0m0.027s +user 0m0.014s +sys 0m0.021s + +real 0m0.029s +user 0m0.016s +sys 0m0.021s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.035s +user 0m0.039s +sys 0m0.017s + + + ============================================================================== + +Exit code: 0 + +real 0m0.050s +user 0m0.046s +sys 0m0.032s + +real 0m0.052s +user 0m0.047s +sys 0m0.033s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.008s +sys 0m0.016s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:24:27 Including rules: default +[gosec] 2023/09/07 00:24:27 Excluding rules: default +[gosec] 2023/09/07 00:24:27 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/lasagna-master +[gosec] 2023/09/07 00:24:27 Checking package: lasagna +[gosec] 2023/09/07 00:24:27 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/lasagna-master/lasagna_master.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 63 + Nosec : 0 + Issues : 0 + + +real 0m0.074s +user 0m0.065s +sys 0m0.047s + + + ============================================================================== + +Exit code: 0 + +real 0m0.110s +user 0m0.078s +sys 0m0.083s + +real 0m0.112s +user 0m0.080s +sys 0m0.084s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out lasagna +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.003s +sys 0m0.014s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestPreparationTime === RUN TestPreparationTime/Preparation_time_for_many_layers_with_custom_average_time === RUN TestPreparationTime/Preparation_time_for_few_layers @@ -56,28 +647,66 @@ go test -v -covermode=count -coverprofile coverage.out lasagna --- PASS: ExampleScaleRecipe (0.00s) PASS coverage: 95.8% of statements -ok lasagna 0.009s coverage: 95.8% of statements +ok lasagna 0.012s coverage: 95.8% of statements -real 0m0.718s -user 0m0.855s -sys 0m0.585s +real 0m0.212s +user 0m0.280s +sys 0m0.195s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + lasagna/lasagna_master.go:5: PreparationTime 100.0% lasagna/lasagna_master.go:15: Quantities 100.0% lasagna/lasagna_master.go:32: AddSecretIngredient 66.7% lasagna/lasagna_master.go:42: ScaleRecipe 100.0% total: (statements) 95.8% -real 0m0.091s -user 0m0.043s -sys 0m0.101s +real 0m0.022s +user 0m0.012s +sys 0m0.016s -=============================================================================== -go test -v -race -covermode=atomic lasagna + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.022s +user 0m0.012s +sys 0m0.014s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +32 func AddSecretIngredient(friendList []string, myList []string) { +33 if myList[len(myList)-1] == "?" { +34 myList[len(myList)-1] = friendList[len(friendList)-1] +35 } else { +36 MISS panic("You already know the secret ingredient!") +37 } +38 } + + +real 0m0.010s +user 0m0.005s +sys 0m0.010s + +real 0m0.010s +user 0m0.005s +sys 0m0.010s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestPreparationTime === RUN TestPreparationTime/Preparation_time_for_many_layers_with_custom_average_time === RUN TestPreparationTime/Preparation_time_for_few_layers @@ -120,78 +749,96 @@ go test -v -race -covermode=atomic lasagna --- PASS: ExampleScaleRecipe (0.00s) PASS coverage: 95.8% of statements -ok lasagna 0.028s coverage: 95.8% of statements +ok lasagna 1.016s coverage: 95.8% of statements -real 0m0.702s -user 0m0.855s -sys 0m0.428s - -=============================================================================== +real 0m1.251s +user 0m0.303s +sys 0m0.175s -go test --bench . --benchmem -PASS -ok lasagna 0.006s -real 0m0.743s -user 0m0.880s -sys 0m0.490s + ============================================================================== -=============================================================================== +Exit code: 0 -go test -tags bonus -PASS -ok lasagna 0.010s +real 0m1.545s +user 0m0.626s +sys 0m0.432s -real 0m0.543s -user 0m0.679s -sys 0m0.393s +real 0m1.547s +user 0m0.627s +sys 0m0.433s =============================================================================== -go vet lasagna +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok lasagna 0.002s -real 0m0.416s -user 0m0.493s -sys 0m0.412s +real 0m0.173s +user 0m0.251s +sys 0m0.178s =============================================================================== -go fix lasagna +gotest -v -tags bonus +=== RUN TestPreparationTime +=== RUN TestPreparationTime/Preparation_time_for_many_layers_with_custom_average_time +=== RUN TestPreparationTime/Preparation_time_for_few_layers +=== RUN TestPreparationTime/Preparation_time_for_default_case +--- PASS: TestPreparationTime (0.00s) + --- PASS: TestPreparationTime/Preparation_time_for_many_layers_with_custom_average_time (0.00s) + --- PASS: TestPreparationTime/Preparation_time_for_few_layers (0.00s) + --- PASS: TestPreparationTime/Preparation_time_for_default_case (0.00s) +=== RUN TestQuantities +=== RUN TestQuantities/few_layers +=== RUN TestQuantities/many_layers +=== RUN TestQuantities/no_noodles +=== RUN TestQuantities/no_sauce +--- PASS: TestQuantities (0.00s) + --- PASS: TestQuantities/few_layers (0.00s) + --- PASS: TestQuantities/many_layers (0.00s) + --- PASS: TestQuantities/no_noodles (0.00s) + --- PASS: TestQuantities/no_sauce (0.00s) +=== RUN TestAddSecretIngredient +=== RUN TestAddSecretIngredient/Adds_secret_ingredient +--- PASS: TestAddSecretIngredient (0.00s) + --- PASS: TestAddSecretIngredient/Adds_secret_ingredient (0.00s) +=== RUN TestScaleRecipe +=== RUN TestScaleRecipe/scales_up_correctly +=== RUN TestScaleRecipe/scales_up_correctly_(2) +=== RUN TestScaleRecipe/scales_down_correctly +=== RUN TestScaleRecipe/empty_recipe +--- PASS: TestScaleRecipe (0.00s) + --- PASS: TestScaleRecipe/scales_up_correctly (0.00s) + --- PASS: TestScaleRecipe/scales_up_correctly_(2) (0.00s) + --- PASS: TestScaleRecipe/scales_down_correctly (0.00s) + --- PASS: TestScaleRecipe/empty_recipe (0.00s) +=== RUN ExamplePreparationTime +--- PASS: ExamplePreparationTime (0.00s) +=== RUN ExampleQuantities +--- PASS: ExampleQuantities (0.00s) +=== RUN ExampleAddSecretIngredient +--- PASS: ExampleAddSecretIngredient (0.00s) +=== RUN ExampleScaleRecipe +--- PASS: ExampleScaleRecipe (0.00s) +PASS +ok lasagna 0.002s -real 0m0.041s -user 0m0.020s -sys 0m0.033s +real 0m0.123s +user 0m0.184s +sys 0m0.106s =============================================================================== -gosec ./lasagna-master -[gosec] 2022/06/20 23:31:34 Including rules: default -[gosec] 2022/06/20 23:31:34 Excluding rules: default -[gosec] 2022/06/20 23:31:34 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/lasagna-master -[gosec] 2022/06/20 23:31:34 Checking package: lasagna -[gosec] 2022/06/20 23:31:34 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/lasagna-master/lasagna_master.go -Results: - - -Summary: - Gosec : dev - Files : 1 - Lines : 63 - Nosec : 0 - Issues : 0 - - -real 0m0.285s -user 0m0.335s -sys 0m0.196s +No old benchmarks to run benchstat against. =============================================================================== gomarkdoc --output lasagna-doc.md -real 0m0.035s -user 0m0.018s -sys 0m0.015s +real 0m0.011s +user 0m0.008s +sys 0m0.003s =============================================================================== @@ -220,9 +867,9 @@ func ScaleRecipe(quantities []float64, portions int) []float64 2 portions and the number of portions, `int`, you want to cook. -real 0m0.157s -user 0m0.072s -sys 0m0.153s +real 0m0.027s +user 0m0.009s +sys 0m0.025s =============================================================================== diff --git a/go/lasagna/benchstat-new.txt b/go/lasagna/benchstat-new.txt new file mode 100644 index 00000000..ac3eb903 --- /dev/null +++ b/go/lasagna/benchstat-new.txt @@ -0,0 +1,2 @@ +PASS +ok lasagna 0.002s diff --git a/go/lasagna/coverage-annotations.txt b/go/lasagna/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/lasagna/coverage.html b/go/lasagna/coverage.html new file mode 100644 index 00000000..8cc70ce7 --- /dev/null +++ b/go/lasagna/coverage.html @@ -0,0 +1,131 @@ + + + + + + lasagna: Go Coverage Report + + + +

+ +
+ not tracked + + no coverage + low coverage + * + * + * + * + * + * + * + * + high coverage + +
+
+
+ + + +
+ + + diff --git a/go/lasagna/lasagna-doc.md b/go/lasagna/lasagna-doc.md index 5796cdcd..a89a5102 100755 --- a/go/lasagna/lasagna-doc.md +++ b/go/lasagna/lasagna-doc.md @@ -16,7 +16,7 @@ import "lasagna" ## Constants -OvenTime is the amount of time the lasagna should bake for\. +OvenTime is the amount of time the lasagna should bake for. ```go const OvenTime = 40 @@ -28,7 +28,7 @@ const OvenTime = 40 func ElapsedTime(numberOfLayers, actualMinutesInOven int) int ``` -ElapsedTime calculates the total time needed to create and bake a lasagna\. +ElapsedTime calculates the total time needed to create and bake a lasagna.
Example

@@ -55,7 +55,7 @@ ElapsedTime calculates the total time needed to create and bake a lasagna\. func PreparationTime(numberOfLayers int) int ``` -PreparationTime calculates the time needed to prepare the lasagna based on the amount of layers\. +PreparationTime calculates the time needed to prepare the lasagna based on the amount of layers.

Example

@@ -82,7 +82,7 @@ PreparationTime calculates the time needed to prepare the lasagna based on the a func RemainingOvenTime(actualMinutesInOven int) int ``` -RemainingOvenTime returns the remaining minutes based on the \`actual\` minutes already in the oven\. +RemainingOvenTime returns the remaining minutes based on the \`actual\` minutes already in the oven.

Example

diff --git a/go/lasagna/run-tests-go.txt b/go/lasagna/run-tests-go.txt index 4fb90034..e4f94bac 100644 --- a/go/lasagna/run-tests-go.txt +++ b/go/lasagna/run-tests-go.txt @@ -5,15 +5,601 @@ Go packages: lasagna =============================================================================== -golint lasagna +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.012s +sys 0m0.014s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +lasagna_test.go:43: File is not `gofumpt`-ed (gofumpt) + } +lasagna_test.go:45: File is not `gofumpt`-ed (gofumpt) +} +lasagna_test.go:67: File is not `gofumpt`-ed (gofumpt) + +lasagna_test.go:21:31: Using the variable on range scope `tt` in function literal (scopelint) + if got := OvenTime; got != tt.expected { + ^ +lasagna_test.go:22:45: Using the variable on range scope `tt` in function literal (scopelint) + t.Errorf("OvenTime(%d) = %d; want %d", tt.expected, got, tt.expected) + ^ +lasagna_test.go:39:32: Using the variable on range scope `tt` in function literal (scopelint) + if got := RemainingOvenTime(tt.time); got != tt.expected { + ^ +lasagna_test.go:44: unnecessary trailing newline (whitespace) + +} +lasagna_test.go:68:2: block should not end with a whitespace (or comment) (wsl) + } + ^ +lasagna_test.go:93:2: block should not end with a whitespace (or comment) (wsl) + } + ^ +lasagna.go:13:9: mnd: Magic number: 2, in detected (gomnd) + return 2 * numberOfLayers + ^ +lasagna_test.go:10:1: Function TestOvenTime missing the call to method parallel (paralleltest) +func TestOvenTime(t *testing.T) { +^ +lasagna_test.go:19:2: Range statement for test TestOvenTime missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +lasagna_test.go:28:1: Function TestRemainingOvenTime missing the call to method parallel (paralleltest) +func TestRemainingOvenTime(t *testing.T) { +^ +lasagna_test.go:37:2: Range statement for test TestRemainingOvenTime missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +lasagna_test.go:46:1: Function TestPreparationTime missing the call to method parallel (paralleltest) +func TestPreparationTime(t *testing.T) { +^ +lasagna_test.go:61:2: Range statement for test TestPreparationTime missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +lasagna_test.go:71:1: Function TestElapsedTime missing the call to method parallel (paralleltest) +func TestElapsedTime(t *testing.T) { +^ +lasagna_test.go:86:2: Range statement for test TestElapsedTime missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +lasagna_examples_test.go:1:9: package should be `lasagna_test` instead of `lasagna` (testpackage) +package lasagna + ^ +lasagna_test.go:1:9: package should be `lasagna_test` instead of `lasagna` (testpackage) +package lasagna + ^ + +real 0m0.449s +user 0m0.627s +sys 0m0.442s + + + ============================================================================== + +Exit code: -1 + +real 0m0.489s +user 0m0.648s +sys 0m0.471s + +real 0m0.492s +user 0m0.650s +sys 0m0.473s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.004s +sys 0m0.010s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +lasagna.go + (1, 1) https://revive.run/r#package-comments should have a package comment + + + ✖ 1 problem (0 errors) (1 warnings) + +real 0m0.038s +user 0m0.018s +sys 0m0.029s + + + ============================================================================== + +Exit code: 0 + +real 0m0.060s +user 0m0.026s +sys 0m0.051s + +real 0m0.062s +user 0m0.027s +sys 0m0.052s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.000s +user 0m0.000s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.007s +sys 0m0.008s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "lasagna [lasagna.test]" + +real 0m0.102s +user 0m0.120s +sys 0m0.121s + + + ============================================================================== + +Exit code: -1 + +real 0m0.124s +user 0m0.130s +sys 0m0.140s + +real 0m0.126s +user 0m0.130s +sys 0m0.141s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.006s +sys 0m0.012s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +lasagna.go:1:1: at least one file in a package should have a package comment (ST1000) + +real 0m0.164s +user 0m0.180s +sys 0m0.114s + + + ============================================================================== + +Exit code: -1 + +real 0m0.190s +user 0m0.192s +sys 0m0.135s + +real 0m0.192s +user 0m0.192s +sys 0m0.137s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.010s +user 0m0.003s +sys 0m0.009s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.834s +user 0m2.051s +sys 0m0.275s + + + ============================================================================== + +Exit code: 0 + +real 0m0.856s +user 0m2.061s +sys 0m0.297s + +real 0m0.858s +user 0m2.062s +sys 0m0.298s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.009s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.075s +user 0m0.115s +sys 0m0.098s + + + ============================================================================== + +Exit code: 0 + +real 0m0.099s +user 0m0.124s +sys 0m0.120s + +real 0m0.101s +user 0m0.126s +sys 0m0.120s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.007s +sys 0m0.016s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.027s +user 0m0.011s +sys 0m0.013s + + + ============================================================================== + +Exit code: 0 + +real 0m0.056s +user 0m0.023s +sys 0m0.040s + +real 0m0.058s +user 0m0.023s +sys 0m0.042s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.005s +sys 0m0.014s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.514s +user 0m1.738s +sys 0m0.297s -real 0m0.092s -user 0m0.057s -sys 0m0.074s + + ============================================================================== + +Exit code: 0 + +real 0m0.543s +user 0m1.749s +sys 0m0.325s + +real 0m0.545s +user 0m1.749s +sys 0m0.326s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.009s +user 0m0.005s +sys 0m0.007s + + + ============================================================================== + +Running: gocyclo . + +3 lasagna TestElapsedTime lasagna_test.go:71:1 +3 lasagna TestPreparationTime lasagna_test.go:46:1 +3 lasagna TestRemainingOvenTime lasagna_test.go:28:1 +3 lasagna TestOvenTime lasagna_test.go:10:1 +1 lasagna ExampleElapsedTime lasagna_examples_test.go:19:1 +1 lasagna ExamplePreparationTime lasagna_examples_test.go:13:1 +1 lasagna ExampleRemainingOvenTime lasagna_examples_test.go:7:1 +1 lasagna ElapsedTime lasagna.go:17:1 +1 lasagna PreparationTime lasagna.go:12:1 +1 lasagna RemainingOvenTime lasagna.go:7:1 + +real 0m0.002s +user 0m0.001s +sys 0m0.001s + + + ============================================================================== + +Exit code: 0 + +real 0m0.023s +user 0m0.015s +sys 0m0.015s + +real 0m0.025s +user 0m0.015s +sys 0m0.017s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.027s +user 0m0.032s +sys 0m0.015s + + + ============================================================================== + +Exit code: 0 + +real 0m0.039s +user 0m0.041s +sys 0m0.022s + +real 0m0.041s +user 0m0.043s +sys 0m0.022s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out lasagna +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.016s +user 0m0.003s +sys 0m0.017s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:24:22 Including rules: default +[gosec] 2023/09/07 00:24:22 Excluding rules: default +[gosec] 2023/09/07 00:24:22 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/lasagna +[gosec] 2023/09/07 00:24:22 Checking package: lasagna +[gosec] 2023/09/07 00:24:22 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/lasagna/lasagna.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 19 + Nosec : 0 + Issues : 0 + + +real 0m0.097s +user 0m0.077s +sys 0m0.057s + + + ============================================================================== + +Exit code: 0 + +real 0m0.127s +user 0m0.085s +sys 0m0.087s + +real 0m0.129s +user 0m0.087s +sys 0m0.087s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.005s +sys 0m0.011s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestOvenTime === RUN TestOvenTime/Calculates_how_many_minutes_the_lasagna_should_be_in_the_oven --- PASS: TestOvenTime (0.00s) @@ -25,7 +611,7 @@ go test -v -covermode=count -coverprofile coverage.out lasagna === RUN TestPreparationTime === RUN TestPreparationTime/Preparation_time_in_minutes_for_one_layer === RUN TestPreparationTime/Preparation_time_in_minutes_for_multiple_layers ---- PASS: TestPreparationTime (0.01s) +--- PASS: TestPreparationTime (0.00s) --- PASS: TestPreparationTime/Preparation_time_in_minutes_for_one_layer (0.00s) --- PASS: TestPreparationTime/Preparation_time_in_minutes_for_multiple_layers (0.00s) === RUN TestElapsedTime @@ -42,27 +628,56 @@ go test -v -covermode=count -coverprofile coverage.out lasagna --- PASS: ExampleElapsedTime (0.00s) PASS coverage: 100.0% of statements -ok lasagna 0.017s coverage: 100.0% of statements +ok lasagna 0.002s coverage: 100.0% of statements -real 0m0.590s -user 0m0.624s -sys 0m0.458s +real 0m0.164s +user 0m0.212s +sys 0m0.130s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + lasagna/lasagna.go:7: RemainingOvenTime 100.0% lasagna/lasagna.go:12: PreparationTime 100.0% lasagna/lasagna.go:17: ElapsedTime 100.0% total: (statements) 100.0% -real 0m0.082s -user 0m0.035s -sys 0m0.091s +real 0m0.025s +user 0m0.015s +sys 0m0.018s -=============================================================================== -go test -v -race -covermode=atomic lasagna + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.026s +user 0m0.011s +sys 0m0.022s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.010s +user 0m0.002s +sys 0m0.013s + +real 0m0.010s +user 0m0.002s +sys 0m0.013s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestOvenTime === RUN TestOvenTime/Calculates_how_many_minutes_the_lasagna_should_be_in_the_oven --- PASS: TestOvenTime (0.00s) @@ -91,78 +706,82 @@ go test -v -race -covermode=atomic lasagna --- PASS: ExampleElapsedTime (0.00s) PASS coverage: 100.0% of statements -ok lasagna 0.048s coverage: 100.0% of statements +ok lasagna 1.015s coverage: 100.0% of statements -real 0m0.661s -user 0m0.820s -sys 0m0.372s +real 0m1.220s +user 0m0.238s +sys 0m0.132s -=============================================================================== -go test --bench . --benchmem -PASS -ok lasagna 0.010s + ============================================================================== -real 0m0.622s -user 0m0.656s -sys 0m0.477s +Exit code: 0 -=============================================================================== - -go test -tags bonus -PASS -ok lasagna 0.003s +real 0m1.469s +user 0m0.487s +sys 0m0.338s -real 0m0.509s -user 0m0.594s -sys 0m0.403s +real 0m1.471s +user 0m0.489s +sys 0m0.338s =============================================================================== -go vet lasagna +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok lasagna 0.002s -real 0m0.339s -user 0m0.448s -sys 0m0.317s +real 0m0.178s +user 0m0.210s +sys 0m0.151s =============================================================================== -go fix lasagna +gotest -v -tags bonus +=== RUN TestOvenTime +=== RUN TestOvenTime/Calculates_how_many_minutes_the_lasagna_should_be_in_the_oven +--- PASS: TestOvenTime (0.00s) + --- PASS: TestOvenTime/Calculates_how_many_minutes_the_lasagna_should_be_in_the_oven (0.00s) +=== RUN TestRemainingOvenTime +=== RUN TestRemainingOvenTime/Remaining_minutes_in_oven +--- PASS: TestRemainingOvenTime (0.00s) + --- PASS: TestRemainingOvenTime/Remaining_minutes_in_oven (0.00s) +=== RUN TestPreparationTime +=== RUN TestPreparationTime/Preparation_time_in_minutes_for_one_layer +=== RUN TestPreparationTime/Preparation_time_in_minutes_for_multiple_layers +--- PASS: TestPreparationTime (0.00s) + --- PASS: TestPreparationTime/Preparation_time_in_minutes_for_one_layer (0.00s) + --- PASS: TestPreparationTime/Preparation_time_in_minutes_for_multiple_layers (0.00s) +=== RUN TestElapsedTime +=== RUN TestElapsedTime/Total_time_in_minutes_for_one_layer +=== RUN TestElapsedTime/Total_time_in_minutes_for_multiple_layers +--- PASS: TestElapsedTime (0.00s) + --- PASS: TestElapsedTime/Total_time_in_minutes_for_one_layer (0.00s) + --- PASS: TestElapsedTime/Total_time_in_minutes_for_multiple_layers (0.00s) +=== RUN ExampleRemainingOvenTime +--- PASS: ExampleRemainingOvenTime (0.00s) +=== RUN ExamplePreparationTime +--- PASS: ExamplePreparationTime (0.00s) +=== RUN ExampleElapsedTime +--- PASS: ExampleElapsedTime (0.00s) +PASS +ok lasagna 0.002s -real 0m0.065s -user 0m0.031s -sys 0m0.039s +real 0m0.159s +user 0m0.180s +sys 0m0.119s =============================================================================== -gosec ./lasagna -[gosec] 2022/06/20 22:11:35 Including rules: default -[gosec] 2022/06/20 22:11:35 Excluding rules: default -[gosec] 2022/06/20 22:11:35 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/lasagna -[gosec] 2022/06/20 22:11:35 Checking package: lasagna -[gosec] 2022/06/20 22:11:35 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/lasagna/lasagna.go -Results: - - -Summary: - Gosec : dev - Files : 1 - Lines : 19 - Nosec : 0 - Issues : 0 - - -real 0m0.253s -user 0m0.231s -sys 0m0.184s +No old benchmarks to run benchstat against. =============================================================================== gomarkdoc --output lasagna-doc.md -real 0m0.054s -user 0m0.035s -sys 0m0.021s +real 0m0.023s +user 0m0.017s +sys 0m0.007s =============================================================================== @@ -190,9 +809,9 @@ func RemainingOvenTime(actualMinutesInOven int) int minutes already in the oven. -real 0m0.103s -user 0m0.038s -sys 0m0.095s +real 0m0.048s +user 0m0.018s +sys 0m0.039s =============================================================================== diff --git a/go/leap/benchstat-new.txt b/go/leap/benchstat-new.txt index 060ae421..90bc7415 100644 --- a/go/leap/benchstat-new.txt +++ b/go/leap/benchstat-new.txt @@ -3,6 +3,6 @@ goarch: amd64 pkg: leap cpu: 12th Gen Intel(R) Core(TM) i5-1240P Benchmark400 -Benchmark400-16 14443444 77.36 ns/op 0 B/op 0 allocs/op +Benchmark400-8 14738716 108.9 ns/op 0 B/op 0 allocs/op PASS -ok leap 1.209s +ok leap 2.647s diff --git a/go/leap/benchstat-old.txt b/go/leap/benchstat-old.txt index fe68c3cc..060ae421 100644 --- a/go/leap/benchstat-old.txt +++ b/go/leap/benchstat-old.txt @@ -3,6 +3,6 @@ goarch: amd64 pkg: leap cpu: 12th Gen Intel(R) Core(TM) i5-1240P Benchmark400 -Benchmark400-16 15370368 81.88 ns/op 0 B/op 0 allocs/op +Benchmark400-16 14443444 77.36 ns/op 0 B/op 0 allocs/op PASS -ok leap 2.283s +ok leap 1.209s diff --git a/go/leap/coverage.out b/go/leap/coverage.out index fcb2ab18..d4bf71b8 100644 --- a/go/leap/coverage.out +++ b/go/leap/coverage.out @@ -1,8 +1,8 @@ mode: count leap/leap.go:9.32,10.19 1 13 -leap/leap.go:14.2,14.19 1 10 -leap/leap.go:18.2,18.17 1 6 -leap/leap.go:23.2,23.14 1 3 leap/leap.go:10.19,12.3 1 3 +leap/leap.go:14.2,14.19 1 10 leap/leap.go:14.19,16.3 1 4 +leap/leap.go:18.2,18.17 1 6 leap/leap.go:18.17,21.3 1 3 +leap/leap.go:23.2,23.14 1 3 diff --git a/go/leap/run-tests-go.txt b/go/leap/run-tests-go.txt index 07c4a584..857aa4da 100644 --- a/go/leap/run-tests-go.txt +++ b/go/leap/run-tests-go.txt @@ -5,123 +5,570 @@ Go packages: leap =============================================================================== -golangci-lint run ./... +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m2.588s -user 0m10.241s -sys 0m1.535s +Running GoLangCi-Lint -=============================================================================== +Go version: -golint ./... + go version go1.21.0 linux/amd64 -real 0m0.015s -user 0m0.010s -sys 0m0.018s + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.007s +sys 0m0.021s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +leap.go:8:51: Comment should end in a period (godot) +// unless the year is also evenly divisible by 400 + ^ +leap.go:19: File is not `gofumpt`-ed (gofumpt) + +leap_test.go:8:25: Using the variable on range scope `tc` in function literal (scopelint) + actual := IsLeapYear(tc.year) + ^ +leap_test.go:9:17: Using the variable on range scope `tc` in function literal (scopelint) + if actual != tc.expected { + ^ +leap_test.go:10:46: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("IsLeapYear(%d) = %t, want %t", tc.year, actual, tc.expected) + ^ +leap.go:18: unnecessary leading newline (whitespace) + if year%4 == 0 { + +leap_test.go:21:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +leap_test.go:5:1: Function TestLeapYears missing the call to method parallel (paralleltest) +func TestLeapYears(t *testing.T) { +^ +leap_test.go:6:2: Range statement for test TestLeapYears missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +cases_test.go:1:9: package should be `leap_test` instead of `leap` (testpackage) +package leap + ^ +leap_examples_test.go:1:9: package should be `leap_test` instead of `leap` (testpackage) +package leap + ^ +leap_test.go:1:9: package should be `leap_test` instead of `leap` (testpackage) +package leap + ^ + +real 0m0.457s +user 0m0.731s +sys 0m0.397s + + + ============================================================================== + +Exit code: -1 + +real 0m0.496s +user 0m0.747s +sys 0m0.431s + +real 0m0.498s +user 0m0.749s +sys 0m0.432s =============================================================================== -revive -formatter=stylish ./... +Running: ../../.github/citools/go/go-lint-revive -real 0m0.007s -user 0m0.003s -sys 0m0.006s +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.005s +sys 0m0.011s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.027s +user 0m0.015s +sys 0m0.019s + + + ============================================================================== + +Exit code: 0 + +real 0m0.050s +user 0m0.024s +sys 0m0.041s + +real 0m0.053s +user 0m0.024s +sys 0m0.043s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.092s -user 0m0.142s -sys 0m0.139s +real 0m0.000s +user 0m0.000s +sys 0m0.000s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.005s +sys 0m0.009s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." -./leap_examples_test.go:3:1: unit import: omit parenthesis in a single-package import +internal error: package "fmt" without types was imported from "leap [leap.test]" + +real 0m0.097s +user 0m0.102s +sys 0m0.095s + + + ============================================================================== + +Exit code: -1 -real 0m0.119s -user 0m0.184s -sys 0m0.151s +real 0m0.120s +user 0m0.109s +sys 0m0.117s + +real 0m0.121s +user 0m0.109s +sys 0m0.119s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck -real 0m0.174s -user 0m0.246s -sys 0m0.218s +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.010s +user 0m0.006s +sys 0m0.006s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.167s +user 0m0.181s +sys 0m0.126s + + + ============================================================================== + +Exit code: 0 + +real 0m0.187s +user 0m0.191s +sys 0m0.145s + +real 0m0.189s +user 0m0.192s +sys 0m0.146s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.012s +sys 0m0.014s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.844s +user 0m1.954s +sys 0m0.299s + + + ============================================================================== + +Exit code: 0 + +real 0m0.876s +user 0m1.973s +sys 0m0.320s + +real 0m0.878s +user 0m1.974s +sys 0m0.321s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + -real 0m0.888s -user 0m2.930s -sys 0m0.569s + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.005s +sys 0m0.011s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.080s +user 0m0.154s +sys 0m0.121s + + + ============================================================================== + +Exit code: 0 + +real 0m0.101s +user 0m0.162s +sys 0m0.140s + +real 0m0.103s +user 0m0.162s +sys 0m0.141s =============================================================================== -go vet ./... +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.005s +sys 0m0.011s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.017s +user 0m0.009s +sys 0m0.012s + + + ============================================================================== + +Exit code: 0 -real 0m0.102s -user 0m0.238s -sys 0m0.217s +real 0m0.041s +user 0m0.019s +sys 0m0.032s + +real 0m0.043s +user 0m0.020s +sys 0m0.033s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + -real 0m0.016s +real 0m0.018s user 0m0.007s sys 0m0.014s + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.442s +user 0m1.271s +sys 0m0.272s + + + ============================================================================== + +Exit code: 0 + +real 0m0.474s +user 0m1.282s +sys 0m0.302s + +real 0m0.476s +user 0m1.283s +sys 0m0.303s + =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.012s +sys 0m0.023s + + + ============================================================================== + +Running: gocyclo . + 4 leap Benchmark400 leap_test.go:17:1 4 leap IsLeapYear leap.go:9:1 3 leap TestLeapYears leap_test.go:5:1 2 leap ExampleIsLeapYear leap_examples_test.go:7:1 -real 0m0.002s -user 0m0.002s -sys 0m0.000s +real 0m0.003s +user 0m0.001s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.044s +user 0m0.024s +sys 0m0.033s + +real 0m0.046s +user 0m0.025s +sys 0m0.034s =============================================================================== -misspell . +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + real 0m0.026s -user 0m0.032s -sys 0m0.010s +user 0m0.028s +sys 0m0.011s + + + ============================================================================== + +Exit code: 0 + +real 0m0.036s +user 0m0.031s +sys 0m0.022s + +real 0m0.038s +user 0m0.031s +sys 0m0.024s =============================================================================== -gosec ./... -[gosec] 2023/02/07 22:52:34 Including rules: default -[gosec] 2023/02/07 22:52:34 Excluding rules: default -[gosec] 2023/02/07 22:52:34 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/leap -[gosec] 2023/02/07 22:52:34 Checking package: leap -[gosec] 2023/02/07 22:52:34 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/leap/leap.go +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.003s +sys 0m0.012s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:24:31 Including rules: default +[gosec] 2023/09/07 00:24:31 Excluding rules: default +[gosec] 2023/09/07 00:24:31 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/leap +[gosec] 2023/09/07 00:24:31 Checking package: leap +[gosec] 2023/09/07 00:24:31 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/leap/leap.go Results: -Summary: - Files: 1 - Lines: 24 - Nosec: 0 - Issues: 0 +Summary: + Gosec : dev + Files : 1 + Lines : 24 + Nosec : 0 + Issues : 0 + + +real 0m0.084s +user 0m0.065s +sys 0m0.055s -real 0m0.070s -user 0m0.064s -sys 0m0.057s + ============================================================================== + +Exit code: 0 + +real 0m0.104s +user 0m0.072s +sys 0m0.075s + +real 0m0.106s +user 0m0.074s +sys 0m0.076s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.007s +sys 0m0.007s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestLeapYears === RUN TestLeapYears/year_not_divisible_by_4_in_common_year === RUN TestLeapYears/year_divisible_by_2,_not_divisible_by_4_in_common_year @@ -148,39 +595,52 @@ PASS coverage: 100.0% of statements ok leap 0.002s coverage: 100.0% of statements -real 0m0.191s -user 0m0.315s -sys 0m0.253s +real 0m0.176s +user 0m0.246s +sys 0m0.153s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + leap/leap.go:9: IsLeapYear 100.0% total: (statements) 100.0% -real 0m0.037s -user 0m0.016s -sys 0m0.045s +real 0m0.021s +user 0m0.008s +sys 0m0.019s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.026s -user 0m0.013s -sys 0m0.025s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +real 0m0.021s +user 0m0.010s +sys 0m0.016s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt real 0m0.011s -user 0m0.007s -sys 0m0.009s +user 0m0.005s +sys 0m0.011s + +real 0m0.011s +user 0m0.005s +sys 0m0.011s -=============================================================================== -gotest -v -race -covermode=atomic ./... + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestLeapYears === RUN TestLeapYears/year_not_divisible_by_4_in_common_year === RUN TestLeapYears/year_divisible_by_2,_not_divisible_by_4_in_common_year @@ -205,11 +665,24 @@ gotest -v -race -covermode=atomic ./... --- PASS: ExampleIsLeapYear (0.00s) PASS coverage: 100.0% of statements -ok leap (cached) coverage: 100.0% of statements +ok leap 1.013s coverage: 100.0% of statements + +real 0m1.244s +user 0m0.268s +sys 0m0.162s + -real 0m0.131s -user 0m0.247s -sys 0m0.248s + ============================================================================== + +Exit code: 0 + +real 0m1.496s +user 0m0.550s +sys 0m0.377s + +real 0m1.499s +user 0m0.552s +sys 0m0.378s =============================================================================== @@ -222,13 +695,13 @@ goarch: amd64 pkg: leap cpu: 12th Gen Intel(R) Core(TM) i5-1240P Benchmark400 -Benchmark400-16 14443444 77.36 ns/op 0 B/op 0 allocs/op +Benchmark400-8 14738716 108.9 ns/op 0 B/op 0 allocs/op PASS -ok leap 1.209s +ok leap 2.647s -real 0m1.373s -user 0m1.454s -sys 0m0.228s +real 0m2.801s +user 0m2.848s +sys 0m0.147s =============================================================================== @@ -258,33 +731,59 @@ gotest -v -tags bonus PASS ok leap 0.002s -real 0m0.163s -user 0m0.275s -sys 0m0.266s +real 0m0.128s +user 0m0.186s +sys 0m0.128s =============================================================================== benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -400-16 81.9ns ± 0% 77.4ns ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -400-16 0.00B 0.00B ~ (all equal) - -name old allocs/op new allocs/op delta -400-16 0.00 0.00 ~ (all equal) - -real 0m0.008s -user 0m0.005s -sys 0m0.008s +benchstat-old.txt:5: missing iteration count +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: leap +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-old.txt │ benchstat-new.txt │ + │ sec/op │ sec/op vs base │ +400-16 77.36n ± ∞ ¹ +400-8 108.9n ± ∞ ¹ +geomean 77.36n 108.9n ? ² ³ +¹ need >= 6 samples for confidence interval at level 0.95 +² benchmark set differs from baseline; geomeans may not be comparable +³ ratios must be >0 to compute geomean + + │ benchstat-old.txt │ benchstat-new.txt │ + │ B/op │ B/op vs base │ +400-16 0.000 ± ∞ ¹ +400-8 0.000 ± ∞ ¹ +geomean ² ? ³ ² ⁴ +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean +³ benchmark set differs from baseline; geomeans may not be comparable +⁴ ratios must be >0 to compute geomean + + │ benchstat-old.txt │ benchstat-new.txt │ + │ allocs/op │ allocs/op vs base │ +400-16 0.000 ± ∞ ¹ +400-8 0.000 ± ∞ ¹ +geomean ² ? ³ ² ⁴ +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean +³ benchmark set differs from baseline; geomeans may not be comparable +⁴ ratios must be >0 to compute geomean + +real 0m0.004s +user 0m0.002s +sys 0m0.002s =============================================================================== gomarkdoc --output leap-doc.md -real 0m0.011s -user 0m0.007s -sys 0m0.006s +real 0m0.014s +user 0m0.006s +sys 0m0.008s =============================================================================== @@ -303,9 +802,9 @@ func IsLeapYear(year int) bool divisible by 100 unless the year is also evenly divisible by 400 -real 0m0.046s -user 0m0.021s -sys 0m0.041s +real 0m0.030s +user 0m0.014s +sys 0m0.024s =============================================================================== diff --git a/go/ledger/benchstat-new.txt b/go/ledger/benchstat-new.txt index 083e8870..eefd2355 100644 --- a/go/ledger/benchstat-new.txt +++ b/go/ledger/benchstat-new.txt @@ -1,8 +1,8 @@ goos: linux goarch: amd64 pkg: ledger -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkFormatLedger -BenchmarkFormatLedger-4 26844 46222 ns/op 7281 B/op 243 allocs/op +BenchmarkFormatLedger-8 79789 12738 ns/op 7282 B/op 243 allocs/op PASS -ok ledger 1.746s +ok ledger 1.173s diff --git a/go/ledger/benchstat-old.txt b/go/ledger/benchstat-old.txt new file mode 100644 index 00000000..083e8870 --- /dev/null +++ b/go/ledger/benchstat-old.txt @@ -0,0 +1,8 @@ +goos: linux +goarch: amd64 +pkg: ledger +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkFormatLedger +BenchmarkFormatLedger-4 26844 46222 ns/op 7281 B/op 243 allocs/op +PASS +ok ledger 1.746s diff --git a/go/ledger/coverage.out b/go/ledger/coverage.out index 4bbaf606..d6b20673 100644 --- a/go/ledger/coverage.out +++ b/go/ledger/coverage.out @@ -1,41 +1,39 @@ mode: count ledger/ledger.go:39.57,40.21 1 22 -ledger/ledger.go:44.2,52.28 7 21 -ledger/ledger.go:56.2,56.16 1 20 -ledger/ledger.go:67.2,67.20 1 20 ledger/ledger.go:40.21,42.3 1 1 +ledger/ledger.go:44.2,52.28 7 21 ledger/ledger.go:52.28,54.3 1 1 +ledger/ledger.go:56.2,56.16 1 20 ledger/ledger.go:57.15,58.47 1 2 ledger/ledger.go:60.15,61.47 1 18 ledger/ledger.go:63.10,64.63 1 0 +ledger/ledger.go:67.2,67.20 1 20 ledger/ledger.go:70.53,75.16 3 20 -ledger/ledger.go:86.2,86.20 1 18 ledger/ledger.go:76.15,77.71 1 2 ledger/ledger.go:79.15,80.64 1 16 ledger/ledger.go:82.10,83.61 1 2 +ledger/ledger.go:86.2,86.20 1 18 ledger/ledger.go:89.76,94.15 3 20 -ledger/ledger.go:99.2,99.16 1 20 -ledger/ledger.go:111.2,111.18 1 20 -ledger/ledger.go:122.2,122.23 1 18 -ledger/ledger.go:126.2,128.16 2 18 -ledger/ledger.go:136.2,140.20 3 18 -ledger/ledger.go:145.2,145.19 1 18 -ledger/ledger.go:149.2,149.39 1 18 -ledger/ledger.go:172.2,174.16 2 18 -ledger/ledger.go:190.2,190.29 1 18 ledger/ledger.go:94.15,97.3 2 9 +ledger/ledger.go:99.2,99.16 1 20 ledger/ledger.go:100.15,101.26 1 2 ledger/ledger.go:103.15,104.15 1 18 ledger/ledger.go:104.15,106.4 1 8 ledger/ledger.go:106.9,108.4 1 10 +ledger/ledger.go:111.2,111.18 1 20 ledger/ledger.go:112.13,113.28 1 1 ledger/ledger.go:115.13,116.26 1 17 ledger/ledger.go:118.10,119.44 1 2 +ledger/ledger.go:122.2,122.23 1 18 ledger/ledger.go:122.23,124.3 1 2 +ledger/ledger.go:126.2,128.16 2 18 ledger/ledger.go:129.15,130.40 1 2 ledger/ledger.go:132.15,133.40 1 16 +ledger/ledger.go:136.2,140.20 3 18 ledger/ledger.go:140.20,143.3 2 2 +ledger/ledger.go:145.2,145.19 1 18 ledger/ledger.go:145.19,147.3 1 18 +ledger/ledger.go:149.2,149.39 1 18 ledger/ledger.go:149.39,152.13 2 20 ledger/ledger.go:152.13,153.18 1 2 ledger/ledger.go:154.17,155.28 1 1 @@ -43,36 +41,38 @@ ledger/ledger.go:157.17,158.28 1 1 ledger/ledger.go:160.9,161.18 1 18 ledger/ledger.go:162.17,163.28 1 2 ledger/ledger.go:165.17,166.28 1 16 +ledger/ledger.go:172.2,174.16 2 18 ledger/ledger.go:175.15,176.15 1 2 -ledger/ledger.go:182.15,183.15 1 16 ledger/ledger.go:176.15,178.4 1 1 ledger/ledger.go:178.9,180.4 1 1 +ledger/ledger.go:182.15,183.15 1 16 ledger/ledger.go:183.15,185.4 1 8 ledger/ledger.go:185.9,187.4 1 8 +ledger/ledger.go:190.2,190.29 1 18 ledger/ledger.go:193.52,198.26 3 20 -ledger/ledger.go:202.2,204.18 2 20 -ledger/ledger.go:220.2,220.25 1 20 ledger/ledger.go:198.26,200.3 1 0 +ledger/ledger.go:202.2,204.18 2 20 ledger/ledger.go:204.18,207.26 2 5 -ledger/ledger.go:217.3,217.14 1 5 ledger/ledger.go:207.26,208.94 1 6 -ledger/ledger.go:212.4,212.91 1 6 ledger/ledger.go:208.94,209.13 1 0 +ledger/ledger.go:212.4,212.91 1 6 ledger/ledger.go:212.91,214.5 1 3 +ledger/ledger.go:217.3,217.14 1 5 +ledger/ledger.go:220.2,220.25 1 20 ledger/ledger.go:224.77,225.23 1 22 -ledger/ledger.go:231.2,233.16 2 20 -ledger/ledger.go:237.2,239.16 2 20 -ledger/ledger.go:243.2,247.36 3 18 -ledger/ledger.go:271.2,271.29 1 14 ledger/ledger.go:225.23,226.119 1 5 ledger/ledger.go:226.119,228.4 1 2 +ledger/ledger.go:231.2,233.16 2 20 ledger/ledger.go:233.16,235.3 1 0 +ledger/ledger.go:237.2,239.16 2 20 ledger/ledger.go:239.16,241.3 1 2 +ledger/ledger.go:243.2,247.36 3 18 ledger/ledger.go:247.36,250.34 2 22 -ledger/ledger.go:256.3,258.17 2 22 -ledger/ledger.go:262.3,264.17 2 20 -ledger/ledger.go:268.3,268.96 1 18 ledger/ledger.go:250.34,252.4 1 2 ledger/ledger.go:252.9,254.4 1 20 +ledger/ledger.go:256.3,258.17 2 22 ledger/ledger.go:258.17,260.4 1 2 +ledger/ledger.go:262.3,264.17 2 20 ledger/ledger.go:264.17,266.4 1 2 +ledger/ledger.go:268.3,268.96 1 18 +ledger/ledger.go:271.2,271.29 1 14 diff --git a/go/ledger/run-tests-go.txt b/go/ledger/run-tests-go.txt index 50ba9fba..39f31b2a 100644 --- a/go/ledger/run-tests-go.txt +++ b/go/ledger/run-tests-go.txt @@ -5,86 +5,502 @@ Go packages: ledger =============================================================================== -golangci-lint run ./... +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.026s +sys 0m0.030s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " ledger_test.go:291:14: Error return value is not checked (errcheck) FormatLedger("USD", "en-US", entries) ^ ledger_test.go:303:16: Error return value is not checked (errcheck) FormatLedger(tt.currency, tt.locale, tt.entries) ^ - -real 0m9.569s -user 0m19.126s -sys 0m3.935s +ledger.go:89: Function 'localizedCurrency' has too many statements (50 > 40) (funlen) +func localizedCurrency(locale, currency string, cents int) (string, error) { +ledger.go:57:7: string `nl-NL` has 8 occurrences, make it a constant (goconst) + case "nl-NL": + ^ +ledger.go:60:7: string `en-US` has 7 occurrences, make it a constant (goconst) + case "en-US": + ^ +ledger.go:168: File is not `gofumpt`-ed (gofumpt) + +ledger.go:232: File is not `gofumpt`-ed (gofumpt) + +ledger.go:238: File is not `gofumpt`-ed (gofumpt) + +ledger.go:1: line is 122 characters (lll) +// Package ledger prints a nicely formatted ledger, given a locale (American or Dutch) and a currency (US dollar or euro). +ledger_test.go:253:32: Using the variable on range scope `tc` in function literal (scopelint) + actual, err := FormatLedger(tc.currency, tc.locale, tc.entries) + ^ +ledger_test.go:255:78: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("FormatLedger for input named %q returned unexpected error %v", tc.name, err) + ^ +ledger_test.go:257:16: Using the variable on range scope `tc` in function literal (scopelint) + expected := tc.expected[1:] // Strip initial newline + ^ +ledger_test.go:268:27: Using the variable on range scope `tt` in function literal (scopelint) + _, err := FormatLedger(tt.currency, tt.locale, tt.entries) + ^ +ledger_test.go:270:67: Using the variable on range scope `tt` in function literal (scopelint) + t.Fatalf("FormatLedger for input %q expected error, got nil", tt.name) + ^ +ledger_test.go:292:2: if statements should only be cuddled with assignments (wsl) + if !reflect.DeepEqual(entries, entriesCopy) { + ^ +ledger_test.go:301:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +ledger_test.go:8:5: successTestCases is a global variable (gochecknoglobals) +var successTestCases = []struct { + ^ +ledger_test.go:194:5: failureTestCases is a global variable (gochecknoglobals) +var failureTestCases = []struct { + ^ +ledger.go:41:14: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"wrong size date\")" (goerr113) + return "", errors.New("wrong size date") + ^ +ledger.go:53:14: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"invalid date separator\")" (goerr113) + return "", errors.New("invalid date separator") + ^ +ledger.go:64:18: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"failed to render localized date\")" (goerr113) + return output, errors.New("failed to render localized date") + ^ +ledger.go:83:14: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"failed to render localized header\")" (goerr113) + return "", errors.New("failed to render localized header") + ^ +ledger.go:119:14: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"invalid currency\")" (goerr113) + return "", errors.New("invalid currency") + ^ +ledger.go:199:21: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"unable to copy the entries slice\")" (goerr113) + return []Entry{}, errors.New("unable to copy the entries slice") + ^ +ledger.go:40:18: mnd: Magic number: 10, in detected (gomnd) + if len(date) != 10 { + ^ +ledger.go:250:31: mnd: Magic number: 25, in detected (gomnd) + if len(entry.Description) > 25 { + ^ +ledger_test.go:250:1: Function TestFormatLedgerSuccess missing the call to method parallel (paralleltest) +func TestFormatLedgerSuccess(t *testing.T) { +^ +ledger_test.go:251:2: Range statement for test TestFormatLedgerSuccess missing the call to method parallel in test Run (paralleltest) + for _, tc := range successTestCases { + ^ +ledger_test.go:265:1: Function TestFormatLedgerFailure missing the call to method parallel (paralleltest) +func TestFormatLedgerFailure(t *testing.T) { +^ +ledger_test.go:266:2: Range statement for test TestFormatLedgerFailure missing the call to method parallel in test Run (paralleltest) + for _, tt := range failureTestCases { + ^ +ledger_test.go:276:1: Function TestFormatLedgerNotChangeInput missing the call to method parallel (paralleltest) +func TestFormatLedgerNotChangeInput(t *testing.T) { +^ +ledger_test.go:1:9: package should be `ledger_test` instead of `ledger` (testpackage) +package ledger + ^ +ledger.go:202:2: variable name 'es' is too short for the scope of its usage (varnamelen) + es := entriesCopy + ^ +ledger.go:46:2: variable name 'd1' is too short for the scope of its usage (varnamelen) + d1 := date[0:4] + ^ +ledger.go:207:7: variable name 'i' is too short for the scope of its usage (varnamelen) + for i, e := range rest { + ^ +ledger.go:48:2: variable name 'd3' is too short for the scope of its usage (varnamelen) + d3 := date[5:7] + ^ +ledger.go:50:2: variable name 'd5' is too short for the scope of its usage (varnamelen) + d5 := date[8:10] + ^ + +real 0m0.626s +user 0m1.069s +sys 0m0.577s + + + ============================================================================== + +Exit code: -1 + +real 0m0.672s +user 0m1.106s +sys 0m0.619s + +real 0m0.676s +user 0m1.108s +sys 0m0.621s =============================================================================== -golint ./... +Running: ../../.github/citools/go/go-lint-revive -real 0m0.096s -user 0m0.079s -sys 0m0.068s +Running Go Lint Revive -=============================================================================== +Go version: -revive -formatter=stylish ./... + go version go1.21.0 linux/amd64 -real 0m0.047s -user 0m0.032s -sys 0m0.016s + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.018s +sys 0m0.022s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.056s +user 0m0.041s +sys 0m0.031s + + + ============================================================================== + +Exit code: 0 + +real 0m0.089s +user 0m0.064s +sys 0m0.062s + +real 0m0.091s +user 0m0.065s +sys 0m0.063s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.285s -user 0m0.279s -sys 0m0.325s +real 0m0.001s +user 0m0.000s +sys 0m0.000s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.011s +sys 0m0.023s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." +internal error: package "errors" without types was imported from "ledger" + +real 0m0.088s +user 0m0.130s +sys 0m0.109s + -real 0m0.455s -user 0m0.519s -sys 0m0.412s + ============================================================================== + +Exit code: -1 + +real 0m0.122s +user 0m0.148s +sys 0m0.145s + +real 0m0.123s +user 0m0.150s +sys 0m0.145s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.032s +sys 0m0.036s + + + ============================================================================== -real 0m0.557s -user 0m0.514s -sys 0m0.455s +Running: staticcheck -checks=all ./... + + +real 0m0.161s +user 0m0.231s +sys 0m0.109s + + + ============================================================================== + +Exit code: 0 + +real 0m0.205s +user 0m0.270s +sys 0m0.155s + +real 0m0.207s +user 0m0.270s +sys 0m0.157s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.023s +sys 0m0.031s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.846s +user 0m2.068s +sys 0m0.280s + + + ============================================================================== + +Exit code: 0 + +real 0m0.881s +user 0m2.097s +sys 0m0.321s + +real 0m0.882s +user 0m2.098s +sys 0m0.321s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet -real 0m2.807s -user 0m4.748s -sys 0m1.332s +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.022s +sys 0m0.018s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.079s +user 0m0.140s +sys 0m0.106s + + + ============================================================================== + +Exit code: 0 + +real 0m0.121s +user 0m0.171s +sys 0m0.141s + +real 0m0.124s +user 0m0.172s +sys 0m0.142s =============================================================================== -go vet ./... +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.026s +sys 0m0.023s + + + ============================================================================== + +Running: go fix ./... + -real 0m0.296s -user 0m0.307s -sys 0m0.323s +real 0m0.025s +user 0m0.026s +sys 0m0.019s + + + ============================================================================== + +Exit code: 0 + +real 0m0.058s +user 0m0.058s +sys 0m0.050s + +real 0m0.060s +user 0m0.059s +sys 0m0.051s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.019s +sys 0m0.021s + -real 0m0.102s -user 0m0.093s -sys 0m0.121s + ============================================================================== + +Running: errcheck ./... + +ledger_test.go:291:14: FormatLedger("USD", "en-US", entries) +ledger_test.go:303:16: FormatLedger(tt.currency, tt.locale, tt.entries) + +real 0m0.445s +user 0m1.256s +sys 0m0.258s + + + ============================================================================== + +Exit code: -1 + +real 0m0.476s +user 0m1.282s +sys 0m0.286s + +real 0m0.478s +user 0m1.283s +sys 0m0.287s =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.014s +sys 0m0.036s + + + ============================================================================== + +Running: gocyclo . + 22 ledger localizedCurrency ledger.go:89:1 10 ledger sortEntries ledger.go:193:1 9 ledger FormatLedger ledger.go:224:1 @@ -95,33 +511,139 @@ gocyclo . 3 ledger localizedHeader ledger.go:70:1 2 ledger TestFormatLedgerNotChangeInput ledger_test.go:276:1 -real 0m0.020s -user 0m0.013s -sys 0m0.008s +real 0m0.003s +user 0m0.003s +sys 0m0.000s + + + ============================================================================== + +Exit code: 0 + +real 0m0.037s +user 0m0.021s +sys 0m0.047s + +real 0m0.039s +user 0m0.021s +sys 0m0.049s =============================================================================== -misspell . +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 -real 0m0.151s -user 0m0.121s -sys 0m0.087s + + ============================================================================== + +Running: misspell . + + +real 0m0.025s +user 0m0.025s +sys 0m0.012s + + + ============================================================================== + +Exit code: 0 + +real 0m0.036s +user 0m0.031s +sys 0m0.023s + +real 0m0.039s +user 0m0.031s +sys 0m0.025s =============================================================================== -gosec ./... -[gosec] 2022/08/31 21:15:29 Including rules: default -[gosec] 2022/08/31 21:15:29 Excluding rules: default -[gosec] 2022/08/31 21:15:29 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/ledger -2022/08/31 21:15:29 internal error: package "errors" without types was imported from "command-line-arguments" +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== -real 0m0.662s -user 0m0.703s -sys 0m0.498s +Running: go clean ./... + + +real 0m0.024s +user 0m0.023s +sys 0m0.033s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:24:38 Including rules: default +[gosec] 2023/09/07 00:24:38 Excluding rules: default +[gosec] 2023/09/07 00:24:38 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/ledger +[gosec] 2023/09/07 00:24:39 Checking package: ledger +[gosec] 2023/09/07 00:24:39 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/ledger/ledger.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 272 + Nosec : 0 + Issues : 0 + + +real 0m0.128s +user 0m0.158s +sys 0m0.107s + + + ============================================================================== + +Exit code: 0 + +real 0m0.163s +user 0m0.188s +sys 0m0.149s + +real 0m0.165s +user 0m0.188s +sys 0m0.150s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.029s +sys 0m0.028s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestFormatLedgerSuccess === RUN TestFormatLedgerSuccess/empty_ledger === RUN TestFormatLedgerSuccess/one_entry @@ -162,15 +684,17 @@ gotest -v -covermode=count -coverprofile coverage.out ./... --- PASS: TestFormatLedgerNotChangeInput (0.00s) PASS coverage: 96.2% of statements -ok ledger 0.020s coverage: 96.2% of statements +ok ledger 0.003s coverage: 96.2% of statements -real 0m0.814s -user 0m0.924s -sys 0m0.677s +real 0m0.186s +user 0m0.253s +sys 0m0.158s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + ledger/ledger.go:39: localizedDate 93.3% ledger/ledger.go:70: localizedHeader 100.0% ledger/ledger.go:89: localizedCurrency 100.0% @@ -178,21 +702,26 @@ ledger/ledger.go:193: sortEntries 85.7% ledger/ledger.go:224: FormatLedger 95.8% total: (statements) 96.2% -real 0m0.219s -user 0m0.222s -sys 0m0.238s +real 0m0.057s +user 0m0.084s +sys 0m0.089s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.288s -user 0m0.241s -sys 0m0.306s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +real 0m0.053s +user 0m0.079s +sys 0m0.082s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt 224 func FormatLedger(currency, locale string, entries []Entry) (string, error) { 225 if len(entries) == 0 { @@ -308,13 +837,19 @@ gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annota 221 } -real 0m0.106s -user 0m0.072s -sys 0m0.095s +real 0m0.022s +user 0m0.019s +sys 0m0.030s -=============================================================================== +real 0m0.022s +user 0m0.019s +sys 0m0.030s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestFormatLedgerSuccess === RUN TestFormatLedgerSuccess/empty_ledger === RUN TestFormatLedgerSuccess/one_entry @@ -355,27 +890,43 @@ gotest -v -race -covermode=atomic ./... --- PASS: TestFormatLedgerNotChangeInput (0.00s) PASS coverage: 96.2% of statements -ok ledger 0.037s coverage: 96.2% of statements +ok ledger 1.015s coverage: 96.2% of statements + +real 0m1.267s +user 0m0.302s +sys 0m0.190s + + + ============================================================================== -real 0m0.904s -user 0m0.908s -sys 0m0.603s +Exit code: 0 + +real 0m1.628s +user 0m0.771s +sys 0m0.588s + +real 0m1.630s +user 0m0.772s +sys 0m0.589s =============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: ledger -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkFormatLedger -BenchmarkFormatLedger-4 26844 46222 ns/op 7281 B/op 243 allocs/op +BenchmarkFormatLedger-8 79789 12738 ns/op 7282 B/op 243 allocs/op PASS -ok ledger 1.746s +ok ledger 1.173s -real 0m2.249s -user 0m3.036s -sys 0m0.590s +real 0m1.315s +user 0m1.402s +sys 0m0.166s =============================================================================== @@ -419,23 +970,63 @@ gotest -v -tags bonus === RUN TestFormatLedgerNotChangeInput --- PASS: TestFormatLedgerNotChangeInput (0.00s) PASS -ok ledger 0.015s +ok ledger 0.002s -real 0m0.531s -user 0m0.591s -sys 0m0.405s +real 0m0.132s +user 0m0.178s +sys 0m0.142s =============================================================================== -No old benchmarks to run benchstat against. +benchstat benchstat-old.txt benchstat-new.txt +benchstat-old.txt:5: missing iteration count +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: ledger +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +FormatLedger-8 12.74µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +FormatLedger-8 7.111Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +FormatLedger-8 243.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +FormatLedger-4 46.22µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ B/op │ +FormatLedger-4 7.110Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ allocs/op │ +FormatLedger-4 243.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + +real 0m0.003s +user 0m0.001s +sys 0m0.001s =============================================================================== gomarkdoc --output ledger-doc.md -real 0m0.058s -user 0m0.038s -sys 0m0.049s +real 0m0.011s +user 0m0.004s +sys 0m0.007s =============================================================================== @@ -461,9 +1052,9 @@ type Entry struct { Entry type consists of a date, description and change. -real 0m0.208s -user 0m0.125s -sys 0m0.208s +real 0m0.038s +user 0m0.025s +sys 0m0.043s =============================================================================== diff --git a/go/list-ops/benchstat-old.txt b/go/list-ops/benchstat-old.txt index 5c4fca8b..d610e652 100644 --- a/go/list-ops/benchstat-old.txt +++ b/go/list-ops/benchstat-old.txt @@ -1,2 +1,2 @@ PASS -ok listops 0.016s +ok listops 0.002s diff --git a/go/list-ops/run-tests-go.txt b/go/list-ops/run-tests-go.txt index 6674ef93..d5ca73a7 100644 --- a/go/list-ops/run-tests-go.txt +++ b/go/list-ops/run-tests-go.txt @@ -5,17 +5,39 @@ Go packages: listops =============================================================================== -golangci-lint run --enable-all ./... +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.009s +sys 0m0.009s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." -level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." -level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." -level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " -level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." -level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " list_ops.go:4:82: Comment should end in a period (godot) // IntList is an abstraction of a list of integers which we can define methods on ^ @@ -137,32 +159,58 @@ package listops list_ops_test.go:1:9: package should be `listops_test` instead of `listops` (testpackage) package listops ^ -list_ops_test.go:108:6: variable name 'tt' is too short for the scope of its usage (varnamelen) - for _, tt := range filterTestCases { - ^ list_ops.go:92:2: variable name 'r' is too short for the scope of its usage (varnamelen) r := s ^ list_ops.go:70:2: variable name 'r' is too short for the scope of its usage (varnamelen) r := IntList{} ^ +list_ops_test.go:108:6: variable name 'tt' is too short for the scope of its usage (varnamelen) + for _, tt := range filterTestCases { + ^ -real 0m0.787s -user 0m1.314s -sys 0m0.735s +real 0m0.557s +user 0m0.829s +sys 0m0.537s -=============================================================================== -golint ./... -list_ops.go:18:1: comment on exported method IntList.Foldr should be of the form "Foldr ..." + ============================================================================== -real 0m0.008s -user 0m0.004s -sys 0m0.004s +Exit code: -1 + +real 0m0.585s +user 0m0.843s +sys 0m0.558s + +real 0m0.586s +user 0m0.845s +sys 0m0.558s =============================================================================== -revive -formatter=stylish ./... +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.006s +sys 0m0.011s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + list_ops.go (18, 1) https://revive.run/r#exported comment on exported method IntList.Foldr should be of the form "Foldr ..." (22, 8) https://revive.run/r#var-declaration should omit type IntList from declaration of var r; it will be inferred from the right-hand side @@ -172,40 +220,150 @@ list_ops.go ✖ 4 problems (0 errors) (4 warnings) -real 0m0.040s -user 0m0.021s -sys 0m0.031s +real 0m0.058s +user 0m0.041s +sys 0m0.034s + + + ============================================================================== + +Exit code: 0 + +real 0m0.085s +user 0m0.054s +sys 0m0.055s + +real 0m0.088s +user 0m0.055s +sys 0m0.057s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.093s -user 0m0.169s -sys 0m0.143s +real 0m0.001s +user 0m0.000s +sys 0m0.000s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.006s +sys 0m0.012s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." internal error: package "fmt" without types was imported from "listops [listops.test]" -real 0m0.113s -user 0m0.181s -sys 0m0.198s +real 0m0.111s +user 0m0.162s +sys 0m0.125s + + + ============================================================================== + +Exit code: -1 + +real 0m0.136s +user 0m0.177s +sys 0m0.142s + +real 0m0.138s +user 0m0.178s +sys 0m0.143s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.015s +sys 0m0.014s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +list_ops.go:18:1: comment on exported method Foldr should be of the form "Foldr ..." (ST1020) +list_ops.go:22:8: should omit type IntList from declaration; it will be inferred from the right-hand side (ST1023) +list_ops.go:35:8: should omit type IntList from declaration; it will be inferred from the right-hand side (ST1023) +list_ops.go:57:8: should omit type IntList from declaration; it will be inferred from the right-hand side (ST1023) list_ops.go:95:3: should replace loop with r = append(r, l...) (S1011) -real 0m0.180s -user 0m0.272s -sys 0m0.179s +real 0m0.188s +user 0m0.223s +sys 0m0.175s + + + ============================================================================== + +Exit code: -1 + +real 0m0.225s +user 0m0.241s +sys 0m0.203s + +real 0m0.226s +user 0m0.241s +sys 0m0.205s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.009s +sys 0m0.007s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + ./list_ops.go:9:2: commentedOutCode: may want to remove commented-out code ./list_ops.go:20:2: commentedOutCode: may want to remove commented-out code ./list_ops.go:33:2: commentedOutCode: may want to remove commented-out code @@ -216,13 +374,48 @@ gocritic check -enableAll ./... ./list_ops.go:83:2: commentedOutCode: may want to remove commented-out code ./list_ops.go:90:2: commentedOutCode: may want to remove commented-out code -real 0m0.802s -user 0m2.182s -sys 0m0.407s +real 0m0.834s +user 0m2.012s +sys 0m0.239s + + + ============================================================================== + +Exit code: -1 + +real 0m0.857s +user 0m2.025s +sys 0m0.256s + +real 0m0.859s +user 0m2.026s +sys 0m0.258s =============================================================================== -go vet ./... +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.005s +sys 0m0.020s + + + ============================================================================== + +Running: go vet ./... + # listops ./list_ops_examples_test.go:7:1: ExampleFoldl refers to unknown identifier: Foldl ./list_ops_examples_test.go:17:1: ExampleFoldr refers to unknown identifier: Foldr @@ -231,29 +424,134 @@ go vet ./... ./list_ops_examples_test.go:53:1: ExampleReverse refers to unknown identifier: Reverse ./list_ops_examples_test.go:70:1: ExampleConcat refers to unknown identifier: Concat -real 0m0.095s -user 0m0.195s -sys 0m0.189s +real 0m0.087s +user 0m0.110s +sys 0m0.096s + + + ============================================================================== + +Exit code: -1 + +real 0m0.118s +user 0m0.121s +sys 0m0.125s + +real 0m0.119s +user 0m0.122s +sys 0m0.126s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 -real 0m0.019s -user 0m0.011s -sys 0m0.012s + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.005s +sys 0m0.009s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.017s +user 0m0.009s +sys 0m0.011s + + + ============================================================================== + +Exit code: 0 + +real 0m0.039s +user 0m0.022s +sys 0m0.028s + +real 0m0.041s +user 0m0.022s +sys 0m0.030s =============================================================================== -errcheck ./... +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... -real 0m0.424s -user 0m1.391s -sys 0m0.323s + +real 0m0.018s +user 0m0.008s +sys 0m0.016s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.461s +user 0m1.354s +sys 0m0.290s + + + ============================================================================== + +Exit code: 0 + +real 0m0.493s +user 0m1.373s +sys 0m0.312s + +real 0m0.495s +user 0m1.375s +sys 0m0.312s =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.004s +sys 0m0.011s + + + ============================================================================== + +Running: gocyclo . + 4 listops TestFold list_ops_test.go:66:1 3 listops TestConcatMethod list_ops_test.go:284:1 3 listops TestAppendMethod list_ops_test.go:249:1 @@ -278,26 +576,86 @@ gocyclo . 1 listops (IntList).Append list_ops.go:82:1 1 listops (IntList).Length list_ops.go:47:1 -real 0m0.003s -user 0m0.002s +real 0m0.002s +user 0m0.001s sys 0m0.001s + + ============================================================================== + +Exit code: 0 + +real 0m0.022s +user 0m0.009s +sys 0m0.019s + +real 0m0.023s +user 0m0.011s +sys 0m0.020s + =============================================================================== -misspell . +Running: ../../.github/citools/go/go-lint-misspell -real 0m0.026s -user 0m0.030s -sys 0m0.016s +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.024s +user 0m0.024s +sys 0m0.012s + + + ============================================================================== + +Exit code: 0 + +real 0m0.033s +user 0m0.027s +sys 0m0.021s + +real 0m0.036s +user 0m0.027s +sys 0m0.023s =============================================================================== -gosec ./... -[gosec] 2023/04/03 23:02:14 Including rules: default -[gosec] 2023/04/03 23:02:14 Excluding rules: default -[gosec] 2023/04/03 23:02:14 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/list-ops -[gosec] 2023/04/03 23:02:14 Checking package: listops -[gosec] 2023/04/03 23:02:14 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/list-ops/list_ops.go +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.010s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:24:44 Including rules: default +[gosec] 2023/09/07 00:24:44 Excluding rules: default +[gosec] 2023/09/07 00:24:44 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/list-ops +[gosec] 2023/09/07 00:24:44 Checking package: listops +[gosec] 2023/09/07 00:24:44 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/list-ops/list_ops.go Results: @@ -309,13 +667,48 @@ Results: Issues : 0 -real 0m0.084s -user 0m0.060s -sys 0m0.073s +real 0m0.103s +user 0m0.100s +sys 0m0.049s + + + ============================================================================== + +Exit code: 0 + +real 0m0.124s +user 0m0.111s +sys 0m0.067s + +real 0m0.126s +user 0m0.112s +sys 0m0.068s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.010s +sys 0m0.010s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestFold list_ops_test.go:77: PASS: foldl: empty list list_ops_test.go:77: PASS: foldl: direction independent function applied to non-empty list @@ -366,16 +759,18 @@ gotest -v -covermode=count -coverprofile coverage.out ./... === RUN ExampleConcat --- PASS: ExampleConcat (0.00s) PASS - listops coverage: 100.0% of statements +coverage: 100.0% of statements ok listops 0.003s coverage: 100.0% of statements -real 0m0.227s -user 0m0.309s -sys 0m0.190s +real 0m0.183s +user 0m0.248s +sys 0m0.159s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + listops/list_ops.go:8: Foldl 100.0% listops/list_ops.go:19: Foldr 100.0% listops/list_ops.go:32: Filter 100.0% @@ -386,29 +781,40 @@ listops/list_ops.go:82: Append 100.0% listops/list_ops.go:89: Concat 100.0% total: (statements) 100.0% -real 0m0.023s -user 0m0.014s -sys 0m0.015s +real 0m0.029s +user 0m0.015s +sys 0m0.021s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.022s -user 0m0.017s -sys 0m0.012s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +real 0m0.031s +user 0m0.011s +sys 0m0.027s -real 0m0.009s -user 0m0.001s + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.012s +user 0m0.002s +sys 0m0.013s + +real 0m0.012s +user 0m0.002s sys 0m0.013s -=============================================================================== -gotest -v -race -covermode=atomic ./... + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestFold list_ops_test.go:77: PASS: foldl: empty list list_ops_test.go:77: PASS: foldl: direction independent function applied to non-empty list @@ -459,12 +865,25 @@ gotest -v -race -covermode=atomic ./... === RUN ExampleConcat --- PASS: ExampleConcat (0.00s) PASS - listops coverage: 100.0% of statements -ok listops 0.025s coverage: 100.0% of statements +coverage: 100.0% of statements +ok listops 1.013s coverage: 100.0% of statements + +real 0m1.258s +user 0m0.285s +sys 0m0.140s + -real 0m0.315s -user 0m0.375s -sys 0m0.287s + ============================================================================== + +Exit code: 0 + +real 0m1.540s +user 0m0.575s +sys 0m0.382s + +real 0m1.542s +user 0m0.577s +sys 0m0.382s =============================================================================== @@ -475,9 +894,9 @@ gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt PASS ok listops 0.002s -real 0m0.180s -user 0m0.308s -sys 0m0.271s +real 0m0.157s +user 0m0.176s +sys 0m0.121s =============================================================================== @@ -532,11 +951,11 @@ gotest -v -tags bonus === RUN ExampleConcat --- PASS: ExampleConcat (0.00s) PASS -ok listops 0.002s +ok listops 0.003s -real 0m0.162s -user 0m0.269s -sys 0m0.238s +real 0m0.184s +user 0m0.271s +sys 0m0.163s =============================================================================== @@ -550,9 +969,9 @@ sys 0m0.002s gomarkdoc --output listops-doc.md -real 0m0.012s -user 0m0.008s -sys 0m0.004s +real 0m0.021s +user 0m0.016s +sys 0m0.007s =============================================================================== @@ -592,9 +1011,9 @@ func (s IntList) Reverse() IntList Reverse returns a reversed list. -real 0m0.030s -user 0m0.015s -sys 0m0.023s +real 0m0.032s +user 0m0.013s +sys 0m0.026s =============================================================================== diff --git a/go/logs-logs-logs/benchstat-new.txt b/go/logs-logs-logs/benchstat-new.txt index 788578be..cb54e94f 100644 --- a/go/logs-logs-logs/benchstat-new.txt +++ b/go/logs-logs-logs/benchstat-new.txt @@ -1,2 +1,2 @@ PASS -ok logs 0.025s +ok logs 0.003s diff --git a/go/logs-logs-logs/benchstat-old.txt b/go/logs-logs-logs/benchstat-old.txt new file mode 100644 index 00000000..788578be --- /dev/null +++ b/go/logs-logs-logs/benchstat-old.txt @@ -0,0 +1,2 @@ +PASS +ok logs 0.025s diff --git a/go/logs-logs-logs/coverage-annotations.txt b/go/logs-logs-logs/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/logs-logs-logs/coverage.out b/go/logs-logs-logs/coverage.out index b7b84b53..f0f09c02 100644 --- a/go/logs-logs-logs/coverage.out +++ b/go/logs-logs-logs/coverage.out @@ -1,11 +1,11 @@ mode: count logs/logs_logs_logs.go:9.37,12.27 2 11 -logs/logs_logs_logs.go:27.2,27.15 1 11 logs/logs_logs_logs.go:12.27,13.15 1 60 -logs/logs_logs_logs.go:22.3,22.26 1 60 logs/logs_logs_logs.go:14.14,15.29 1 4 logs/logs_logs_logs.go:16.15,17.21 1 3 logs/logs_logs_logs.go:18.14,19.22 1 3 +logs/logs_logs_logs.go:22.3,22.26 1 60 logs/logs_logs_logs.go:22.26,23.9 1 10 +logs/logs_logs_logs.go:27.2,27.15 1 11 logs/logs_logs_logs.go:32.56,34.2 1 4 logs/logs_logs_logs.go:38.46,40.2 1 7 diff --git a/go/logs-logs-logs/logs-doc.md b/go/logs-logs-logs/logs-doc.md index 4126afed..81429785 100755 --- a/go/logs-logs-logs/logs-doc.md +++ b/go/logs-logs-logs/logs-doc.md @@ -19,7 +19,7 @@ import "logs" func Application(log string) string ``` -Application identifies the application emitting the given log\. +Application identifies the application emitting the given log.

Example

@@ -52,7 +52,7 @@ weather func Replace(log string, oldRune, newRune rune) string ``` -Replace replaces all occurrences of old with new\, returning the modified log to the caller\. +Replace replaces all occurrences of old with new, returning the modified log to the caller.

Example

@@ -81,7 +81,7 @@ please replace '👍' with '👍' func WithinLimit(log string, limit int) bool ``` -WithinLimit determines whether or not the number of characters in log is within the limit\. +WithinLimit determines whether or not the number of characters in log is within the limit.

Example

diff --git a/go/logs-logs-logs/run-tests-go.txt b/go/logs-logs-logs/run-tests-go.txt index 38d0c833..e0ba4ba3 100644 --- a/go/logs-logs-logs/run-tests-go.txt +++ b/go/logs-logs-logs/run-tests-go.txt @@ -5,15 +5,584 @@ Go packages: logs =============================================================================== -golint logs +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.035s +user 0m0.018s +sys 0m0.031s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +logs_logs_logs.go:10:13: var-declaration: should omit type string from declaration of var result; it will be inferred from the right-hand side (revive) + var result string = "default" + ^ +logs_logs_logs_test.go:52:26: Using the variable on range scope `tt` in function literal (scopelint) + if got := Application(tt.log); got != tt.want { + ^ +logs_logs_logs_test.go:53:59: Using the variable on range scope `tt` in function literal (scopelint) + t.Errorf("Application(\"%s\") = \"%s\", want \"%s\"", tt.log, got, tt.want) + ^ +logs_logs_logs_test.go:92:22: Using the variable on range scope `tt` in function literal (scopelint) + if got := Replace(tt.log, tt.oldChar, tt.newChar); got != tt.want { + ^ +logs_logs_logs_examples_test.go:14:2: Duplicate words (recommendation) found (dupword) + // recommendation + ^ +logs_logs_logs_test.go:7:1: Function TestApplication missing the call to method parallel (paralleltest) +func TestApplication(t *testing.T) { +^ +logs_logs_logs_test.go:50:2: Range statement for test TestApplication missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +logs_logs_logs_test.go:59:1: Function TestReplace missing the call to method parallel (paralleltest) +func TestReplace(t *testing.T) { +^ +logs_logs_logs_test.go:90:2: Range statement for test TestReplace missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +logs_logs_logs_test.go:99:1: Function TestWithinLimit missing the call to method parallel (paralleltest) +func TestWithinLimit(t *testing.T) { +^ +logs_logs_logs_test.go:144:2: Range statement for test TestWithinLimit missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +logs_logs_logs_examples_test.go:1:9: package should be `logs_test` instead of `logs` (testpackage) +package logs + ^ +logs_logs_logs_test.go:1:9: package should be `logs_test` instead of `logs` (testpackage) +package logs + ^ + +real 0m0.532s +user 0m0.773s +sys 0m0.498s + + + ============================================================================== + +Exit code: -1 + +real 0m0.588s +user 0m0.797s +sys 0m0.550s + +real 0m0.591s +user 0m0.799s +sys 0m0.551s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.012s +sys 0m0.016s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +logs_logs_logs.go + (1, 1) https://revive.run/r#package-comments should have a package comment + (10, 13) https://revive.run/r#var-declaration should omit type string from declaration of var result; it will be inferred from the right-hand side + + + ✖ 2 problems (0 errors) (2 warnings) + +real 0m0.057s +user 0m0.026s +sys 0m0.047s + + + ============================================================================== + +Exit code: 0 + +real 0m0.087s +user 0m0.042s +sys 0m0.072s + +real 0m0.089s +user 0m0.042s +sys 0m0.075s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.016s +sys 0m0.025s -real 0m0.161s -user 0m0.114s -sys 0m0.145s + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "strings" without types was imported from "logs" + +real 0m0.105s +user 0m0.142s +sys 0m0.137s + + + ============================================================================== + +Exit code: -1 + +real 0m0.156s +user 0m0.174s +sys 0m0.178s + +real 0m0.158s +user 0m0.175s +sys 0m0.179s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.011s +sys 0m0.024s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +logs_logs_logs.go:1:1: at least one file in a package should have a package comment (ST1000) +logs_logs_logs.go:10:13: should omit type string from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.192s +user 0m0.234s +sys 0m0.169s + + + ============================================================================== + +Exit code: -1 + +real 0m0.236s +user 0m0.251s +sys 0m0.215s + +real 0m0.238s +user 0m0.252s +sys 0m0.215s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out logs +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.010s +sys 0m0.015s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.825s +user 0m1.962s +sys 0m0.255s + + + ============================================================================== + +Exit code: 0 + +real 0m0.853s +user 0m1.979s +sys 0m0.278s + +real 0m0.854s +user 0m1.980s +sys 0m0.278s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.024s +sys 0m0.022s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.079s +user 0m0.132s +sys 0m0.089s + + + ============================================================================== + +Exit code: 0 + +real 0m0.121s +user 0m0.160s +sys 0m0.121s + +real 0m0.123s +user 0m0.162s +sys 0m0.121s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.016s +sys 0m0.020s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.029s +user 0m0.018s +sys 0m0.023s + + + ============================================================================== + +Exit code: 0 + +real 0m0.065s +user 0m0.039s +sys 0m0.053s + +real 0m0.067s +user 0m0.041s +sys 0m0.053s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.014s +sys 0m0.017s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.452s +user 0m1.194s +sys 0m0.280s + + + ============================================================================== + +Exit code: 0 + +real 0m0.492s +user 0m1.213s +sys 0m0.313s + +real 0m0.493s +user 0m1.213s +sys 0m0.314s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.009s +sys 0m0.020s + + + ============================================================================== + +Running: gocyclo . + +6 logs Application logs_logs_logs.go:9:1 +3 logs TestWithinLimit logs_logs_logs_test.go:99:1 +3 logs TestReplace logs_logs_logs_test.go:59:1 +3 logs TestApplication logs_logs_logs_test.go:7:1 +1 logs ExampleWithinLimit logs_logs_logs_examples_test.go:27:1 +1 logs ExampleReplace logs_logs_logs_examples_test.go:19:1 +1 logs ExampleApplication logs_logs_logs_examples_test.go:7:1 +1 logs WithinLimit logs_logs_logs.go:38:1 +1 logs Replace logs_logs_logs.go:32:1 + +real 0m0.002s +user 0m0.000s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.033s +user 0m0.017s +sys 0m0.029s + +real 0m0.035s +user 0m0.018s +sys 0m0.029s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.036s +user 0m0.043s +sys 0m0.017s + + + ============================================================================== + +Exit code: 0 + +real 0m0.051s +user 0m0.049s +sys 0m0.030s + +real 0m0.053s +user 0m0.050s +sys 0m0.032s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.009s +sys 0m0.015s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:24:49 Including rules: default +[gosec] 2023/09/07 00:24:49 Excluding rules: default +[gosec] 2023/09/07 00:24:49 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/logs-logs-logs +[gosec] 2023/09/07 00:24:49 Checking package: logs +[gosec] 2023/09/07 00:24:49 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/logs-logs-logs/logs_logs_logs.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 40 + Nosec : 0 + Issues : 0 + + +real 0m0.112s +user 0m0.098s +sys 0m0.092s + + + ============================================================================== + +Exit code: 0 + +real 0m0.144s +user 0m0.118s +sys 0m0.118s + +real 0m0.146s +user 0m0.118s +sys 0m0.120s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.016s +sys 0m0.031s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestApplication === RUN TestApplication/single_character_recommendation === RUN TestApplication/single_character_search @@ -60,35 +629,56 @@ go test -v -covermode=count -coverprofile coverage.out logs --- PASS: ExampleWithinLimit (0.00s) PASS coverage: 100.0% of statements -ok logs 0.009s coverage: 100.0% of statements +ok logs 0.004s coverage: 100.0% of statements -real 0m0.632s -user 0m0.703s -sys 0m0.416s +real 0m0.183s +user 0m0.229s +sys 0m0.160s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + logs/logs_logs_logs.go:9: Application 100.0% logs/logs_logs_logs.go:32: Replace 100.0% logs/logs_logs_logs.go:38: WithinLimit 100.0% total: (statements) 100.0% -real 0m0.182s -user 0m0.169s -sys 0m0.143s +real 0m0.055s +user 0m0.071s +sys 0m0.072s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.190s -user 0m0.137s -sys 0m0.158s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic logs +real 0m0.054s +user 0m0.076s +sys 0m0.074s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.020s +user 0m0.017s +sys 0m0.013s + +real 0m0.020s +user 0m0.017s +sys 0m0.013s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestApplication === RUN TestApplication/single_character_recommendation === RUN TestApplication/single_character_search @@ -97,7 +687,7 @@ go test -v -race -covermode=atomic logs === RUN TestApplication/multiple_characters_recommendation(1/3) === RUN TestApplication/multiple_characters_recommendation(2/3) === RUN TestApplication/multiple_characters_recommendation(3/3) ---- PASS: TestApplication (0.01s) +--- PASS: TestApplication (0.00s) --- PASS: TestApplication/single_character_recommendation (0.00s) --- PASS: TestApplication/single_character_search (0.00s) --- PASS: TestApplication/single_character_weather (0.00s) @@ -135,71 +725,107 @@ go test -v -race -covermode=atomic logs --- PASS: ExampleWithinLimit (0.00s) PASS coverage: 100.0% of statements -ok logs 0.053s coverage: 100.0% of statements - -real 0m0.627s -user 0m0.638s -sys 0m0.450s +ok logs 1.015s coverage: 100.0% of statements -=============================================================================== +real 0m1.261s +user 0m0.291s +sys 0m0.186s -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -PASS -ok logs 0.025s -real 0m0.455s -user 0m0.532s -sys 0m0.313s + ============================================================================== -=============================================================================== +Exit code: 0 -go test -tags bonus -PASS -ok logs 0.006s +real 0m1.624s +user 0m0.707s +sys 0m0.552s -real 0m0.568s -user 0m0.640s -sys 0m0.398s +real 0m1.626s +user 0m0.710s +sys 0m0.552s =============================================================================== -No old benchmarks to run benchstat against. +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -=============================================================================== - -go vet logs +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok logs 0.003s -real 0m0.334s -user 0m0.389s -sys 0m0.348s +real 0m0.184s +user 0m0.243s +sys 0m0.186s =============================================================================== -go fix logs +gotest -v -tags bonus +=== RUN TestApplication +=== RUN TestApplication/single_character_recommendation +=== RUN TestApplication/single_character_search +=== RUN TestApplication/single_character_weather +=== RUN TestApplication/no_characters_default +=== RUN TestApplication/multiple_characters_recommendation(1/3) +=== RUN TestApplication/multiple_characters_recommendation(2/3) +=== RUN TestApplication/multiple_characters_recommendation(3/3) +--- PASS: TestApplication (0.00s) + --- PASS: TestApplication/single_character_recommendation (0.00s) + --- PASS: TestApplication/single_character_search (0.00s) + --- PASS: TestApplication/single_character_weather (0.00s) + --- PASS: TestApplication/no_characters_default (0.00s) + --- PASS: TestApplication/multiple_characters_recommendation(1/3) (0.00s) + --- PASS: TestApplication/multiple_characters_recommendation(2/3) (0.00s) + --- PASS: TestApplication/multiple_characters_recommendation(3/3) (0.00s) +=== RUN TestReplace +=== RUN TestReplace/single_occurrence_of_replacement +=== RUN TestReplace/multiple_occurrences_of_replacement +=== RUN TestReplace/no_occurrences_of_replacement +--- PASS: TestReplace (0.00s) + --- PASS: TestReplace/single_occurrence_of_replacement (0.00s) + --- PASS: TestReplace/multiple_occurrences_of_replacement (0.00s) + --- PASS: TestReplace/no_occurrences_of_replacement (0.00s) +=== RUN TestWithinLimit +=== RUN TestWithinLimit/exact_limit +=== RUN TestWithinLimit/under_limit +=== RUN TestWithinLimit/over_limit +=== RUN TestWithinLimit/exact_limit#01 +=== RUN TestWithinLimit/under_limit#01 +=== RUN TestWithinLimit/over_limit#01 +--- PASS: TestWithinLimit (0.00s) + --- PASS: TestWithinLimit/exact_limit (0.00s) + --- PASS: TestWithinLimit/under_limit (0.00s) + --- PASS: TestWithinLimit/over_limit (0.00s) + --- PASS: TestWithinLimit/exact_limit#01 (0.00s) + --- PASS: TestWithinLimit/under_limit#01 (0.00s) + --- PASS: TestWithinLimit/over_limit#01 (0.00s) +=== RUN ExampleApplication +--- PASS: ExampleApplication (0.00s) +=== RUN ExampleReplace +--- PASS: ExampleReplace (0.00s) +=== RUN ExampleWithinLimit +--- PASS: ExampleWithinLimit (0.00s) +PASS +ok logs 0.001s -real 0m0.103s -user 0m0.059s -sys 0m0.090s +real 0m0.138s +user 0m0.188s +sys 0m0.140s =============================================================================== -gosec ./logs-logs-logs -[gosec] 2022/07/26 07:40:40 Including rules: default -[gosec] 2022/07/26 07:40:40 Excluding rules: default -[gosec] 2022/07/26 07:40:40 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/logs-logs-logs -2022/07/26 07:40:40 internal error: package "strings" without types was imported from "command-line-arguments" +benchstat benchstat-old.txt benchstat-new.txt -real 0m0.342s -user 0m0.344s -sys 0m0.266s +real 0m0.002s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output logs-doc.md -real 0m0.031s -user 0m0.027s -sys 0m0.009s +real 0m0.011s +user 0m0.004s +sys 0m0.007s =============================================================================== @@ -221,9 +847,9 @@ func WithinLimit(log string, limit int) bool within the limit. -real 0m0.184s -user 0m0.108s -sys 0m0.121s +real 0m0.046s +user 0m0.021s +sys 0m0.044s =============================================================================== diff --git a/go/luhn/benchstat-new.txt b/go/luhn/benchstat-new.txt index 206322d0..5f7eebb4 100644 --- a/go/luhn/benchstat-new.txt +++ b/go/luhn/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: luhn -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkValid-4 8918 181183 ns/op 56865 B/op 1647 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkValid +BenchmarkValid-8 18520 65309 ns/op 56568 B/op 1495 allocs/op PASS -ok luhn 2.204s +ok luhn 1.874s diff --git a/go/luhn/benchstat-old.txt b/go/luhn/benchstat-old.txt index 416b66d5..206322d0 100644 --- a/go/luhn/benchstat-old.txt +++ b/go/luhn/benchstat-old.txt @@ -2,6 +2,6 @@ goos: linux goarch: amd64 pkg: luhn cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkValid-4 118347 14628 ns/op 3528 B/op 136 allocs/op +BenchmarkValid-4 8918 181183 ns/op 56865 B/op 1647 allocs/op PASS -ok luhn 1.856s +ok luhn 2.204s diff --git a/go/luhn/coverage-annotations.txt b/go/luhn/coverage-annotations.txt new file mode 100644 index 00000000..07ff4b32 --- /dev/null +++ b/go/luhn/coverage-annotations.txt @@ -0,0 +1,72 @@ + +48 func Valid(id string) bool { +49 var sum int +50 +51 dPrint("id", id) +52 +53 // 0. remove spaces from the string +54 id = strings.ReplaceAll(id, " ", "") +55 +56 // 1. is the string is valid? +57 if !isValidInput(id) { +58 return false +59 } +60 +61 dPrint("id", id) +62 +63 di := reverse(id) +64 +65 dPrint("di", di) +66 +67 // 2. reverse the string +68 // 3. double numbers with index 1, 3, 5, ... +69 // 4. if the doubled number is > 9, subtract 9 from it +70 // 5. sum the numbers. +71 for i, r := range di { +72 dPrint("r", string(r)) +73 s := string(r) +74 n, e := strconv.Atoi(s) +75 +76 if e != nil { +77 MISS panic(e) +78 } +79 +80 if i%2 != 0 { +81 n *= 2 +82 +83 if n > 9 { +84 n -= 9 +85 } +86 } +87 +88 dPrint("n", n) +89 +90 sum += n +91 } +92 +93 // 6. if the sum is divisible by 10, it's valid +94 return sum%10 == 0 +95 } + + +15 func dPrint(s string, a ...interface{}) { +16 if debug { +17 MISS fmt.Println("DEBUG:", s, "=", a) +18 } +19 } + + +33 func isValidInput(s string) bool { +34 if len(s) <= 1 { +35 return false +36 } +37 +38 m, e := regexp.MatchString(`^[0-9]+$`, s) +39 +40 if e != nil { +41 MISS panic(e) +42 } +43 +44 return m +45 } + diff --git a/go/luhn/coverage.out b/go/luhn/coverage.out index 81f0c63c..c2753ced 100644 --- a/go/luhn/coverage.out +++ b/go/luhn/coverage.out @@ -2,20 +2,20 @@ mode: count luhn/luhn.go:15.41,16.11 1 438 luhn/luhn.go:16.11,18.3 1 0 luhn/luhn.go:22.31,25.22 2 17 -luhn/luhn.go:29.2,29.10 1 17 luhn/luhn.go:25.22,27.3 1 189 +luhn/luhn.go:29.2,29.10 1 17 luhn/luhn.go:33.34,34.17 1 26 -luhn/luhn.go:38.2,40.14 2 23 -luhn/luhn.go:44.2,44.10 1 23 luhn/luhn.go:34.17,36.3 1 3 +luhn/luhn.go:38.2,40.14 2 23 luhn/luhn.go:40.14,41.11 1 0 +luhn/luhn.go:44.2,44.10 1 23 luhn/luhn.go:48.28,57.23 4 26 -luhn/luhn.go:61.2,71.23 4 17 -luhn/luhn.go:94.2,94.20 1 17 luhn/luhn.go:57.23,59.3 1 9 +luhn/luhn.go:61.2,71.23 4 17 luhn/luhn.go:71.23,76.15 4 189 -luhn/luhn.go:80.3,80.15 1 189 -luhn/luhn.go:88.3,90.11 2 189 luhn/luhn.go:76.15,77.12 1 0 +luhn/luhn.go:80.3,80.15 1 189 luhn/luhn.go:80.15,83.13 2 90 luhn/luhn.go:83.13,85.5 1 56 +luhn/luhn.go:88.3,90.11 2 189 +luhn/luhn.go:94.2,94.20 1 17 diff --git a/go/luhn/luhn-doc.md b/go/luhn/luhn-doc.md index f79cc0ad..7107f33b 100755 --- a/go/luhn/luhn-doc.md +++ b/go/luhn/luhn-doc.md @@ -6,7 +6,7 @@ import "luhn" ``` -Package luhn is a simple checksum formula used to validate a variety of identification numbers\, such as credit card numbers and Canadian Social Insurance Numbers\. +Package luhn is a simple checksum formula used to validate a variety of identification numbers, such as credit card numbers and Canadian Social Insurance Numbers. ## Index @@ -19,7 +19,7 @@ Package luhn is a simple checksum formula used to validate a variety of identifi func Valid(id string) bool ``` -Valid returns true when the passed number \(\`string\`\) is a valid luhn number\. +Valid returns true when the passed number \(\`string\`\) is a valid luhn number.

Example

diff --git a/go/luhn/run-tests-go.txt b/go/luhn/run-tests-go.txt index 542b93e8..c0cde917 100644 --- a/go/luhn/run-tests-go.txt +++ b/go/luhn/run-tests-go.txt @@ -5,15 +5,599 @@ Go packages: luhn =============================================================================== -golint luhn +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.026s +sys 0m0.035s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +luhn.go:17:3: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo) + fmt.Println("DEBUG:", s, "=", a) + ^ +luhn.go:1: line is 165 characters (lll) +// Package luhn is a simple checksum formula used to validate a variety of identification numbers, such as credit card numbers and Canadian Social Insurance Numbers. +luhn.go:12:11: var-declaration: should omit type bool from declaration of var debug; it will be inferred from the right-hand side (revive) +var debug bool = false + ^ +luhn_test.go:8:23: Using the variable on range scope `tc` in function literal (scopelint) + if actual := Valid(tc.input); actual != tc.expected { + ^ +luhn_test.go:9:42: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("Valid(%q) = %t, want: %t", tc.input, actual, tc.expected) + ^ +luhn_test.go:19:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +luhn_examples_test.go:16:2: Duplicate words (true) found (dupword) + // true + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +luhn.go:83:11: mnd: Magic number: 9, in detected (gomnd) + if n > 9 { + ^ +luhn_test.go:5:1: Function TestValid missing the call to method parallel (paralleltest) +func TestValid(t *testing.T) { +^ +luhn_test.go:6:2: Range statement for test TestValid missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +cases_test.go:1:9: package should be `luhn_test` instead of `luhn` (testpackage) +package luhn + ^ +luhn_examples_test.go:1:9: package should be `luhn_test` instead of `luhn` (testpackage) +package luhn + ^ +luhn_test.go:1:9: package should be `luhn_test` instead of `luhn` (testpackage) +package luhn + ^ +luhn.go:38:2: variable name 'm' is too short for the scope of its usage (varnamelen) + m, e := regexp.MatchString(`^[0-9]+$`, s) + ^ +luhn.go:63:2: variable name 'di' is too short for the scope of its usage (varnamelen) + di := reverse(id) + ^ +luhn.go:74:3: variable name 'n' is too short for the scope of its usage (varnamelen) + n, e := strconv.Atoi(s) + ^ +luhn.go:23:6: variable name 'b' is too short for the scope of its usage (varnamelen) + var b string + ^ +luhn.go:71:6: variable name 'i' is too short for the scope of its usage (varnamelen) + for i, r := range di { + ^ +luhn.go:48:12: parameter name 'id' is too short for the scope of its usage (varnamelen) +func Valid(id string) bool { + ^ + +real 0m0.532s +user 0m0.712s +sys 0m0.494s + + + ============================================================================== + +Exit code: -1 + +real 0m0.583s +user 0m0.744s +sys 0m0.548s + +real 0m0.586s +user 0m0.747s +sys 0m0.549s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.019s +sys 0m0.022s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +luhn.go + (12, 11) https://revive.run/r#var-declaration should omit type bool from declaration of var debug; it will be inferred from the right-hand side + + + ✖ 1 problem (0 errors) (1 warnings) + +real 0m0.070s +user 0m0.036s +sys 0m0.053s + + + ============================================================================== + +Exit code: 0 + +real 0m0.107s +user 0m0.064s +sys 0m0.085s + +real 0m0.109s +user 0m0.064s +sys 0m0.088s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.022s +sys 0m0.034s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "luhn" + +real 0m0.088s +user 0m0.128s +sys 0m0.115s + + + ============================================================================== + +Exit code: -1 + +real 0m0.131s +user 0m0.153s +sys 0m0.164s + +real 0m0.133s +user 0m0.154s +sys 0m0.165s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.015s +sys 0m0.024s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.167s +user 0m0.229s +sys 0m0.141s + + + ============================================================================== + +Exit code: 0 + +real 0m0.201s +user 0m0.246s +sys 0m0.178s real 0m0.203s -user 0m0.239s -sys 0m0.214s +user 0m0.246s +sys 0m0.180s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.019s +sys 0m0.032s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.831s +user 0m2.049s +sys 0m0.312s + + + ============================================================================== + +Exit code: 0 + +real 0m0.872s +user 0m2.075s +sys 0m0.355s + +real 0m0.875s +user 0m2.078s +sys 0m0.355s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.019s +sys 0m0.018s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.075s +user 0m0.103s +sys 0m0.080s + + + ============================================================================== + +Exit code: 0 + +real 0m0.109s +user 0m0.128s +sys 0m0.109s + +real 0m0.111s +user 0m0.129s +sys 0m0.110s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.019s +sys 0m0.029s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.029s +user 0m0.024s +sys 0m0.031s + + + ============================================================================== + +Exit code: 0 + +real 0m0.068s +user 0m0.050s +sys 0m0.069s + +real 0m0.070s +user 0m0.051s +sys 0m0.069s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.017s +sys 0m0.020s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.450s +user 0m1.473s +sys 0m0.279s + + + ============================================================================== + +Exit code: 0 + +real 0m0.483s +user 0m1.498s +sys 0m0.307s + +real 0m0.485s +user 0m1.499s +sys 0m0.308s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out luhn +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.020s +sys 0m0.019s + + + ============================================================================== + +Running: gocyclo . + +6 luhn Valid luhn.go:48:1 +4 luhn BenchmarkValid luhn_test.go:15:1 +3 luhn TestValid luhn_test.go:5:1 +3 luhn isValidInput luhn.go:33:1 +2 luhn reverse luhn.go:22:1 +2 luhn dPrint luhn.go:15:1 +1 luhn ExampleValid luhn_examples_test.go:7:1 + +real 0m0.003s +user 0m0.000s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.033s +user 0m0.024s +sys 0m0.031s + +real 0m0.036s +user 0m0.025s +sys 0m0.033s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.027s +user 0m0.029s +sys 0m0.013s + + + ============================================================================== + +Exit code: 0 + +real 0m0.039s +user 0m0.035s +sys 0m0.022s + +real 0m0.041s +user 0m0.036s +sys 0m0.023s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.015s +sys 0m0.032s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:24:54 Including rules: default +[gosec] 2023/09/07 00:24:54 Excluding rules: default +[gosec] 2023/09/07 00:24:54 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/luhn +[gosec] 2023/09/07 00:24:54 Checking package: luhn +[gosec] 2023/09/07 00:24:54 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/luhn/luhn.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 95 + Nosec : 0 + Issues : 0 + + +real 0m0.124s +user 0m0.118s +sys 0m0.102s + + + ============================================================================== + +Exit code: 0 + +real 0m0.160s +user 0m0.139s +sys 0m0.144s + +real 0m0.162s +user 0m0.141s +sys 0m0.144s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.039s +sys 0m0.048s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestValid === RUN TestValid/single_digit_strings_can_not_be_valid === RUN TestValid/a_single_zero_is_invalid @@ -37,7 +621,7 @@ go test -v -covermode=count -coverprofile coverage.out luhn === RUN TestValid/using_ascii_value_for_non-doubled_non-digit_isn't_allowed === RUN TestValid/using_ascii_value_for_doubled_non-digit_isn't_allowed === RUN TestValid/non-numeric,_non-space_char_in_the_middle_with_a_sum_that's_divisible_by_10_isn't_allowed ---- PASS: TestValid (0.01s) +--- PASS: TestValid (0.00s) --- PASS: TestValid/single_digit_strings_can_not_be_valid (0.00s) --- PASS: TestValid/a_single_zero_is_invalid (0.00s) --- PASS: TestValid/a_simple_valid_SIN_that_remains_valid_if_reversed (0.00s) @@ -64,36 +648,129 @@ go test -v -covermode=count -coverprofile coverage.out luhn --- PASS: ExampleValid (0.00s) PASS coverage: 90.9% of statements -ok luhn 0.018s coverage: 90.9% of statements +ok luhn 0.003s coverage: 90.9% of statements -real 0m0.614s -user 0m0.736s -sys 0m0.491s +real 0m0.178s +user 0m0.221s +sys 0m0.135s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + luhn/luhn.go:15: dPrint 50.0% luhn/luhn.go:22: reverse 100.0% luhn/luhn.go:33: isValidInput 83.3% luhn/luhn.go:48: Valid 95.2% total: (statements) 90.9% -real 0m0.255s -user 0m0.267s -sys 0m0.255s - -=============================================================================== - -go tool cover -html coverage.out -o coverage.html - -real 0m0.271s -user 0m0.209s -sys 0m0.223s - -=============================================================================== +real 0m0.076s +user 0m0.117s +sys 0m0.099s + + + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.069s +user 0m0.094s +sys 0m0.099s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +48 func Valid(id string) bool { +49 var sum int +50 +51 dPrint("id", id) +52 +53 // 0. remove spaces from the string +54 id = strings.ReplaceAll(id, " ", "") +55 +56 // 1. is the string is valid? +57 if !isValidInput(id) { +58 return false +59 } +60 +61 dPrint("id", id) +62 +63 di := reverse(id) +64 +65 dPrint("di", di) +66 +67 // 2. reverse the string +68 // 3. double numbers with index 1, 3, 5, ... +69 // 4. if the doubled number is > 9, subtract 9 from it +70 // 5. sum the numbers. +71 for i, r := range di { +72 dPrint("r", string(r)) +73 s := string(r) +74 n, e := strconv.Atoi(s) +75 +76 if e != nil { +77 MISS panic(e) +78 } +79 +80 if i%2 != 0 { +81 n *= 2 +82 +83 if n > 9 { +84 n -= 9 +85 } +86 } +87 +88 dPrint("n", n) +89 +90 sum += n +91 } +92 +93 // 6. if the sum is divisible by 10, it's valid +94 return sum%10 == 0 +95 } + + +15 func dPrint(s string, a ...interface{}) { +16 if debug { +17 MISS fmt.Println("DEBUG:", s, "=", a) +18 } +19 } + + +33 func isValidInput(s string) bool { +34 if len(s) <= 1 { +35 return false +36 } +37 +38 m, e := regexp.MatchString(`^[0-9]+$`, s) +39 +40 if e != nil { +41 MISS panic(e) +42 } +43 +44 return m +45 } + + +real 0m0.022s +user 0m0.015s +sys 0m0.026s + +real 0m0.022s +user 0m0.015s +sys 0m0.026s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -go test -v -race -covermode=atomic luhn === RUN TestValid === RUN TestValid/single_digit_strings_can_not_be_valid === RUN TestValid/a_single_zero_is_invalid @@ -117,7 +794,7 @@ go test -v -race -covermode=atomic luhn === RUN TestValid/using_ascii_value_for_non-doubled_non-digit_isn't_allowed === RUN TestValid/using_ascii_value_for_doubled_non-digit_isn't_allowed === RUN TestValid/non-numeric,_non-space_char_in_the_middle_with_a_sum_that's_divisible_by_10_isn't_allowed ---- PASS: TestValid (0.03s) +--- PASS: TestValid (0.00s) --- PASS: TestValid/single_digit_strings_can_not_be_valid (0.00s) --- PASS: TestValid/a_single_zero_is_invalid (0.00s) --- PASS: TestValid/a_simple_valid_SIN_that_remains_valid_if_reversed (0.00s) @@ -144,97 +821,152 @@ go test -v -race -covermode=atomic luhn --- PASS: ExampleValid (0.00s) PASS coverage: 90.9% of statements -ok luhn 0.076s coverage: 90.9% of statements +ok luhn 1.013s coverage: 90.9% of statements + +real 0m1.242s +user 0m0.279s +sys 0m0.179s + + + ============================================================================== + +Exit code: 0 + +real 0m1.632s +user 0m0.770s +sys 0m0.596s -real 0m0.667s -user 0m0.659s -sys 0m0.461s +real 0m1.635s +user 0m0.771s +sys 0m0.599s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: luhn -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkValid-4 8918 181183 ns/op 56865 B/op 1647 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkValid +BenchmarkValid-8 18520 65309 ns/op 56568 B/op 1495 allocs/op PASS -ok luhn 2.204s +ok luhn 1.874s -real 0m2.668s -user 0m3.615s -sys 0m0.529s +real 0m2.048s +user 0m2.164s +sys 0m0.215s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestValid +=== RUN TestValid/single_digit_strings_can_not_be_valid +=== RUN TestValid/a_single_zero_is_invalid +=== RUN TestValid/a_simple_valid_SIN_that_remains_valid_if_reversed +=== RUN TestValid/a_simple_valid_SIN_that_becomes_invalid_if_reversed +=== RUN TestValid/a_valid_Canadian_SIN +=== RUN TestValid/invalid_Canadian_SIN +=== RUN TestValid/invalid_credit_card +=== RUN TestValid/invalid_long_number_with_an_even_remainder +=== RUN TestValid/invalid_long_number_with_a_remainder_divisible_by_5 +=== RUN TestValid/valid_number_with_an_even_number_of_digits +=== RUN TestValid/valid_number_with_an_odd_number_of_spaces +=== RUN TestValid/valid_strings_with_a_non-digit_added_at_the_end_become_invalid +=== RUN TestValid/valid_strings_with_punctuation_included_become_invalid +=== RUN TestValid/valid_strings_with_symbols_included_become_invalid +=== RUN TestValid/single_zero_with_space_is_invalid +=== RUN TestValid/more_than_a_single_zero_is_valid +=== RUN TestValid/input_digit_9_is_correctly_converted_to_output_digit_9 +=== RUN TestValid/very_long_input_is_valid +=== RUN TestValid/valid_luhn_with_an_odd_number_of_digits_and_non_zero_first_digit +=== RUN TestValid/using_ascii_value_for_non-doubled_non-digit_isn't_allowed +=== RUN TestValid/using_ascii_value_for_doubled_non-digit_isn't_allowed +=== RUN TestValid/non-numeric,_non-space_char_in_the_middle_with_a_sum_that's_divisible_by_10_isn't_allowed +--- PASS: TestValid (0.00s) + --- PASS: TestValid/single_digit_strings_can_not_be_valid (0.00s) + --- PASS: TestValid/a_single_zero_is_invalid (0.00s) + --- PASS: TestValid/a_simple_valid_SIN_that_remains_valid_if_reversed (0.00s) + --- PASS: TestValid/a_simple_valid_SIN_that_becomes_invalid_if_reversed (0.00s) + --- PASS: TestValid/a_valid_Canadian_SIN (0.00s) + --- PASS: TestValid/invalid_Canadian_SIN (0.00s) + --- PASS: TestValid/invalid_credit_card (0.00s) + --- PASS: TestValid/invalid_long_number_with_an_even_remainder (0.00s) + --- PASS: TestValid/invalid_long_number_with_a_remainder_divisible_by_5 (0.00s) + --- PASS: TestValid/valid_number_with_an_even_number_of_digits (0.00s) + --- PASS: TestValid/valid_number_with_an_odd_number_of_spaces (0.00s) + --- PASS: TestValid/valid_strings_with_a_non-digit_added_at_the_end_become_invalid (0.00s) + --- PASS: TestValid/valid_strings_with_punctuation_included_become_invalid (0.00s) + --- PASS: TestValid/valid_strings_with_symbols_included_become_invalid (0.00s) + --- PASS: TestValid/single_zero_with_space_is_invalid (0.00s) + --- PASS: TestValid/more_than_a_single_zero_is_valid (0.00s) + --- PASS: TestValid/input_digit_9_is_correctly_converted_to_output_digit_9 (0.00s) + --- PASS: TestValid/very_long_input_is_valid (0.00s) + --- PASS: TestValid/valid_luhn_with_an_odd_number_of_digits_and_non_zero_first_digit (0.00s) + --- PASS: TestValid/using_ascii_value_for_non-doubled_non-digit_isn't_allowed (0.00s) + --- PASS: TestValid/using_ascii_value_for_doubled_non-digit_isn't_allowed (0.00s) + --- PASS: TestValid/non-numeric,_non-space_char_in_the_middle_with_a_sum_that's_divisible_by_10_isn't_allowed (0.00s) +=== RUN ExampleValid +--- PASS: ExampleValid (0.00s) PASS -ok luhn 0.024s +ok luhn 0.005s -real 0m0.539s -user 0m0.600s -sys 0m0.411s +real 0m0.138s +user 0m0.174s +sys 0m0.119s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m0.715s -user 0m0.735s -sys 0m0.388s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -Valid-4 14.6µs ± 0% 181.2µs ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -Valid-4 3.53kB ± 0% 56.87kB ± 0% ~ (p=1.000 n=1+1) - -name old allocs/op new allocs/op delta -Valid-4 136 ± 0% 1647 ± 0% ~ (p=1.000 n=1+1) - -real 0m0.029s -user 0m0.017s -sys 0m0.025s - -=============================================================================== - -go vet luhn - -real 0m0.360s -user 0m0.429s -sys 0m0.322s - -=============================================================================== - -go fix luhn +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: luhn +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Valid-8 65.31µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Valid-8 55.24Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Valid-8 1.495k ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.141s -user 0m0.163s -sys 0m0.122s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Valid-4 181.2µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +Valid-4 55.53Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./luhn -[gosec] 2022/07/26 07:39:52 Including rules: default -[gosec] 2022/07/26 07:39:52 Excluding rules: default -[gosec] 2022/07/26 07:39:52 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/luhn -2022/07/26 07:39:53 internal error: package "fmt" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +Valid-4 1.647k ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.522s -user 0m0.566s -sys 0m0.423s +real 0m0.002s +user 0m0.001s +sys 0m0.001s =============================================================================== gomarkdoc --output luhn-doc.md -real 0m0.048s -user 0m0.034s -sys 0m0.015s +real 0m0.010s +user 0m0.007s +sys 0m0.003s =============================================================================== @@ -251,9 +983,9 @@ func Valid(id string) bool Valid returns true when the passed number (`string`) is a valid luhn number. -real 0m0.257s -user 0m0.230s -sys 0m0.236s +real 0m0.038s +user 0m0.024s +sys 0m0.041s =============================================================================== diff --git a/go/markdown/benchstat-new.txt b/go/markdown/benchstat-new.txt index e772145e..2f2806de 100644 --- a/go/markdown/benchstat-new.txt +++ b/go/markdown/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: markdown -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkMarkdown-4 56080 20243 ns/op 2896 B/op 100 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkMarkdown +BenchmarkMarkdown-8 200488 5903 ns/op 2896 B/op 100 allocs/op PASS -ok markdown 1.408s +ok markdown 1.249s diff --git a/go/markdown/benchstat-old.txt b/go/markdown/benchstat-old.txt index 9eb9b375..e772145e 100644 --- a/go/markdown/benchstat-old.txt +++ b/go/markdown/benchstat-old.txt @@ -2,6 +2,6 @@ goos: linux goarch: amd64 pkg: markdown cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkMarkdown-4 14973 90357 ns/op 18388 B/op 1042 allocs/op +BenchmarkMarkdown-4 56080 20243 ns/op 2896 B/op 100 allocs/op PASS -ok markdown 2.235s +ok markdown 1.408s diff --git a/go/markdown/coverage.html b/go/markdown/coverage.html index d88e6c8d..a0737d27 100644 --- a/go/markdown/coverage.html +++ b/go/markdown/coverage.html @@ -223,6 +223,17 @@ return html.String() } + +/* + name old time/op new time/op delta + Markdown-4 90.4µs ± 0% 20.2µs ± 0% ~ (p=1.000 n=1+1) + + name old alloc/op new alloc/op delta + Markdown-4 18.4kB ± 0% 2.9kB ± 0% ~ (p=1.000 n=1+1) + + name old allocs/op new allocs/op delta + Markdown-4 1.04k ± 0% 0.10k ± 0% ~ (p=1.000 n=1+1) +*/ diff --git a/go/markdown/coverage.out b/go/markdown/coverage.out index ba45a8b4..76ef9968 100644 --- a/go/markdown/coverage.out +++ b/go/markdown/coverage.out @@ -1,34 +1,34 @@ mode: count markdown/markdown.go:23.34,39.37 12 18 -markdown/markdown.go:126.2,126.9 1 18 -markdown/markdown.go:144.2,144.22 1 12 markdown/markdown.go:39.37,43.18 2 620 -markdown/markdown.go:68.3,70.76 2 604 -markdown/markdown.go:93.3,93.19 1 595 -markdown/markdown.go:121.3,123.19 2 575 markdown/markdown.go:43.18,45.20 1 16 -markdown/markdown.go:51.4,51.11 1 16 -markdown/markdown.go:63.4,65.12 2 16 markdown/markdown.go:45.20,49.5 3 39 +markdown/markdown.go:51.4,51.11 1 16 markdown/markdown.go:52.28,53.80 1 1 markdown/markdown.go:55.19,57.20 2 5 markdown/markdown.go:59.12,60.58 1 10 +markdown/markdown.go:63.4,65.12 2 16 +markdown/markdown.go:68.3,70.76 2 604 markdown/markdown.go:70.76,72.24 1 9 -markdown/markdown.go:76.4,78.11 2 9 -markdown/markdown.go:88.4,90.12 2 9 markdown/markdown.go:72.24,74.5 1 4 +markdown/markdown.go:76.4,78.11 2 9 markdown/markdown.go:79.21,81.22 2 8 markdown/markdown.go:83.12,85.26 2 1 +markdown/markdown.go:88.4,90.12 2 9 +markdown/markdown.go:93.3,93.19 1 595 markdown/markdown.go:93.19,95.18 1 20 -markdown/markdown.go:111.4,111.25 1 20 -markdown/markdown.go:116.4,118.12 2 20 markdown/markdown.go:95.18,98.98 2 5 -markdown/markdown.go:104.5,104.24 1 5 markdown/markdown.go:98.98,102.6 3 1 +markdown/markdown.go:104.5,104.24 1 5 markdown/markdown.go:104.24,107.6 2 4 +markdown/markdown.go:111.4,111.25 1 20 markdown/markdown.go:111.25,114.5 2 5 +markdown/markdown.go:116.4,118.12 2 20 +markdown/markdown.go:121.3,123.19 2 575 +markdown/markdown.go:126.2,126.9 1 18 markdown/markdown.go:127.26,128.27 1 1 markdown/markdown.go:130.25,131.57 1 7 markdown/markdown.go:133.23,134.33 1 3 markdown/markdown.go:136.46,137.27 1 1 markdown/markdown.go:139.10,141.31 2 6 +markdown/markdown.go:144.2,144.22 1 12 diff --git a/go/markdown/run-tests-go.txt b/go/markdown/run-tests-go.txt index e269731f..d937b243 100644 --- a/go/markdown/run-tests-go.txt +++ b/go/markdown/run-tests-go.txt @@ -5,56 +5,610 @@ Go packages: markdown =============================================================================== -golint ./... +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.025s +sys 0m0.029s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +markdown.go:23: Function 'Render' has too many statements (72 > 40) (funlen) +func Render(input string) string { +markdown.go:22:38: Comment should end in a period (godot) +// Render translates markdown to HTML + ^ +markdown_examples_test.go:24: line is 145 characters (lll) + // markdown: "# Title\n\n\tsummary\n\n\t## Heading1\n\n\t- list1\n\t- list2\n\t- list3\n\n\t## Heading2\n\n\t- [Site1](https://google.com/)\n\t" +markdown_examples_test.go:25: line is 141 characters (lll) + // html: "

Title

\tsummary\t# Heading1\t- list1\t- list2\t- list3\t# Heading2\t- [Site1](https://google.com/)\t

" +markdown.go:93:3: `if char == '\n'` has complex nested blocks (complexity: 6) (nestif) + if char == '\n' { + ^ +markdown_test.go:8:24: Using the variable on range scope `tc` in function literal (scopelint) + if actual := Render(tc.input); actual != tc.expected { + ^ +markdown_test.go:9:46: Using the variable on range scope `tc` in function literal (scopelint) + t.Errorf("Render(%q)\n got:%q\nwant:%q", tc.input, actual, tc.expected) + ^ +markdown.go:39: unnecessary leading newline (whitespace) + for cursorPosition < len(markdown) { + +markdown.go:43: unnecessary leading newline (whitespace) + if char == '#' { + +markdown.go:70: unnecessary leading newline (whitespace) + if char == '*' && headerTracker == 0 && strings.Contains(markdown, "\n") { + +markdown.go:108: unnecessary trailing newline (whitespace) + + } +markdown.go:34:2: declarations should never be cuddled (wsl) + var headerTracker int + ^ +markdown.go:35:2: declarations should never be cuddled (wsl) + var listTracker int + ^ +markdown.go:36:2: declarations should never be cuddled (wsl) + var listOpened bool + ^ +markdown.go:81:5: assignments should only be cuddled with other assignments (wsl) + listOpened = true + ^ +markdown.go:109:4: block should not end with a whitespace (or comment) (wsl) + } + ^ +markdown.go:100:6: assignments should only be cuddled with other assignments (wsl) + listOpened = false + ^ +markdown.go:106:6: assignments should only be cuddled with other assignments (wsl) + listOpened = false + ^ +cases_test.go:8:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +markdown.go:52:26: mnd: Magic number: 7, in detected (gomnd) + case headerTracker == 7: + ^ +markdown.go:127:24: mnd: Magic number: 7, in detected (gomnd) + case headerTracker == 7: + ^ +markdown.go:141:3: return with no blank line before (nlreturn) + return "

" + html.String() + ^ +markdown_test.go:5:1: Function TestMarkdown missing the call to method parallel (paralleltest) +func TestMarkdown(t *testing.T) { +^ +markdown_test.go:6:2: Range statement for test TestMarkdown missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +cases_test.go:1:9: package should be `markdown_test` instead of `markdown` (testpackage) +package markdown + ^ +markdown_examples_test.go:1:9: package should be `markdown_test` instead of `markdown` (testpackage) +package markdown + ^ +markdown_test.go:1:9: package should be `markdown_test` instead of `markdown` (testpackage) +package markdown + ^ -real 0m0.118s -user 0m0.054s -sys 0m0.062s +real 0m0.525s +user 0m0.759s +sys 0m0.442s + + + ============================================================================== + +Exit code: -1 + +real 0m0.570s +user 0m0.793s +sys 0m0.480s + +real 0m0.572s +user 0m0.795s +sys 0m0.482s =============================================================================== -revive ./... +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.032s +sys 0m0.045s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.040s +user 0m0.017s +sys 0m0.033s + -real 0m0.062s -user 0m0.016s -sys 0m0.028s + ============================================================================== + +Exit code: 0 + +real 0m0.082s +user 0m0.056s +sys 0m0.086s + +real 0m0.083s +user 0m0.056s +sys 0m0.088s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.294s -user 0m0.307s -sys 0m0.293s +real 0m0.001s +user 0m0.001s +sys 0m0.000s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.018s +sys 0m0.023s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." +internal error: package "fmt" without types was imported from "markdown" + +real 0m0.077s +user 0m0.097s +sys 0m0.106s + + + ============================================================================== + +Exit code: -1 -real 0m0.442s -user 0m0.406s -sys 0m0.349s +real 0m0.112s +user 0m0.121s +sys 0m0.139s + +real 0m0.114s +user 0m0.124s +sys 0m0.139s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.020s +sys 0m0.023s + -real 0m0.368s -user 0m0.411s -sys 0m0.366s + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.158s +user 0m0.206s +sys 0m0.106s + + + ============================================================================== + +Exit code: 0 + +real 0m0.190s +user 0m0.232s +sys 0m0.138s + +real 0m0.191s +user 0m0.233s +sys 0m0.138s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic -real 0m2.357s -user 0m3.981s -sys 0m1.059s +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.020s +sys 0m0.031s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.811s +user 0m2.033s +sys 0m0.266s + + + ============================================================================== + +Exit code: 0 + +real 0m0.857s +user 0m2.062s +sys 0m0.308s + +real 0m0.859s +user 0m2.063s +sys 0m0.308s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.017s +sys 0m0.019s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.080s +user 0m0.143s +sys 0m0.099s + + + ============================================================================== + +Exit code: 0 + +real 0m0.112s +user 0m0.165s +sys 0m0.127s + +real 0m0.114s +user 0m0.165s +sys 0m0.129s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.021s +sys 0m0.021s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.034s +user 0m0.040s +sys 0m0.044s + + + ============================================================================== + +Exit code: 0 + +real 0m0.068s +user 0m0.068s +sys 0m0.073s + +real 0m0.070s +user 0m0.070s +sys 0m0.073s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.021s +sys 0m0.030s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.562s +user 0m1.612s +sys 0m0.303s + + + ============================================================================== + +Exit code: 0 + +real 0m0.615s +user 0m1.642s +sys 0m0.351s + +real 0m0.617s +user 0m1.642s +sys 0m0.353s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.014s +sys 0m0.031s + + + ============================================================================== + +Running: gocyclo . + +21 markdown Render markdown.go:23:1 +4 markdown BenchmarkMarkdown markdown_test.go:15:1 +3 markdown TestMarkdown markdown_test.go:5:1 +1 markdown ExampleRender markdown_examples_test.go:5:1 + +real 0m0.002s +user 0m0.002s +sys 0m0.000s + + + ============================================================================== + +Exit code: 0 + +real 0m0.038s +user 0m0.020s +sys 0m0.044s + +real 0m0.040s +user 0m0.020s +sys 0m0.047s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.028s +user 0m0.031s +sys 0m0.014s + + + ============================================================================== + +Exit code: 0 + +real 0m0.041s +user 0m0.041s +sys 0m0.020s + +real 0m0.043s +user 0m0.042s +sys 0m0.021s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.032s +sys 0m0.031s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:25:01 Including rules: default +[gosec] 2023/09/07 00:25:01 Excluding rules: default +[gosec] 2023/09/07 00:25:01 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/markdown +[gosec] 2023/09/07 00:25:01 Checking package: markdown +[gosec] 2023/09/07 00:25:01 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/markdown/markdown.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 156 + Nosec : 0 + Issues : 0 + + +real 0m0.132s +user 0m0.147s +sys 0m0.097s + + + ============================================================================== + +Exit code: 0 + +real 0m0.175s +user 0m0.187s +sys 0m0.139s + +real 0m0.178s +user 0m0.189s +sys 0m0.140s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.033s +sys 0m0.034s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestMarkdown === RUN TestMarkdown/parses_normal_text_as_a_paragraph === RUN TestMarkdown/parsing_italics @@ -95,41 +649,54 @@ gotest -v -covermode=count -coverprofile coverage.out ./... --- PASS: ExampleRender (0.00s) PASS coverage: 100.0% of statements -ok markdown 0.013s coverage: 100.0% of statements +ok markdown 0.002s coverage: 100.0% of statements -real 0m0.693s -user 0m0.699s -sys 0m0.572s +real 0m0.191s +user 0m0.249s +sys 0m0.188s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + markdown/markdown.go:23: Render 100.0% total: (statements) 100.0% -real 0m0.303s -user 0m0.299s -sys 0m0.227s +real 0m0.067s +user 0m0.073s +sys 0m0.096s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.276s -user 0m0.202s -sys 0m0.287s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 -color - | tee coverage-annotations.txt +real 0m0.055s +user 0m0.066s +sys 0m0.086s -real 0m0.131s -user 0m0.073s -sys 0m0.169s -=============================================================================== + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.021s +user 0m0.028s +sys 0m0.022s + +real 0m0.022s +user 0m0.028s +sys 0m0.022s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestMarkdown === RUN TestMarkdown/parses_normal_text_as_a_paragraph === RUN TestMarkdown/parsing_italics @@ -148,7 +715,7 @@ gotest -v -race -covermode=atomic ./... === RUN TestMarkdown/with_markdown_symbols_in_the_list_item_text_that_should_not_be_interpreted === RUN TestMarkdown/with_markdown_symbols_in_the_paragraph_text_that_should_not_be_interpreted === RUN TestMarkdown/unordered_lists_close_properly_with_preceding_and_following_lines ---- PASS: TestMarkdown (0.02s) +--- PASS: TestMarkdown (0.00s) --- PASS: TestMarkdown/parses_normal_text_as_a_paragraph (0.00s) --- PASS: TestMarkdown/parsing_italics (0.00s) --- PASS: TestMarkdown/parsing_bold_text (0.00s) @@ -159,7 +726,7 @@ gotest -v -race -covermode=atomic ./... --- PASS: TestMarkdown/with_h4_header_level (0.00s) --- PASS: TestMarkdown/with_h5_header_level (0.00s) --- PASS: TestMarkdown/with_h6_header_level (0.00s) - --- PASS: TestMarkdown/h7_header_level_is_a_paragraph (0.01s) + --- PASS: TestMarkdown/h7_header_level_is_a_paragraph (0.00s) --- PASS: TestMarkdown/unordered_lists (0.00s) --- PASS: TestMarkdown/With_a_little_bit_of_everything (0.00s) --- PASS: TestMarkdown/with_markdown_symbols_in_the_header_text_that_should_not_be_interpreted (0.00s) @@ -170,111 +737,142 @@ gotest -v -race -covermode=atomic ./... --- PASS: ExampleRender (0.00s) PASS coverage: 100.0% of statements -ok markdown 0.067s coverage: 100.0% of statements +ok markdown 1.020s coverage: 100.0% of statements + +real 0m1.238s +user 0m0.264s +sys 0m0.152s + -real 0m1.197s -user 0m0.966s -sys 0m0.690s + ============================================================================== + +Exit code: 0 + +real 0m1.622s +user 0m0.719s +sys 0m0.594s + +real 0m1.625s +user 0m0.721s +sys 0m0.594s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: markdown -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkMarkdown-4 56080 20243 ns/op 2896 B/op 100 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkMarkdown +BenchmarkMarkdown-8 200488 5903 ns/op 2896 B/op 100 allocs/op PASS -ok markdown 1.408s +ok markdown 1.249s -real 0m1.914s -user 0m2.619s -sys 0m0.605s +real 0m1.414s +user 0m1.503s +sys 0m0.187s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestMarkdown +=== RUN TestMarkdown/parses_normal_text_as_a_paragraph +=== RUN TestMarkdown/parsing_italics +=== RUN TestMarkdown/parsing_bold_text +=== RUN TestMarkdown/mixed_normal,_italics_and_bold_text +=== RUN TestMarkdown/with_h1_header_level +=== RUN TestMarkdown/with_h2_header_level +=== RUN TestMarkdown/with_h3_header_level +=== RUN TestMarkdown/with_h4_header_level +=== RUN TestMarkdown/with_h5_header_level +=== RUN TestMarkdown/with_h6_header_level +=== RUN TestMarkdown/h7_header_level_is_a_paragraph +=== RUN TestMarkdown/unordered_lists +=== RUN TestMarkdown/With_a_little_bit_of_everything +=== RUN TestMarkdown/with_markdown_symbols_in_the_header_text_that_should_not_be_interpreted +=== RUN TestMarkdown/with_markdown_symbols_in_the_list_item_text_that_should_not_be_interpreted +=== RUN TestMarkdown/with_markdown_symbols_in_the_paragraph_text_that_should_not_be_interpreted +=== RUN TestMarkdown/unordered_lists_close_properly_with_preceding_and_following_lines +--- PASS: TestMarkdown (0.00s) + --- PASS: TestMarkdown/parses_normal_text_as_a_paragraph (0.00s) + --- PASS: TestMarkdown/parsing_italics (0.00s) + --- PASS: TestMarkdown/parsing_bold_text (0.00s) + --- PASS: TestMarkdown/mixed_normal,_italics_and_bold_text (0.00s) + --- PASS: TestMarkdown/with_h1_header_level (0.00s) + --- PASS: TestMarkdown/with_h2_header_level (0.00s) + --- PASS: TestMarkdown/with_h3_header_level (0.00s) + --- PASS: TestMarkdown/with_h4_header_level (0.00s) + --- PASS: TestMarkdown/with_h5_header_level (0.00s) + --- PASS: TestMarkdown/with_h6_header_level (0.00s) + --- PASS: TestMarkdown/h7_header_level_is_a_paragraph (0.00s) + --- PASS: TestMarkdown/unordered_lists (0.00s) + --- PASS: TestMarkdown/With_a_little_bit_of_everything (0.00s) + --- PASS: TestMarkdown/with_markdown_symbols_in_the_header_text_that_should_not_be_interpreted (0.00s) + --- PASS: TestMarkdown/with_markdown_symbols_in_the_list_item_text_that_should_not_be_interpreted (0.00s) + --- PASS: TestMarkdown/with_markdown_symbols_in_the_paragraph_text_that_should_not_be_interpreted (0.00s) + --- PASS: TestMarkdown/unordered_lists_close_properly_with_preceding_and_following_lines (0.00s) +=== RUN ExampleRender +--- PASS: ExampleRender (0.00s) PASS -ok markdown 0.014s +ok markdown 0.004s -real 0m0.525s -user 0m0.592s -sys 0m0.444s +real 0m0.126s +user 0m0.170s +sys 0m0.129s =============================================================================== benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -Markdown-4 90.4µs ± 0% 20.2µs ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -Markdown-4 18.4kB ± 0% 2.9kB ± 0% ~ (p=1.000 n=1+1) - -name old allocs/op new allocs/op delta -Markdown-4 1.04k ± 0% 0.10k ± 0% ~ (p=1.000 n=1+1) - -real 0m0.052s -user 0m0.003s -sys 0m0.009s - -=============================================================================== - -go vet ./... - -real 0m0.342s -user 0m0.363s -sys 0m0.433s - -=============================================================================== - -go fix ./... - -real 0m0.142s -user 0m0.094s -sys 0m0.115s - -=============================================================================== - -gocyclo . -21 markdown Render markdown.go:23:1 -4 markdown BenchmarkMarkdown markdown_test.go:15:1 -3 markdown TestMarkdown markdown_test.go:5:1 -1 markdown ExampleRender markdown_examples_test.go:5:1 - -real 0m0.044s -user 0m0.009s -sys 0m0.020s - -=============================================================================== - -misspell . +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: markdown +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Markdown-8 5.903µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Markdown-8 2.828Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Markdown-8 100.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.097s -user 0m0.091s -sys 0m0.035s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Markdown-4 20.24µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +Markdown-4 2.828Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./... -[gosec] 2022/08/25 22:30:02 Including rules: default -[gosec] 2022/08/25 22:30:02 Excluding rules: default -[gosec] 2022/08/25 22:30:02 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/markdown -2022/08/25 22:30:02 internal error: package "fmt" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +Markdown-4 100.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.652s -user 0m0.660s -sys 0m0.500s +real 0m0.002s +user 0m0.001s +sys 0m0.001s =============================================================================== gomarkdoc --output markdown-doc.md -real 0m0.095s -user 0m0.038s -sys 0m0.032s +real 0m0.010s +user 0m0.007s +sys 0m0.002s =============================================================================== @@ -289,9 +887,9 @@ func Render(input string) string Render translates markdown to HTML -real 0m0.211s -user 0m0.129s -sys 0m0.243s +real 0m0.037s +user 0m0.025s +sys 0m0.036s =============================================================================== diff --git a/go/meetup/benchstat-new.txt b/go/meetup/benchstat-new.txt index 72fc00fe..e34bc439 100644 --- a/go/meetup/benchstat-new.txt +++ b/go/meetup/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: meetup -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkDay-4 21916 54720 ns/op 0 B/op 0 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkDay +BenchmarkDay-8 56248 22457 ns/op 0 B/op 0 allocs/op PASS -ok meetup 1.797s +ok meetup 1.486s diff --git a/go/meetup/benchstat-old.txt b/go/meetup/benchstat-old.txt new file mode 100644 index 00000000..72fc00fe --- /dev/null +++ b/go/meetup/benchstat-old.txt @@ -0,0 +1,7 @@ +goos: linux +goarch: amd64 +pkg: meetup +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkDay-4 21916 54720 ns/op 0 B/op 0 allocs/op +PASS +ok meetup 1.797s diff --git a/go/meetup/coverage-annotations.txt b/go/meetup/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/meetup/coverage.html b/go/meetup/coverage.html index 336cc359..f3be49ab 100644 --- a/go/meetup/coverage.html +++ b/go/meetup/coverage.html @@ -86,14 +86,14 @@ ) /* - M Tu W Th F Sa Su - 1 2 3 4 5 6 7 - first : 1 - 8 9 10 11 12 13 14 - second: 8 - 15 16 17 18 19 20 21 - third : 15 - 22 23 24 25 26 27 28 - fourth: 22 - 29 30 31 - fifth : 29 - - teenth: (no overlapping days): 13-19 + Mo Tu We Th Fr Sa Su + 1 2 3 4 5 6 7 - First + 8 9 10 11 12 13 14 - Second + 15 16 17 18 19 20 21 - Third + 22 23 24 25 26 27 28 - Fourth + 29 30 31 - Fifth + + Teenth: (no overlapping days): 13-19 - Saturday : 13 - Sunday : 14 - Monday : 15 @@ -108,12 +108,12 @@ // WeekSchedule enum values. const ( - First WeekSchedule = 1 - Second = 2 - Third = 3 - Fourth = 4 - Teenth = 13 - Last = 6 + First WeekSchedule = 1 // number of matches + Second = 2 // number of matches + Third = 3 // number of matches + Fourth = 4 // number of matches + Teenth = 13 // start search on this day + Last = 6 // number of matches ) // Get the last day of the month (28, 29, 30, or 31) diff --git a/go/meetup/coverage.out b/go/meetup/coverage.out index 7510ef78..5119cf7c 100644 --- a/go/meetup/coverage.out +++ b/go/meetup/coverage.out @@ -1,12 +1,12 @@ mode: count meetup/meetup.go:41.41,46.2 2 120 meetup/meetup.go:49.82,56.16 5 102 -meetup/meetup.go:68.2,71.32 3 102 -meetup/meetup.go:88.2,88.12 1 102 meetup/meetup.go:57.36,58.20 1 62 meetup/meetup.go:59.14,61.10 2 22 meetup/meetup.go:62.12,65.10 3 18 +meetup/meetup.go:68.2,71.32 3 102 meetup/meetup.go:71.32,78.26 3 1059 -meetup/meetup.go:83.3,83.19 1 1059 meetup/meetup.go:78.26,80.4 1 192 +meetup/meetup.go:83.3,83.19 1 1059 meetup/meetup.go:83.19,84.9 1 102 +meetup/meetup.go:88.2,88.12 1 102 diff --git a/go/meetup/meetup-doc.md b/go/meetup/meetup-doc.md index 455c3180..10f7deb9 100755 --- a/go/meetup/meetup-doc.md +++ b/go/meetup/meetup-doc.md @@ -6,7 +6,7 @@ import "meetup" ``` -Package meetup is used to calculate the days a Meetup meets\. +Package meetup is used to calculate the days a Meetup meets. ## Index @@ -17,16 +17,16 @@ Package meetup is used to calculate the days a Meetup meets\. ## Constants -WeekSchedule enum values\. +WeekSchedule enum values. ```go const ( - First WeekSchedule = 1 - Second = 2 - Third = 3 - Fourth = 4 - Teenth = 13 - Last = 6 + First WeekSchedule = 1 // number of matches + Second = 2 // number of matches + Third = 3 // number of matches + Fourth = 4 // number of matches + Teenth = 13 // start search on this day + Last = 6 // number of matches ) ``` @@ -36,7 +36,7 @@ const ( func Day(wSched WeekSchedule, wDay time.Weekday, month time.Month, year int) int ``` -Day returns the date the Meetup meets\. +Day returns the date the Meetup meets.

Example

@@ -71,7 +71,7 @@ Day returns the date the Meetup meets\. ## type [WeekSchedule]() -WeekSchedule enum for making requests for the day we're looking for\. +WeekSchedule enum for making requests for the day we're looking for. ```go type WeekSchedule int diff --git a/go/meetup/meetup-doc.txt b/go/meetup/meetup-doc.txt index 338858e2..232c7908 100644 --- a/go/meetup/meetup-doc.txt +++ b/go/meetup/meetup-doc.txt @@ -5,12 +5,12 @@ Package meetup is used to calculate the days a Meetup meets. CONSTANTS const ( - First WeekSchedule = 1 - Second = 2 - Third = 3 - Fourth = 4 - Teenth = 13 - Last = 6 + First WeekSchedule = 1 // number of matches + Second = 2 // number of matches + Third = 3 // number of matches + Fourth = 4 // number of matches + Teenth = 13 // start search on this day + Last = 6 // number of matches ) WeekSchedule enum values. diff --git a/go/meetup/run-tests-go.txt b/go/meetup/run-tests-go.txt index 34a9fa59..e9e78abe 100644 --- a/go/meetup/run-tests-go.txt +++ b/go/meetup/run-tests-go.txt @@ -5,15 +5,597 @@ Go packages: meetup =============================================================================== -golint meetup +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.220s -user 0m0.178s -sys 0m0.184s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.019s +sys 0m0.020s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +meetup_test.go:19: line is 124 characters (lll) + t.Errorf("Day(%q, %d, %d, %d) = %d, want: %d", weekName[tc.week], tc.weekday, tc.month, tc.year, actual, tc.expectedDay) +meetup.go:43:11: var-declaration: should omit type time.Time from declaration of var date; it will be inferred from the right-hand side (revive) + var date time.Time = time.Date(t.Year(), t.Month(), 1, 12, 0, 0, 0, time.UTC) + ^ +meetup.go:50:11: var-declaration: should omit type time.Time from declaration of var date; it will be inferred from the right-hand side (revive) + var date time.Time = time.Date(year, month, int(wSched), 12, 0, 0, 0, time.UTC) + ^ +meetup.go:52:12: var-declaration: should omit type int from declaration of var start; it will be inferred from the right-hand side (revive) + var start int = 1 // starting calendar day for the search + ^ +meetup.go:54:10: var-declaration: should omit type int from declaration of var end; it will be inferred from the right-hand side (revive) + var end int = getLastDayOfMonth(date) + ^ +meetup_test.go:17:18: Using the variable on range scope `tc` in function literal (scopelint) + actual := Day(tc.week, tc.weekday, tc.month, tc.year) + ^ +meetup_test.go:18:17: Using the variable on range scope `tc` in function literal (scopelint) + if actual != tc.expectedDay { + ^ +meetup.go:53:2: declarations should never be cuddled (wsl) + var max int // max number of matches + ^ +meetup.go:69:2: declarations should never be cuddled (wsl) + var day int // return value + ^ +meetup_test.go:29:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:8:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +meetup_test.go:5:5: weekName is a global variable (gochecknoglobals) +var weekName = map[WeekSchedule]string{ + ^ +meetup_test.go:14:1: Function TestDay missing the call to method parallel (paralleltest) +func TestDay(t *testing.T) { +^ +meetup_test.go:15:2: Range statement for test TestDay missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +meetup.go:31:2: SA9004: only the first constant in this group has an explicit type (staticcheck) + First WeekSchedule = 1 // number of matches + ^ +cases_test.go:1:9: package should be `meetup_test` instead of `meetup` (testpackage) +package meetup + ^ +meetup_examples_test.go:1:9: package should be `meetup_test` instead of `meetup` (testpackage) +package meetup + ^ +meetup_test.go:1:9: package should be `meetup_test` instead of `meetup` (testpackage) +package meetup + ^ + +real 0m0.524s +user 0m0.834s +sys 0m0.500s + + + ============================================================================== + +Exit code: -1 + +real 0m0.569s +user 0m0.858s +sys 0m0.537s + +real 0m0.571s +user 0m0.859s +sys 0m0.539s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.016s +sys 0m0.020s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +meetup.go + (52, 12) https://revive.run/r#var-declaration should omit type int from declaration of var start; it will be inferred from the right-hand side + (54, 10) https://revive.run/r#var-declaration should omit type int from declaration of var end; it will be inferred from the right-hand side + + + ✖ 2 problems (0 errors) (2 warnings) + +real 0m0.072s +user 0m0.034s +sys 0m0.059s + + + ============================================================================== + +Exit code: 0 + +real 0m0.110s +user 0m0.057s +sys 0m0.089s + +real 0m0.112s +user 0m0.058s +sys 0m0.090s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.035s +user 0m0.017s +sys 0m0.033s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "time" without types was imported from "meetup" + +real 0m0.099s +user 0m0.130s +sys 0m0.133s + + + ============================================================================== + +Exit code: -1 + +real 0m0.146s +user 0m0.157s +sys 0m0.173s + +real 0m0.149s +user 0m0.159s +sys 0m0.174s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.017s +sys 0m0.020s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +meetup.go:31:2: only the first constant in this group has an explicit type (SA9004) +meetup.go:43:11: should omit type time.Time from declaration; it will be inferred from the right-hand side (ST1023) +meetup.go:50:11: should omit type time.Time from declaration; it will be inferred from the right-hand side (ST1023) +meetup.go:52:12: should omit type int from declaration; it will be inferred from the right-hand side (ST1023) +meetup.go:54:10: should omit type int from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.167s +user 0m0.208s +sys 0m0.133s + + + ============================================================================== + +Exit code: -1 + +real 0m0.210s +user 0m0.235s +sys 0m0.164s + +real 0m0.212s +user 0m0.237s +sys 0m0.165s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.013s +sys 0m0.016s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.805s +user 0m2.055s +sys 0m0.279s + + + ============================================================================== + +Exit code: 0 + +real 0m0.836s +user 0m2.073s +sys 0m0.306s + +real 0m0.838s +user 0m2.073s +sys 0m0.308s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.017s +sys 0m0.013s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.083s +user 0m0.133s +sys 0m0.106s + + + ============================================================================== + +Exit code: 0 + +real 0m0.115s +user 0m0.157s +sys 0m0.126s + +real 0m0.116s +user 0m0.158s +sys 0m0.127s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.016s +sys 0m0.016s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.031s +user 0m0.025s +sys 0m0.020s + + + ============================================================================== + +Exit code: 0 + +real 0m0.064s +user 0m0.048s +sys 0m0.044s + +real 0m0.066s +user 0m0.049s +sys 0m0.044s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.016s +sys 0m0.023s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.482s +user 0m1.576s +sys 0m0.320s + + + ============================================================================== + +Exit code: 0 + +real 0m0.528s +user 0m1.598s +sys 0m0.362s + +real 0m0.530s +user 0m1.600s +sys 0m0.363s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.017s +sys 0m0.027s + + + ============================================================================== + +Running: gocyclo . + +7 meetup Day meetup.go:49:1 +4 meetup BenchmarkDay meetup_test.go:25:1 +3 meetup TestDay meetup_test.go:14:1 +1 meetup ExampleDay meetup_examples_test.go:19:1 +1 meetup getLastDayOfMonth meetup.go:41:1 + +real 0m0.004s +user 0m0.003s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.047s +user 0m0.026s +sys 0m0.040s + +real 0m0.049s +user 0m0.026s +sys 0m0.042s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out meetup +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.042s +user 0m0.046s +sys 0m0.019s + + + ============================================================================== + +Exit code: 0 + +real 0m0.060s +user 0m0.053s +sys 0m0.040s + +real 0m0.064s +user 0m0.055s +sys 0m0.041s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.034s +user 0m0.025s +sys 0m0.025s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:25:07 Including rules: default +[gosec] 2023/09/07 00:25:07 Excluding rules: default +[gosec] 2023/09/07 00:25:07 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/meetup +[gosec] 2023/09/07 00:25:07 Checking package: meetup +[gosec] 2023/09/07 00:25:07 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/meetup/meetup.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 89 + Nosec : 0 + Issues : 0 + + +real 0m0.102s +user 0m0.102s +sys 0m0.079s + + + ============================================================================== + +Exit code: 0 + +real 0m0.153s +user 0m0.135s +sys 0m0.118s + +real 0m0.156s +user 0m0.135s +sys 0m0.121s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.017s +sys 0m0.024s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestDay === RUN TestDay/when_teenth_Monday_is_the_13th,_the_first_day_of_the_teenth_week === RUN TestDay/when_teenth_Monday_is_the_19th,_the_last_day_of_the_teenth_week @@ -210,34 +792,55 @@ go test -v -covermode=count -coverprofile coverage.out meetup --- PASS: ExampleDay (0.00s) PASS coverage: 100.0% of statements -ok meetup 0.019s coverage: 100.0% of statements +ok meetup 0.006s coverage: 100.0% of statements -real 0m0.928s -user 0m0.920s -sys 0m0.572s +real 0m0.175s +user 0m0.220s +sys 0m0.137s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + meetup/meetup.go:41: getLastDayOfMonth 100.0% meetup/meetup.go:49: Day 100.0% total: (statements) 100.0% -real 0m0.315s -user 0m0.235s -sys 0m0.252s +real 0m0.059s +user 0m0.054s +sys 0m0.090s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.204s -user 0m0.162s -sys 0m0.176s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic meetup +real 0m0.047s +user 0m0.056s +sys 0m0.063s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.019s +user 0m0.012s +sys 0m0.017s + +real 0m0.019s +user 0m0.012s +sys 0m0.017s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestDay === RUN TestDay/when_teenth_Monday_is_the_13th,_the_first_day_of_the_teenth_week === RUN TestDay/when_teenth_Monday_is_the_19th,_the_last_day_of_the_teenth_week @@ -334,7 +937,7 @@ go test -v -race -covermode=atomic meetup === RUN TestDay/last_Wednesday_in_December_that_is_also_the_last_day_of_the_year === RUN TestDay/when_last_Sunday_in_February_in_a_non-leap_year_is_not_the_29th === RUN TestDay/when_first_Friday_is_the_7th,_the_last_day_of_the_first_week ---- PASS: TestDay (0.05s) +--- PASS: TestDay (0.01s) --- PASS: TestDay/when_teenth_Monday_is_the_13th,_the_first_day_of_the_teenth_week (0.00s) --- PASS: TestDay/when_teenth_Monday_is_the_19th,_the_last_day_of_the_teenth_week (0.00s) --- PASS: TestDay/when_teenth_Monday_is_some_day_in_the_middle_of_the_teenth_week (0.00s) @@ -434,76 +1037,298 @@ go test -v -race -covermode=atomic meetup --- PASS: ExampleDay (0.00s) PASS coverage: 100.0% of statements -ok meetup 0.092s coverage: 100.0% of statements +ok meetup 1.029s coverage: 100.0% of statements + +real 0m1.320s +user 0m0.349s +sys 0m0.201s + + + ============================================================================== -real 0m1.437s -user 0m1.397s -sys 0m0.718s +Exit code: 0 + +real 0m1.660s +user 0m0.714s +sys 0m0.543s + +real 0m1.663s +user 0m0.714s +sys 0m0.547s =============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: meetup -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkDay-4 21916 54720 ns/op 0 B/op 0 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkDay +BenchmarkDay-8 56248 22457 ns/op 0 B/op 0 allocs/op PASS -ok meetup 1.797s +ok meetup 1.486s -real 0m2.590s -user 0m2.813s -sys 0m0.624s +real 0m1.657s +user 0m1.731s +sys 0m0.187s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestDay +=== RUN TestDay/when_teenth_Monday_is_the_13th,_the_first_day_of_the_teenth_week +=== RUN TestDay/when_teenth_Monday_is_the_19th,_the_last_day_of_the_teenth_week +=== RUN TestDay/when_teenth_Monday_is_some_day_in_the_middle_of_the_teenth_week +=== RUN TestDay/when_teenth_Tuesday_is_the_19th,_the_last_day_of_the_teenth_week +=== RUN TestDay/when_teenth_Tuesday_is_some_day_in_the_middle_of_the_teenth_week +=== RUN TestDay/when_teenth_Tuesday_is_the_13th,_the_first_day_of_the_teenth_week +=== RUN TestDay/when_teenth_Wednesday_is_some_day_in_the_middle_of_the_teenth_week +=== RUN TestDay/when_teenth_Wednesday_is_the_13th,_the_first_day_of_the_teenth_week +=== RUN TestDay/when_teenth_Wednesday_is_the_19th,_the_last_day_of_the_teenth_week +=== RUN TestDay/when_teenth_Thursday_is_some_day_in_the_middle_of_the_teenth_week +=== RUN TestDay/when_teenth_Thursday_is_the_13th,_the_first_day_of_the_teenth_week +=== RUN TestDay/when_teenth_Thursday_is_the_19th,_the_last_day_of_the_teenth_week +=== RUN TestDay/when_teenth_Friday_is_the_19th,_the_last_day_of_the_teenth_week +=== RUN TestDay/when_teenth_Friday_is_some_day_in_the_middle_of_the_teenth_week +=== RUN TestDay/when_teenth_Friday_is_the_13th,_the_first_day_of_the_teenth_week +=== RUN TestDay/when_teenth_Saturday_is_some_day_in_the_middle_of_the_teenth_week +=== RUN TestDay/when_teenth_Saturday_is_the_13th,_the_first_day_of_the_teenth_week +=== RUN TestDay/when_teenth_Saturday_is_the_19th,_the_last_day_of_the_teenth_week +=== RUN TestDay/when_teenth_Sunday_is_the_19th,_the_last_day_of_the_teenth_week +=== RUN TestDay/when_teenth_Sunday_is_some_day_in_the_middle_of_the_teenth_week +=== RUN TestDay/when_teenth_Sunday_is_the_13th,_the_first_day_of_the_teenth_week +=== RUN TestDay/when_first_Monday_is_some_day_in_the_middle_of_the_first_week +=== RUN TestDay/when_first_Monday_is_the_1st,_the_first_day_of_the_first_week +=== RUN TestDay/when_first_Tuesday_is_the_7th,_the_last_day_of_the_first_week +=== RUN TestDay/when_first_Tuesday_is_some_day_in_the_middle_of_the_first_week +=== RUN TestDay/when_first_Wednesday_is_some_day_in_the_middle_of_the_first_week +=== RUN TestDay/when_first_Wednesday_is_the_7th,_the_last_day_of_the_first_week +=== RUN TestDay/when_first_Thursday_is_some_day_in_the_middle_of_the_first_week +=== RUN TestDay/when_first_Thursday_is_another_day_in_the_middle_of_the_first_week +=== RUN TestDay/when_first_Friday_is_the_1st,_the_first_day_of_the_first_week +=== RUN TestDay/when_first_Friday_is_some_day_in_the_middle_of_the_first_week +=== RUN TestDay/when_first_Saturday_is_some_day_in_the_middle_of_the_first_week +=== RUN TestDay/when_first_Saturday_is_another_day_in_the_middle_of_the_first_week +=== RUN TestDay/when_first_Sunday_is_some_day_in_the_middle_of_the_first_week +=== RUN TestDay/when_first_Sunday_is_the_7th,_the_last_day_of_the_first_week +=== RUN TestDay/when_second_Monday_is_some_day_in_the_middle_of_the_second_week +=== RUN TestDay/when_second_Monday_is_the_8th,_the_first_day_of_the_second_week +=== RUN TestDay/when_second_Tuesday_is_the_14th,_the_last_day_of_the_second_week +=== RUN TestDay/when_second_Tuesday_is_some_day_in_the_middle_of_the_second_week +=== RUN TestDay/when_second_Wednesday_is_some_day_in_the_middle_of_the_second_week +=== RUN TestDay/when_second_Wednesday_is_the_14th,_the_last_day_of_the_second_week +=== RUN TestDay/when_second_Thursday_is_some_day_in_the_middle_of_the_second_week +=== RUN TestDay/when_second_Thursday_is_another_day_in_the_middle_of_the_second_week +=== RUN TestDay/when_second_Friday_is_the_8th,_the_first_day_of_the_second_week +=== RUN TestDay/when_second_Friday_is_some_day_in_the_middle_of_the_second_week +=== RUN TestDay/when_second_Saturday_is_some_day_in_the_middle_of_the_second_week +=== RUN TestDay/when_second_Saturday_is_another_day_in_the_middle_of_the_second_week +=== RUN TestDay/when_second_Sunday_is_some_day_in_the_middle_of_the_second_week +=== RUN TestDay/when_second_Sunday_is_the_14th,_the_last_day_of_the_second_week +=== RUN TestDay/when_third_Monday_is_some_day_in_the_middle_of_the_third_week +=== RUN TestDay/when_third_Monday_is_the_15th,_the_first_day_of_the_third_week +=== RUN TestDay/when_third_Tuesday_is_the_21st,_the_last_day_of_the_third_week +=== RUN TestDay/when_third_Tuesday_is_some_day_in_the_middle_of_the_third_week +=== RUN TestDay/when_third_Wednesday_is_some_day_in_the_middle_of_the_third_week +=== RUN TestDay/when_third_Wednesday_is_the_21st,_the_last_day_of_the_third_week +=== RUN TestDay/when_third_Thursday_is_some_day_in_the_middle_of_the_third_week +=== RUN TestDay/when_third_Thursday_is_another_day_in_the_middle_of_the_third_week +=== RUN TestDay/when_third_Friday_is_the_15th,_the_first_day_of_the_third_week +=== RUN TestDay/when_third_Friday_is_some_day_in_the_middle_of_the_third_week +=== RUN TestDay/when_third_Saturday_is_some_day_in_the_middle_of_the_third_week +=== RUN TestDay/when_third_Saturday_is_another_day_in_the_middle_of_the_third_week +=== RUN TestDay/when_third_Sunday_is_some_day_in_the_middle_of_the_third_week +=== RUN TestDay/when_third_Sunday_is_the_21st,_the_last_day_of_the_third_week +=== RUN TestDay/when_fourth_Monday_is_some_day_in_the_middle_of_the_fourth_week +=== RUN TestDay/when_fourth_Monday_is_the_22nd,_the_first_day_of_the_fourth_week +=== RUN TestDay/when_fourth_Tuesday_is_the_28th,_the_last_day_of_the_fourth_week +=== RUN TestDay/when_fourth_Tuesday_is_some_day_in_the_middle_of_the_fourth_week +=== RUN TestDay/when_fourth_Wednesday_is_some_day_in_the_middle_of_the_fourth_week +=== RUN TestDay/when_fourth_Wednesday_is_the_28th,_the_last_day_of_the_fourth_week +=== RUN TestDay/when_fourth_Thursday_is_some_day_in_the_middle_of_the_fourth_week +=== RUN TestDay/when_fourth_Thursday_is_another_day_in_the_middle_of_the_fourth_week +=== RUN TestDay/when_fourth_Friday_is_the_22nd,_the_first_day_of_the_fourth_week +=== RUN TestDay/when_fourth_Friday_is_some_day_in_the_middle_of_the_fourth_week +=== RUN TestDay/when_fourth_Saturday_is_some_day_in_the_middle_of_the_fourth_week +=== RUN TestDay/when_fourth_Saturday_is_another_day_in_the_middle_of_the_fourth_week +=== RUN TestDay/when_fourth_Sunday_is_some_day_in_the_middle_of_the_fourth_week +=== RUN TestDay/when_fourth_Sunday_is_the_28th,_the_last_day_of_the_fourth_week +=== RUN TestDay/last_Monday_in_a_month_with_four_Mondays +=== RUN TestDay/last_Monday_in_a_month_with_five_Mondays +=== RUN TestDay/last_Tuesday_in_a_month_with_four_Tuesdays +=== RUN TestDay/last_Tuesday_in_another_month_with_four_Tuesdays +=== RUN TestDay/last_Wednesday_in_a_month_with_five_Wednesdays +=== RUN TestDay/last_Wednesday_in_a_month_with_four_Wednesdays +=== RUN TestDay/last_Thursday_in_a_month_with_four_Thursdays +=== RUN TestDay/last_Thursday_in_a_month_with_five_Thursdays +=== RUN TestDay/last_Friday_in_a_month_with_five_Fridays +=== RUN TestDay/last_Friday_in_a_month_with_four_Fridays +=== RUN TestDay/last_Saturday_in_a_month_with_four_Saturdays +=== RUN TestDay/last_Saturday_in_another_month_with_four_Saturdays +=== RUN TestDay/last_Sunday_in_a_month_with_five_Sundays +=== RUN TestDay/last_Sunday_in_a_month_with_four_Sundays +=== RUN TestDay/when_last_Wednesday_in_February_in_a_leap_year_is_the_29th +=== RUN TestDay/last_Wednesday_in_December_that_is_also_the_last_day_of_the_year +=== RUN TestDay/when_last_Sunday_in_February_in_a_non-leap_year_is_not_the_29th +=== RUN TestDay/when_first_Friday_is_the_7th,_the_last_day_of_the_first_week +--- PASS: TestDay (0.00s) + --- PASS: TestDay/when_teenth_Monday_is_the_13th,_the_first_day_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Monday_is_the_19th,_the_last_day_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Monday_is_some_day_in_the_middle_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Tuesday_is_the_19th,_the_last_day_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Tuesday_is_some_day_in_the_middle_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Tuesday_is_the_13th,_the_first_day_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Wednesday_is_some_day_in_the_middle_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Wednesday_is_the_13th,_the_first_day_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Wednesday_is_the_19th,_the_last_day_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Thursday_is_some_day_in_the_middle_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Thursday_is_the_13th,_the_first_day_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Thursday_is_the_19th,_the_last_day_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Friday_is_the_19th,_the_last_day_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Friday_is_some_day_in_the_middle_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Friday_is_the_13th,_the_first_day_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Saturday_is_some_day_in_the_middle_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Saturday_is_the_13th,_the_first_day_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Saturday_is_the_19th,_the_last_day_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Sunday_is_the_19th,_the_last_day_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Sunday_is_some_day_in_the_middle_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_teenth_Sunday_is_the_13th,_the_first_day_of_the_teenth_week (0.00s) + --- PASS: TestDay/when_first_Monday_is_some_day_in_the_middle_of_the_first_week (0.00s) + --- PASS: TestDay/when_first_Monday_is_the_1st,_the_first_day_of_the_first_week (0.00s) + --- PASS: TestDay/when_first_Tuesday_is_the_7th,_the_last_day_of_the_first_week (0.00s) + --- PASS: TestDay/when_first_Tuesday_is_some_day_in_the_middle_of_the_first_week (0.00s) + --- PASS: TestDay/when_first_Wednesday_is_some_day_in_the_middle_of_the_first_week (0.00s) + --- PASS: TestDay/when_first_Wednesday_is_the_7th,_the_last_day_of_the_first_week (0.00s) + --- PASS: TestDay/when_first_Thursday_is_some_day_in_the_middle_of_the_first_week (0.00s) + --- PASS: TestDay/when_first_Thursday_is_another_day_in_the_middle_of_the_first_week (0.00s) + --- PASS: TestDay/when_first_Friday_is_the_1st,_the_first_day_of_the_first_week (0.00s) + --- PASS: TestDay/when_first_Friday_is_some_day_in_the_middle_of_the_first_week (0.00s) + --- PASS: TestDay/when_first_Saturday_is_some_day_in_the_middle_of_the_first_week (0.00s) + --- PASS: TestDay/when_first_Saturday_is_another_day_in_the_middle_of_the_first_week (0.00s) + --- PASS: TestDay/when_first_Sunday_is_some_day_in_the_middle_of_the_first_week (0.00s) + --- PASS: TestDay/when_first_Sunday_is_the_7th,_the_last_day_of_the_first_week (0.00s) + --- PASS: TestDay/when_second_Monday_is_some_day_in_the_middle_of_the_second_week (0.00s) + --- PASS: TestDay/when_second_Monday_is_the_8th,_the_first_day_of_the_second_week (0.00s) + --- PASS: TestDay/when_second_Tuesday_is_the_14th,_the_last_day_of_the_second_week (0.00s) + --- PASS: TestDay/when_second_Tuesday_is_some_day_in_the_middle_of_the_second_week (0.00s) + --- PASS: TestDay/when_second_Wednesday_is_some_day_in_the_middle_of_the_second_week (0.00s) + --- PASS: TestDay/when_second_Wednesday_is_the_14th,_the_last_day_of_the_second_week (0.00s) + --- PASS: TestDay/when_second_Thursday_is_some_day_in_the_middle_of_the_second_week (0.00s) + --- PASS: TestDay/when_second_Thursday_is_another_day_in_the_middle_of_the_second_week (0.00s) + --- PASS: TestDay/when_second_Friday_is_the_8th,_the_first_day_of_the_second_week (0.00s) + --- PASS: TestDay/when_second_Friday_is_some_day_in_the_middle_of_the_second_week (0.00s) + --- PASS: TestDay/when_second_Saturday_is_some_day_in_the_middle_of_the_second_week (0.00s) + --- PASS: TestDay/when_second_Saturday_is_another_day_in_the_middle_of_the_second_week (0.00s) + --- PASS: TestDay/when_second_Sunday_is_some_day_in_the_middle_of_the_second_week (0.00s) + --- PASS: TestDay/when_second_Sunday_is_the_14th,_the_last_day_of_the_second_week (0.00s) + --- PASS: TestDay/when_third_Monday_is_some_day_in_the_middle_of_the_third_week (0.00s) + --- PASS: TestDay/when_third_Monday_is_the_15th,_the_first_day_of_the_third_week (0.00s) + --- PASS: TestDay/when_third_Tuesday_is_the_21st,_the_last_day_of_the_third_week (0.00s) + --- PASS: TestDay/when_third_Tuesday_is_some_day_in_the_middle_of_the_third_week (0.00s) + --- PASS: TestDay/when_third_Wednesday_is_some_day_in_the_middle_of_the_third_week (0.00s) + --- PASS: TestDay/when_third_Wednesday_is_the_21st,_the_last_day_of_the_third_week (0.00s) + --- PASS: TestDay/when_third_Thursday_is_some_day_in_the_middle_of_the_third_week (0.00s) + --- PASS: TestDay/when_third_Thursday_is_another_day_in_the_middle_of_the_third_week (0.00s) + --- PASS: TestDay/when_third_Friday_is_the_15th,_the_first_day_of_the_third_week (0.00s) + --- PASS: TestDay/when_third_Friday_is_some_day_in_the_middle_of_the_third_week (0.00s) + --- PASS: TestDay/when_third_Saturday_is_some_day_in_the_middle_of_the_third_week (0.00s) + --- PASS: TestDay/when_third_Saturday_is_another_day_in_the_middle_of_the_third_week (0.00s) + --- PASS: TestDay/when_third_Sunday_is_some_day_in_the_middle_of_the_third_week (0.00s) + --- PASS: TestDay/when_third_Sunday_is_the_21st,_the_last_day_of_the_third_week (0.00s) + --- PASS: TestDay/when_fourth_Monday_is_some_day_in_the_middle_of_the_fourth_week (0.00s) + --- PASS: TestDay/when_fourth_Monday_is_the_22nd,_the_first_day_of_the_fourth_week (0.00s) + --- PASS: TestDay/when_fourth_Tuesday_is_the_28th,_the_last_day_of_the_fourth_week (0.00s) + --- PASS: TestDay/when_fourth_Tuesday_is_some_day_in_the_middle_of_the_fourth_week (0.00s) + --- PASS: TestDay/when_fourth_Wednesday_is_some_day_in_the_middle_of_the_fourth_week (0.00s) + --- PASS: TestDay/when_fourth_Wednesday_is_the_28th,_the_last_day_of_the_fourth_week (0.00s) + --- PASS: TestDay/when_fourth_Thursday_is_some_day_in_the_middle_of_the_fourth_week (0.00s) + --- PASS: TestDay/when_fourth_Thursday_is_another_day_in_the_middle_of_the_fourth_week (0.00s) + --- PASS: TestDay/when_fourth_Friday_is_the_22nd,_the_first_day_of_the_fourth_week (0.00s) + --- PASS: TestDay/when_fourth_Friday_is_some_day_in_the_middle_of_the_fourth_week (0.00s) + --- PASS: TestDay/when_fourth_Saturday_is_some_day_in_the_middle_of_the_fourth_week (0.00s) + --- PASS: TestDay/when_fourth_Saturday_is_another_day_in_the_middle_of_the_fourth_week (0.00s) + --- PASS: TestDay/when_fourth_Sunday_is_some_day_in_the_middle_of_the_fourth_week (0.00s) + --- PASS: TestDay/when_fourth_Sunday_is_the_28th,_the_last_day_of_the_fourth_week (0.00s) + --- PASS: TestDay/last_Monday_in_a_month_with_four_Mondays (0.00s) + --- PASS: TestDay/last_Monday_in_a_month_with_five_Mondays (0.00s) + --- PASS: TestDay/last_Tuesday_in_a_month_with_four_Tuesdays (0.00s) + --- PASS: TestDay/last_Tuesday_in_another_month_with_four_Tuesdays (0.00s) + --- PASS: TestDay/last_Wednesday_in_a_month_with_five_Wednesdays (0.00s) + --- PASS: TestDay/last_Wednesday_in_a_month_with_four_Wednesdays (0.00s) + --- PASS: TestDay/last_Thursday_in_a_month_with_four_Thursdays (0.00s) + --- PASS: TestDay/last_Thursday_in_a_month_with_five_Thursdays (0.00s) + --- PASS: TestDay/last_Friday_in_a_month_with_five_Fridays (0.00s) + --- PASS: TestDay/last_Friday_in_a_month_with_four_Fridays (0.00s) + --- PASS: TestDay/last_Saturday_in_a_month_with_four_Saturdays (0.00s) + --- PASS: TestDay/last_Saturday_in_another_month_with_four_Saturdays (0.00s) + --- PASS: TestDay/last_Sunday_in_a_month_with_five_Sundays (0.00s) + --- PASS: TestDay/last_Sunday_in_a_month_with_four_Sundays (0.00s) + --- PASS: TestDay/when_last_Wednesday_in_February_in_a_leap_year_is_the_29th (0.00s) + --- PASS: TestDay/last_Wednesday_in_December_that_is_also_the_last_day_of_the_year (0.00s) + --- PASS: TestDay/when_last_Sunday_in_February_in_a_non-leap_year_is_not_the_29th (0.00s) + --- PASS: TestDay/when_first_Friday_is_the_7th,_the_last_day_of_the_first_week (0.00s) +=== RUN ExampleDay +--- PASS: ExampleDay (0.00s) PASS -ok meetup 0.007s - -real 0m0.512s -user 0m0.597s -sys 0m0.396s - -=============================================================================== +ok meetup 0.003s -No old benchmarks to run benchstat against. +real 0m0.162s +user 0m0.188s +sys 0m0.148s =============================================================================== -go vet meetup +benchstat benchstat-old.txt benchstat-new.txt +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: meetup +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Day-8 22.46µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.386s -user 0m0.396s -sys 0m0.367s + │ benchstat-new.txt │ + │ B/op │ +Day-8 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-new.txt │ + │ allocs/op │ +Day-8 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -go fix meetup - -real 0m0.158s -user 0m0.149s -sys 0m0.094s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Day-4 54.72µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +Day-4 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./meetup -[gosec] 2022/07/23 22:57:20 Including rules: default -[gosec] 2022/07/23 22:57:20 Excluding rules: default -[gosec] 2022/07/23 22:57:20 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/meetup -2022/07/23 22:57:21 internal error: package "time" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +Day-4 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.400s -user 0m0.383s -sys 0m0.301s +real 0m0.003s +user 0m0.000s +sys 0m0.003s =============================================================================== gomarkdoc --output meetup-doc.md -real 0m0.055s -user 0m0.043s -sys 0m0.026s +real 0m0.015s +user 0m0.007s +sys 0m0.008s =============================================================================== @@ -515,12 +1340,12 @@ Package meetup is used to calculate the days a Meetup meets. CONSTANTS const ( - First WeekSchedule = 1 - Second = 2 - Third = 3 - Fourth = 4 - Teenth = 13 - Last = 6 + First WeekSchedule = 1 // number of matches + Second = 2 // number of matches + Third = 3 // number of matches + Fourth = 4 // number of matches + Teenth = 13 // start search on this day + Last = 6 // number of matches ) WeekSchedule enum values. @@ -537,9 +1362,9 @@ type WeekSchedule int WeekSchedule enum for making requests for the day we're looking for. -real 0m0.192s -user 0m0.101s -sys 0m0.162s +real 0m0.039s +user 0m0.023s +sys 0m0.030s =============================================================================== diff --git a/go/meteorology/benchstat-new.txt b/go/meteorology/benchstat-new.txt new file mode 100644 index 00000000..71f9c596 --- /dev/null +++ b/go/meteorology/benchstat-new.txt @@ -0,0 +1,2 @@ +PASS +ok meteorology 0.002s diff --git a/go/meteorology/coverage-annotations.txt b/go/meteorology/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/meteorology/coverage.html b/go/meteorology/coverage.html new file mode 100644 index 00000000..581eedd3 --- /dev/null +++ b/go/meteorology/coverage.html @@ -0,0 +1,187 @@ + + + + + + meteorology: Go Coverage Report + + + +

+ +
+ not tracked + + no coverage + low coverage + * + * + * + * + * + * + * + * + high coverage + +
+
+
+ + + +
+ + + diff --git a/go/meteorology/meteorology-doc.md b/go/meteorology/meteorology-doc.md index a03c2b97..702fb92b 100755 --- a/go/meteorology/meteorology-doc.md +++ b/go/meteorology/meteorology-doc.md @@ -22,7 +22,7 @@ import "meteorology" ## type [MeteorologyData]() -MeteorologyData type tracks location weather information\. +MeteorologyData type tracks location weather information. ```go type MeteorologyData struct { @@ -36,11 +36,11 @@ type MeteorologyData struct { func (md MeteorologyData) String() string ``` -MeteorologyData String\(\) method that returns a human readable meteorology reading\. +MeteorologyData String\(\) method that returns a human readable meteorology reading. ## type [Speed]() -Speed type tracks wind speed value and unit type\. +Speed type tracks wind speed value and unit type. ```go type Speed struct { @@ -54,17 +54,17 @@ type Speed struct { func (s Speed) String() string ``` -Speed String\(\) method that returns a human readable speed reading\. +Speed String\(\) method that returns a human readable speed reading. ## type [SpeedUnit]() -SpeedUnit Emum declaration\. +SpeedUnit Emum declaration. ```go type SpeedUnit int ``` -Speed Unit Enum definitions\. +Speed Unit Enum definitions. ```go const ( @@ -79,11 +79,11 @@ const ( func (index SpeedUnit) String() string ``` -SpeedUnit String\(\) method that returns a human readable speed unit\. +SpeedUnit String\(\) method that returns a human readable speed unit. ## type [Temperature]() -Temperature type tracks temperature value and unit type\. +Temperature type tracks temperature value and unit type. ```go type Temperature struct { @@ -97,17 +97,17 @@ type Temperature struct { func (t Temperature) String() string ``` -Temperature String\(\) method that returns a human readable temperature reading\. +Temperature String\(\) method that returns a human readable temperature reading. ## type [TemperatureUnit]() -TemperatureUnit Enum declaration\. +TemperatureUnit Enum declaration. ```go type TemperatureUnit int ``` -Temperature Units Enum definitions\. +Temperature Units Enum definitions. ```go const ( @@ -122,7 +122,7 @@ const ( func (index TemperatureUnit) String() string ``` -TemperatureUnit String\(\) method that returns a human readable temperature unit\. +TemperatureUnit String\(\) method that returns a human readable temperature unit. diff --git a/go/meteorology/run-tests-go.txt b/go/meteorology/run-tests-go.txt index f748113f..77603c49 100644 --- a/go/meteorology/run-tests-go.txt +++ b/go/meteorology/run-tests-go.txt @@ -5,16 +5,635 @@ Go packages: meteorology =============================================================================== -golint meteorology -/home/vpayno/git_vpayno/exercism-workspace/go/meteorology/meteorology.go:58:6: type name will be used as meteorology.MeteorologyData by other packages, and that stutters; consider calling this Data +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.209s -user 0m0.186s -sys 0m0.160s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.021s +sys 0m0.028s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +meteorology_examples_test.go:63: File is not `gofumpt`-ed (gofumpt) + +meteorology.go:58:6: type name will be used as meteorology.MeteorologyData by other packages, and that stutters; consider calling this Data (golint) +type MeteorologyData struct { + ^ +meteorology_test.go:26:14: Using the variable on range scope `tt` in function literal (scopelint) + if got := tt.unit.String(); got != tt.want { + ^ +meteorology_test.go:27:48: Using the variable on range scope `tt` in function literal (scopelint) + t.Errorf("unit.String()=%q, want %q", got, tt.want) + ^ +meteorology_test.go:57:14: Using the variable on range scope `tt` in function literal (scopelint) + if got := tt.temp.String(); got != tt.want { + ^ +meteorology_examples_test.go:62: unnecessary leading newline (whitespace) +func ExampleMeteorologyDataString() { + +meteorology_examples_test.go:5:1: tests: ExampleTemperatureUnitString refers to unknown identifier: TemperatureUnitString (govet) +func ExampleTemperatureUnitString() { +^ +meteorology_examples_test.go:16:1: tests: ExampleTemperatureString refers to unknown identifier: TemperatureString (govet) +func ExampleTemperatureString() { +^ +meteorology_examples_test.go:34:1: tests: ExampleSpeedUnitString refers to unknown identifier: SpeedUnitString (govet) +func ExampleSpeedUnitString() { +^ +meteorology_examples_test.go:45:1: tests: ExampleSpeedString refers to unknown identifier: SpeedString (govet) +func ExampleSpeedString() { +^ +meteorology.go:17:2: return with no blank line before (nlreturn) + return units[index] + ^ +meteorology.go:43:2: return with no blank line before (nlreturn) + return units[index] + ^ +meteorology_test.go:7:1: Function TestTemperatureUnitString missing the call to method parallel (paralleltest) +func TestTemperatureUnitString(t *testing.T) { +^ +meteorology_test.go:24:2: Range statement for test TestTemperatureUnitString missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +meteorology_test.go:33:1: Function TestTemperatureString missing the call to method parallel (paralleltest) +func TestTemperatureString(t *testing.T) { +^ +meteorology_test.go:55:2: Range statement for test TestTemperatureString missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +meteorology_test.go:64:1: Function TestSpeedUnitString missing the call to method parallel (paralleltest) +func TestSpeedUnitString(t *testing.T) { +^ +meteorology_test.go:81:2: Range statement for test TestSpeedUnitString missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +meteorology_test.go:90:1: Function TestSpeedString missing the call to method parallel (paralleltest) +func TestSpeedString(t *testing.T) { +^ +meteorology_test.go:112:2: Range statement for test TestSpeedString missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +meteorology_test.go:121:1: Function TestMeteorologyDataString missing the call to method parallel (paralleltest) +func TestMeteorologyDataString(t *testing.T) { +^ +meteorology_test.go:143:2: Range statement for test TestMeteorologyDataString missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +meteorology_examples_test.go:1:9: package should be `meteorology_test` instead of `meteorology` (testpackage) +package meteorology + ^ +meteorology_test.go:1:9: package should be `meteorology_test` instead of `meteorology` (testpackage) +package meteorology + ^ +meteorology.go:68:6: variable name 's' is too short for the scope of its usage (varnamelen) + var s string + ^ + +real 0m0.436s +user 0m0.646s +sys 0m0.386s + + + ============================================================================== + +Exit code: -1 + +real 0m0.485s +user 0m0.671s +sys 0m0.431s + +real 0m0.488s +user 0m0.673s +sys 0m0.432s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.019s +sys 0m0.023s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +meteorology.go + (58, 6) https://revive.run/r#exported type name will be used as meteorology.MeteorologyData by other packages, and that stutters; consider calling this Data + (1, 1) https://revive.run/r#package-comments should have a package comment + + + ✖ 2 problems (0 errors) (2 warnings) + +real 0m0.031s +user 0m0.016s +sys 0m0.023s + + + ============================================================================== + +Exit code: 0 + +real 0m0.069s +user 0m0.042s +sys 0m0.056s + +real 0m0.071s +user 0m0.043s +sys 0m0.058s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.017s +sys 0m0.017s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "meteorology" + +real 0m0.086s +user 0m0.134s +sys 0m0.105s + + + ============================================================================== + +Exit code: -1 + +real 0m0.126s +user 0m0.156s +sys 0m0.140s + +real 0m0.127s +user 0m0.156s +sys 0m0.141s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.025s +sys 0m0.030s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +meteorology.go:1:1: at least one file in a package should have a package comment (ST1000) +meteorology.go:14:1: comment on exported method String should be of the form "String ..." (ST1020) +meteorology.go:26:1: comment on exported method String should be of the form "String ..." (ST1020) +meteorology.go:40:1: comment on exported method String should be of the form "String ..." (ST1020) +meteorology.go:52:1: comment on exported method String should be of the form "String ..." (ST1020) +meteorology.go:66:1: comment on exported method String should be of the form "String ..." (ST1020) + +real 0m0.163s +user 0m0.191s +sys 0m0.134s + + + ============================================================================== + +Exit code: -1 + +real 0m0.204s +user 0m0.222s +sys 0m0.174s + +real 0m0.206s +user 0m0.222s +sys 0m0.176s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.017s +sys 0m0.027s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.823s +user 0m1.901s +sys 0m0.308s + + + ============================================================================== + +Exit code: 0 + +real 0m0.860s +user 0m1.920s +sys 0m0.350s + +real 0m0.862s +user 0m1.921s +sys 0m0.352s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.016s +sys 0m0.025s + + + ============================================================================== + +Running: go vet ./... + +# meteorology +./meteorology_examples_test.go:5:1: ExampleTemperatureUnitString refers to unknown identifier: TemperatureUnitString +./meteorology_examples_test.go:16:1: ExampleTemperatureString refers to unknown identifier: TemperatureString +./meteorology_examples_test.go:34:1: ExampleSpeedUnitString refers to unknown identifier: SpeedUnitString +./meteorology_examples_test.go:45:1: ExampleSpeedString refers to unknown identifier: SpeedString +./meteorology_examples_test.go:62:1: ExampleMeteorologyDataString refers to unknown identifier: MeteorologyDataString + +real 0m0.084s +user 0m0.114s +sys 0m0.106s + + + ============================================================================== + +Exit code: -1 + +real 0m0.118s +user 0m0.137s +sys 0m0.139s + +real 0m0.119s +user 0m0.138s +sys 0m0.140s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.014s +sys 0m0.019s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.024s +user 0m0.021s +sys 0m0.018s + + + ============================================================================== + +Exit code: 0 + +real 0m0.054s +user 0m0.037s +sys 0m0.048s + +real 0m0.056s +user 0m0.039s +sys 0m0.048s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.017s +sys 0m0.024s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.415s +user 0m1.288s +sys 0m0.264s + + + ============================================================================== + +Exit code: 0 + +real 0m0.454s +user 0m1.309s +sys 0m0.299s + +real 0m0.455s +user 0m1.309s +sys 0m0.301s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.040s +user 0m0.028s +sys 0m0.039s + + + ============================================================================== + +Running: gocyclo . + +3 meteorology TestMeteorologyDataString meteorology_test.go:121:1 +3 meteorology TestSpeedString meteorology_test.go:90:1 +3 meteorology TestSpeedUnitString meteorology_test.go:64:1 +3 meteorology TestTemperatureString meteorology_test.go:33:1 +3 meteorology TestTemperatureUnitString meteorology_test.go:7:1 +1 meteorology ExampleMeteorologyDataString meteorology_examples_test.go:62:1 +1 meteorology ExampleSpeedString meteorology_examples_test.go:45:1 +1 meteorology ExampleSpeedUnitString meteorology_examples_test.go:34:1 +1 meteorology ExampleTemperatureString meteorology_examples_test.go:16:1 +1 meteorology ExampleTemperatureUnitString meteorology_examples_test.go:5:1 +1 meteorology (MeteorologyData).String meteorology.go:67:1 +1 meteorology (Speed).String meteorology.go:53:1 +1 meteorology (SpeedUnit).String meteorology.go:41:1 +1 meteorology (Temperature).String meteorology.go:27:1 +1 meteorology (TemperatureUnit).String meteorology.go:15:1 + +real 0m0.003s +user 0m0.000s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.059s +user 0m0.034s +sys 0m0.056s + +real 0m0.061s +user 0m0.036s +sys 0m0.057s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.025s +user 0m0.028s +sys 0m0.010s + + + ============================================================================== + +Exit code: 0 + +real 0m0.034s +user 0m0.033s +sys 0m0.018s + +real 0m0.036s +user 0m0.033s +sys 0m0.019s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out meteorology +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.025s +sys 0m0.031s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:25:13 Including rules: default +[gosec] 2023/09/07 00:25:13 Excluding rules: default +[gosec] 2023/09/07 00:25:13 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/meteorology +[gosec] 2023/09/07 00:25:13 Checking package: meteorology +[gosec] 2023/09/07 00:25:13 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/meteorology/meteorology.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 75 + Nosec : 0 + Issues : 0 + + +real 0m0.123s +user 0m0.147s +sys 0m0.096s + + + ============================================================================== + +Exit code: 0 + +real 0m0.165s +user 0m0.177s +sys 0m0.138s + +real 0m0.167s +user 0m0.177s +sys 0m0.140s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.020s +sys 0m0.023s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestTemperatureUnitString === RUN TestTemperatureUnitString/Celsius_unit === RUN TestTemperatureUnitString/Fahrenheit_unit @@ -63,15 +682,17 @@ go test -v -covermode=count -coverprofile coverage.out meteorology --- PASS: ExampleMeteorologyDataString (0.00s) PASS coverage: 100.0% of statements -ok meteorology 0.013s coverage: 100.0% of statements +ok meteorology 0.006s coverage: 100.0% of statements -real 0m0.672s -user 0m0.734s -sys 0m0.588s +real 0m0.214s +user 0m0.285s +sys 0m0.168s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + meteorology/meteorology.go:15: String 100.0% meteorology/meteorology.go:27: String 100.0% meteorology/meteorology.go:41: String 100.0% @@ -79,13 +700,40 @@ meteorology/meteorology.go:53: String 100.0% meteorology/meteorology.go:67: String 100.0% total: (statements) 100.0% -real 0m0.307s -user 0m0.359s -sys 0m0.222s +real 0m0.043s +user 0m0.058s +sys 0m0.067s -=============================================================================== -go test -v -race -covermode=atomic meteorology + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.045s +user 0m0.058s +sys 0m0.074s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.018s +user 0m0.021s +sys 0m0.019s + +real 0m0.018s +user 0m0.021s +sys 0m0.019s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestTemperatureUnitString === RUN TestTemperatureUnitString/Celsius_unit === RUN TestTemperatureUnitString/Fahrenheit_unit @@ -134,73 +782,102 @@ go test -v -race -covermode=atomic meteorology --- PASS: ExampleMeteorologyDataString (0.00s) PASS coverage: 100.0% of statements -ok meteorology (cached) coverage: 100.0% of statements +ok meteorology 1.016s coverage: 100.0% of statements -real 0m0.545s -user 0m0.608s -sys 0m0.370s +real 0m1.251s +user 0m0.302s +sys 0m0.135s -=============================================================================== -go test --bench . --benchmem -PASS -ok meteorology 0.023s + ============================================================================== -real 0m0.622s -user 0m0.763s -sys 0m0.414s +Exit code: 0 -=============================================================================== +real 0m1.610s +user 0m0.752s +sys 0m0.496s -go test -tags bonus -PASS -ok meteorology 0.009s - -real 0m0.549s -user 0m0.634s -sys 0m0.436s +real 0m1.612s +user 0m0.753s +sys 0m0.496s =============================================================================== -go vet meteorology -# meteorology -./meteorology_examples_test.go:5:1: ExampleTemperatureUnitString refers to unknown identifier: TemperatureUnitString -./meteorology_examples_test.go:16:1: ExampleTemperatureString refers to unknown identifier: TemperatureString -./meteorology_examples_test.go:34:1: ExampleSpeedUnitString refers to unknown identifier: SpeedUnitString -./meteorology_examples_test.go:45:1: ExampleSpeedString refers to unknown identifier: SpeedString -./meteorology_examples_test.go:62:1: ExampleMeteorologyDataString refers to unknown identifier: MeteorologyDataString +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok meteorology 0.002s -real 0m0.367s -user 0m0.450s -sys 0m0.336s +real 0m0.158s +user 0m0.186s +sys 0m0.139s =============================================================================== -go fix meteorology +gotest -v -tags bonus +=== RUN TestTemperatureUnitString +=== RUN TestTemperatureUnitString/Celsius_unit +=== RUN TestTemperatureUnitString/Fahrenheit_unit +--- PASS: TestTemperatureUnitString (0.00s) + --- PASS: TestTemperatureUnitString/Celsius_unit (0.00s) + --- PASS: TestTemperatureUnitString/Fahrenheit_unit (0.00s) +=== RUN TestTemperatureString +=== RUN TestTemperatureString/21_degree_Celsius +=== RUN TestTemperatureString/32_degree_Fahrenheit +=== RUN TestTemperatureString/minus_17_degree_Celsius +--- PASS: TestTemperatureString (0.00s) + --- PASS: TestTemperatureString/21_degree_Celsius (0.00s) + --- PASS: TestTemperatureString/32_degree_Fahrenheit (0.00s) + --- PASS: TestTemperatureString/minus_17_degree_Celsius (0.00s) +=== RUN TestSpeedUnitString +=== RUN TestSpeedUnitString/kmPerHour +=== RUN TestSpeedUnitString/milesPerHour +--- PASS: TestSpeedUnitString (0.00s) + --- PASS: TestSpeedUnitString/kmPerHour (0.00s) + --- PASS: TestSpeedUnitString/milesPerHour (0.00s) +=== RUN TestSpeedString +=== RUN TestSpeedString/18_kilometers_per_hour +=== RUN TestSpeedString/30_miles_per_hour +=== RUN TestSpeedString/0_kilometers_per_hour +--- PASS: TestSpeedString (0.00s) + --- PASS: TestSpeedString/18_kilometers_per_hour (0.00s) + --- PASS: TestSpeedString/30_miles_per_hour (0.00s) + --- PASS: TestSpeedString/0_kilometers_per_hour (0.00s) +=== RUN TestMeteorologyDataString +=== RUN TestMeteorologyDataString/Athens +=== RUN TestMeteorologyDataString/Delhi +=== RUN TestMeteorologyDataString/San_Francisco +--- PASS: TestMeteorologyDataString (0.00s) + --- PASS: TestMeteorologyDataString/Athens (0.00s) + --- PASS: TestMeteorologyDataString/Delhi (0.00s) + --- PASS: TestMeteorologyDataString/San_Francisco (0.00s) +=== RUN ExampleTemperatureUnitString +--- PASS: ExampleTemperatureUnitString (0.00s) +=== RUN ExampleTemperatureString +--- PASS: ExampleTemperatureString (0.00s) +=== RUN ExampleSpeedUnitString +--- PASS: ExampleSpeedUnitString (0.00s) +=== RUN ExampleSpeedString +--- PASS: ExampleSpeedString (0.00s) +=== RUN ExampleMeteorologyDataString +--- PASS: ExampleMeteorologyDataString (0.00s) +PASS +ok meteorology 0.002s -real 0m0.227s -user 0m0.189s -sys 0m0.170s +real 0m0.141s +user 0m0.187s +sys 0m0.145s =============================================================================== -gosec ./meteorology -[gosec] 2022/06/20 20:47:52 Including rules: default -[gosec] 2022/06/20 20:47:52 Excluding rules: default -[gosec] 2022/06/20 20:47:52 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/meteorology -2022/06/20 20:47:53 internal error: package "fmt" without types was imported from "command-line-arguments" - -real 0m0.542s -user 0m0.589s -sys 0m0.411s +No old benchmarks to run benchstat against. =============================================================================== gomarkdoc --output meteorology-doc.md -real 0m0.025s -user 0m0.022s -sys 0m0.014s +real 0m0.013s +user 0m0.008s +sys 0m0.005s =============================================================================== @@ -262,9 +939,9 @@ func (index TemperatureUnit) String() string unit. -real 0m0.314s -user 0m0.233s -sys 0m0.270s +real 0m0.044s +user 0m0.023s +sys 0m0.043s =============================================================================== diff --git a/go/need-for-speed/benchstat-new.txt b/go/need-for-speed/benchstat-new.txt new file mode 100644 index 00000000..c8ff06b4 --- /dev/null +++ b/go/need-for-speed/benchstat-new.txt @@ -0,0 +1,2 @@ +PASS +ok speed 0.002s diff --git a/go/need-for-speed/coverage-annotations.txt b/go/need-for-speed/coverage-annotations.txt new file mode 100644 index 00000000..1df3ece6 --- /dev/null +++ b/go/need-for-speed/coverage-annotations.txt @@ -0,0 +1,17 @@ + +45 func CanFinish(car Car, track Track) bool { +46 var result bool +47 var steps int +48 +49 steps = track.distance / car.speed +50 if track.distance%car.speed > 0 { +51 MISS steps++ +52 } +53 +54 if steps*car.batteryDrain <= car.battery { +55 result = true +56 } +57 +58 return result +59 } + diff --git a/go/need-for-speed/coverage.html b/go/need-for-speed/coverage.html new file mode 100644 index 00000000..d3ab405c --- /dev/null +++ b/go/need-for-speed/coverage.html @@ -0,0 +1,171 @@ + + + + + + speed: Go Coverage Report + + + +
+ +
+ not tracked + + no coverage + low coverage + * + * + * + * + * + * + * + * + high coverage + +
+
+
+ + + +
+ + + diff --git a/go/need-for-speed/coverage.out b/go/need-for-speed/coverage.out index 7b7303a2..b0eac5b5 100644 --- a/go/need-for-speed/coverage.out +++ b/go/need-for-speed/coverage.out @@ -2,10 +2,10 @@ mode: count speed/need_for_speed.go:12.42,21.2 2 4 speed/need_for_speed.go:29.35,31.2 1 4 speed/need_for_speed.go:35.25,36.37 1 6 -speed/need_for_speed.go:41.2,41.12 1 6 speed/need_for_speed.go:36.37,39.3 2 3 +speed/need_for_speed.go:41.2,41.12 1 6 speed/need_for_speed.go:45.43,50.34 4 6 -speed/need_for_speed.go:54.2,54.43 1 6 -speed/need_for_speed.go:58.2,58.15 1 6 speed/need_for_speed.go:50.34,52.3 1 0 +speed/need_for_speed.go:54.2,54.43 1 6 speed/need_for_speed.go:54.43,56.3 1 4 +speed/need_for_speed.go:58.2,58.15 1 6 diff --git a/go/need-for-speed/run-tests-go.txt b/go/need-for-speed/run-tests-go.txt index a21ca3cc..b23a8c28 100644 --- a/go/need-for-speed/run-tests-go.txt +++ b/go/need-for-speed/run-tests-go.txt @@ -5,15 +5,616 @@ Go packages: speed =============================================================================== -golint speed +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.011s +sys 0m0.014s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +need_for_speed_test.go:75: Function 'TestDrive' is too long (91 > 60) (funlen) +func TestDrive(t *testing.T) { +need_for_speed_test.go:169: Function 'TestCanFinish' is too long (82 > 60) (funlen) +func TestCanFinish(t *testing.T) { +need_for_speed.go:3:14: Comment should end in a period (godot) +// Car struct + ^ +need_for_speed.go:23:16: Comment should end in a period (godot) +// Track struct + ^ +need_for_speed.go:28:32: Comment should end in a period (godot) +// NewTrack created a new track + ^ +need_for_speed_test.go:35: File is not `gofumpt`-ed (gofumpt) + +need_for_speed.go:13:10: var-declaration: should omit type Car from declaration of var car; it will be inferred from the right-hand side (revive) + var car Car = Car{ + ^ +need_for_speed_test.go:28:18: Using the variable on range scope `tt` in function literal (scopelint) + got := NewCar(tt.car.speed, tt.car.batteryDrain) + ^ +need_for_speed_test.go:30:14: Using the variable on range scope `tt` in function literal (scopelint) + if got != tt.expected { + ^ +need_for_speed_test.go:31:53: Using the variable on range scope `tt` in function literal (scopelint) + t.Errorf("NewCar(%+v,%+v) = %+v; expected %+v", tt.car.speed, tt.car.batteryDrain, got, tt.expected) + ^ +need_for_speed.go:47:2: declarations should never be cuddled (wsl) + var steps int + ^ +need_for_speed_test.go:36:1: block should not end with a whitespace (or comment) (wsl) +} +^ +need_for_speed_test.go:13:9: distance is missing in Car (exhaustivestruct) + car: Car{ + ^ +need_for_speed_test.go:18:14: distance is missing in Car (exhaustivestruct) + expected: Car{ + ^ +need_for_speed.go:14:17: mnd: Magic number: 100, in detected (gomnd) + battery: 100, + ^ +need_for_speed_test.go:5:1: Function TestNewCar missing the call to method parallel (paralleltest) +func TestNewCar(t *testing.T) { +^ +need_for_speed_test.go:26:2: Range statement for test TestNewCar missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +need_for_speed_test.go:38:1: Function TestNewTrack missing the call to method parallel (paralleltest) +func TestNewTrack(t *testing.T) { +^ +need_for_speed_test.go:64:2: Range statement for test TestNewTrack missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +need_for_speed_test.go:158:2: Range statement for test TestDrive missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +need_for_speed_test.go:243:2: Range statement for test TestCanFinish missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +need_for_speed_examples_test.go:1:9: package should be `speed_test` instead of `speed` (testpackage) +package speed + ^ +need_for_speed_test.go:1:9: package should be `speed_test` instead of `speed` (testpackage) +package speed + ^ + +real 0m0.454s +user 0m0.723s +sys 0m0.402s + + + ============================================================================== + +Exit code: -1 + +real 0m0.491s +user 0m0.741s +sys 0m0.433s + +real 0m0.493s +user 0m0.742s +sys 0m0.435s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.006s +sys 0m0.008s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +need_for_speed.go + (1, 1) https://revive.run/r#package-comments should have a package comment + (13, 10) https://revive.run/r#var-declaration should omit type Car from declaration of var car; it will be inferred from the right-hand side + + + ✖ 2 problems (0 errors) (2 warnings) + +real 0m0.027s +user 0m0.015s +sys 0m0.019s + + + ============================================================================== + +Exit code: 0 + +real 0m0.047s +user 0m0.028s +sys 0m0.035s + +real 0m0.050s +user 0m0.028s +sys 0m0.038s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.006s +sys 0m0.007s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "speed [speed.test]" + +real 0m0.089s +user 0m0.126s +sys 0m0.115s + + + ============================================================================== + +Exit code: -1 + +real 0m0.111s +user 0m0.138s +sys 0m0.131s + +real 0m0.113s +user 0m0.140s +sys 0m0.131s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.004s +sys 0m0.015s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +need_for_speed.go:1:1: at least one file in a package should have a package comment (ST1000) +need_for_speed.go:13:10: should omit type Car from declaration; it will be inferred from the right-hand side (ST1023) +need_for_speed.go:47:2: should merge variable declaration with assignment on next line (S1021) + +real 0m0.190s +user 0m0.220s +sys 0m0.131s + + + ============================================================================== + +Exit code: -1 + +real 0m0.219s +user 0m0.230s +sys 0m0.161s + +real 0m0.222s +user 0m0.231s +sys 0m0.162s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.008s +sys 0m0.010s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./need_for_speed_examples_test.go:14:2: commentedOutCode: may want to remove commented-out code + +real 0m0.860s +user 0m2.156s +sys 0m0.342s + + + ============================================================================== + +Exit code: -1 + +real 0m0.887s +user 0m2.171s +sys 0m0.363s + +real 0m0.888s +user 0m2.171s +sys 0m0.364s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.002s +sys 0m0.014s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.076s +user 0m0.133s +sys 0m0.109s + + + ============================================================================== + +Exit code: 0 + +real 0m0.102s +user 0m0.143s +sys 0m0.131s + +real 0m0.104s +user 0m0.144s +sys 0m0.132s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.007s +sys 0m0.008s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.020s +user 0m0.009s +sys 0m0.015s + + + ============================================================================== + +Exit code: 0 + +real 0m0.042s +user 0m0.022s +sys 0m0.030s + +real 0m0.044s +user 0m0.024s +sys 0m0.030s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.008s +sys 0m0.009s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.432s +user 0m1.245s +sys 0m0.271s + + + ============================================================================== + +Exit code: 0 + +real 0m0.458s +user 0m1.257s +sys 0m0.292s + +real 0m0.460s +user 0m1.259s +sys 0m0.292s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.010s +sys 0m0.015s + + + ============================================================================== + +Running: gocyclo . + +3 speed TestCanFinish need_for_speed_test.go:169:1 +3 speed TestDrive need_for_speed_test.go:75:1 +3 speed TestNewTrack need_for_speed_test.go:38:1 +3 speed TestNewCar need_for_speed_test.go:5:1 +3 speed CanFinish need_for_speed.go:45:1 +2 speed Drive need_for_speed.go:35:1 +1 speed ExampleCanFinish need_for_speed_examples_test.go:23:1 +1 speed ExampleDrive need_for_speed_examples_test.go:17:1 +1 speed ExampleNewTrack need_for_speed_examples_test.go:12:1 +1 speed ExampleNewCar need_for_speed_examples_test.go:7:1 +1 speed NewTrack need_for_speed.go:29:1 +1 speed NewCar need_for_speed.go:12:1 + +real 0m0.003s +user 0m0.000s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.033s +user 0m0.015s +sys 0m0.029s + +real 0m0.036s +user 0m0.016s +sys 0m0.030s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.031s +user 0m0.032s +sys 0m0.016s + + + ============================================================================== + +Exit code: 0 + +real 0m0.048s +user 0m0.042s +sys 0m0.030s + +real 0m0.051s +user 0m0.045s +sys 0m0.030s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.006s +sys 0m0.017s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:25:18 Including rules: default +[gosec] 2023/09/07 00:25:18 Excluding rules: default +[gosec] 2023/09/07 00:25:18 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/need-for-speed +[gosec] 2023/09/07 00:25:18 Checking package: speed +[gosec] 2023/09/07 00:25:18 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/need-for-speed/need_for_speed.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 59 + Nosec : 0 + Issues : 0 + real 0m0.090s -user 0m0.050s -sys 0m0.093s +user 0m0.079s +sys 0m0.059s + + + ============================================================================== + +Exit code: 0 + +real 0m0.124s +user 0m0.091s +sys 0m0.090s + +real 0m0.127s +user 0m0.093s +sys 0m0.092s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out speed +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.008s +sys 0m0.007s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestNewCar === RUN TestNewCar/Create_a_new_car. --- PASS: TestNewCar (0.00s) @@ -58,28 +659,74 @@ go test -v -covermode=count -coverprofile coverage.out speed --- PASS: ExampleCanFinish (0.00s) PASS coverage: 93.3% of statements -ok speed 0.003s coverage: 93.3% of statements +ok speed 0.002s coverage: 93.3% of statements -real 0m0.706s -user 0m0.765s -sys 0m0.607s +real 0m0.174s +user 0m0.244s +sys 0m0.163s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + speed/need_for_speed.go:12: NewCar 100.0% speed/need_for_speed.go:29: NewTrack 100.0% speed/need_for_speed.go:35: Drive 100.0% speed/need_for_speed.go:45: CanFinish 87.5% total: (statements) 93.3% -real 0m0.082s -user 0m0.036s -sys 0m0.098s +real 0m0.034s +user 0m0.018s +sys 0m0.028s -=============================================================================== -go test -v -race -covermode=atomic speed + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.022s +user 0m0.009s +sys 0m0.017s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +45 func CanFinish(car Car, track Track) bool { +46 var result bool +47 var steps int +48 +49 steps = track.distance / car.speed +50 if track.distance%car.speed > 0 { +51 MISS steps++ +52 } +53 +54 if steps*car.batteryDrain <= car.battery { +55 result = true +56 } +57 +58 return result +59 } + + +real 0m0.012s +user 0m0.008s +sys 0m0.008s + +real 0m0.012s +user 0m0.008s +sys 0m0.008s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestNewCar === RUN TestNewCar/Create_a_new_car. --- PASS: TestNewCar (0.00s) @@ -124,78 +771,98 @@ go test -v -race -covermode=atomic speed --- PASS: ExampleCanFinish (0.00s) PASS coverage: 93.3% of statements -ok speed 0.057s coverage: 93.3% of statements +ok speed 1.012s coverage: 93.3% of statements -real 0m0.749s -user 0m0.800s -sys 0m0.465s +real 0m1.245s +user 0m0.279s +sys 0m0.157s -=============================================================================== -go test --bench . --benchmem -PASS -ok speed 0.016s + ============================================================================== -real 0m0.579s -user 0m0.711s -sys 0m0.463s +Exit code: 0 -=============================================================================== +real 0m1.508s +user 0m0.569s +sys 0m0.389s -go test -tags bonus -PASS -ok speed 0.010s - -real 0m0.583s -user 0m0.636s -sys 0m0.477s +real 0m1.510s +user 0m0.571s +sys 0m0.389s =============================================================================== -go vet speed +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok speed 0.002s -real 0m0.384s -user 0m0.442s -sys 0m0.371s +real 0m0.169s +user 0m0.211s +sys 0m0.158s =============================================================================== -go fix speed +gotest -v -tags bonus +=== RUN TestNewCar +=== RUN TestNewCar/Create_a_new_car. +--- PASS: TestNewCar (0.00s) + --- PASS: TestNewCar/Create_a_new_car. (0.00s) +=== RUN TestNewTrack +=== RUN TestNewTrack/Create_a_new_track. +=== RUN TestNewTrack/Create_a_new_track.#01 +--- PASS: TestNewTrack (0.00s) + --- PASS: TestNewTrack/Create_a_new_track. (0.00s) + --- PASS: TestNewTrack/Create_a_new_track.#01 (0.00s) +=== RUN TestDrive +=== RUN TestDrive/Drive_the_car_with_full_battery. +=== RUN TestDrive/Drive_when_battery_percentage_is_below_battery_drain +=== RUN TestDrive/Drive_the_car_with_battery_drained. +=== RUN TestDrive/Drive_the_car_with_positive_initial_distance_and_battery_drained +=== RUN TestDrive/Drive_the_car_with_positive_initial_distance_and_full_battery +--- PASS: TestDrive (0.00s) + --- PASS: TestDrive/Drive_the_car_with_full_battery. (0.00s) + --- PASS: TestDrive/Drive_when_battery_percentage_is_below_battery_drain (0.00s) + --- PASS: TestDrive/Drive_the_car_with_battery_drained. (0.00s) + --- PASS: TestDrive/Drive_the_car_with_positive_initial_distance_and_battery_drained (0.00s) + --- PASS: TestDrive/Drive_the_car_with_positive_initial_distance_and_full_battery (0.00s) +=== RUN TestCanFinish +=== RUN TestCanFinish/Car_can_easily_finish_the_track_distance. +=== RUN TestCanFinish/Car_can_finish_the_track_distance_just_as_the_battery_is_drained. +=== RUN TestCanFinish/Car_cannot_finish_the_track_distance. +=== RUN TestCanFinish/Car_can_finish_the_track_distance_with_initial_battery_less_than_100% +=== RUN TestCanFinish/Car_cannot_finish_the_track_distance_with_initial_battery_less_than_100% +--- PASS: TestCanFinish (0.00s) + --- PASS: TestCanFinish/Car_can_easily_finish_the_track_distance. (0.00s) + --- PASS: TestCanFinish/Car_can_finish_the_track_distance_just_as_the_battery_is_drained. (0.00s) + --- PASS: TestCanFinish/Car_cannot_finish_the_track_distance. (0.00s) + --- PASS: TestCanFinish/Car_can_finish_the_track_distance_with_initial_battery_less_than_100% (0.00s) + --- PASS: TestCanFinish/Car_cannot_finish_the_track_distance_with_initial_battery_less_than_100% (0.00s) +=== RUN ExampleNewCar +--- PASS: ExampleNewCar (0.00s) +=== RUN ExampleNewTrack +--- PASS: ExampleNewTrack (0.00s) +=== RUN ExampleDrive +--- PASS: ExampleDrive (0.00s) +=== RUN ExampleCanFinish +--- PASS: ExampleCanFinish (0.00s) +PASS +ok speed 0.002s -real 0m0.060s -user 0m0.027s -sys 0m0.046s +real 0m0.123s +user 0m0.152s +sys 0m0.101s =============================================================================== -gosec ./need-for-speed -[gosec] 2022/06/20 23:35:15 Including rules: default -[gosec] 2022/06/20 23:35:15 Excluding rules: default -[gosec] 2022/06/20 23:35:15 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/need-for-speed -[gosec] 2022/06/20 23:35:15 Checking package: speed -[gosec] 2022/06/20 23:35:15 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/need-for-speed/need_for_speed.go -Results: - - -Summary: - Gosec : dev - Files : 1 - Lines : 59 - Nosec : 0 - Issues : 0 - - -real 0m0.387s -user 0m0.341s -sys 0m0.299s +No old benchmarks to run benchstat against. =============================================================================== gomarkdoc --output speed-doc.md -real 0m0.033s -user 0m0.019s -sys 0m0.020s +real 0m0.014s +user 0m0.010s +sys 0m0.005s =============================================================================== @@ -233,9 +900,9 @@ func NewTrack(distance int) Track NewTrack created a new track -real 0m0.139s -user 0m0.064s -sys 0m0.147s +real 0m0.027s +user 0m0.015s +sys 0m0.019s =============================================================================== diff --git a/go/need-for-speed/speed-doc.md b/go/need-for-speed/speed-doc.md index 3ed1ffdd..257ce80b 100755 --- a/go/need-for-speed/speed-doc.md +++ b/go/need-for-speed/speed-doc.md @@ -22,7 +22,7 @@ import "speed" func CanFinish(car Car, track Track) bool ``` -CanFinish checks if a car is able to finish a certain track\. +CanFinish checks if a car is able to finish a certain track.
Example

@@ -61,7 +61,7 @@ type Car struct { func Drive(car Car) Car ``` -Drive drives the car one time\. If there is not enough battery to drive on more time\, the car will not move\. +Drive drives the car one time. If there is not enough battery to drive on more time, the car will not move.

Example

@@ -89,7 +89,7 @@ Drive drives the car one time\. If there is not enough battery to drive on more func NewCar(speed, batteryDrain int) Car ``` -NewCar creates a new remote controlled car with full battery and given specifications\. +NewCar creates a new remote controlled car with full battery and given specifications.

Example

diff --git a/go/nth-prime/benchstat-new.txt b/go/nth-prime/benchstat-new.txt index 98d8375d..f05004c6 100644 --- a/go/nth-prime/benchstat-new.txt +++ b/go/nth-prime/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: prime -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkNth-4 15 99131219 ns/op 7228028 B/op 4761 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkNth +BenchmarkNth-8 54 19159865 ns/op 6984784 B/op 2936 allocs/op PASS -ok prime 1.606s +ok prime 1.060s diff --git a/go/nth-prime/benchstat-old.txt b/go/nth-prime/benchstat-old.txt index b9be8546..98d8375d 100644 --- a/go/nth-prime/benchstat-old.txt +++ b/go/nth-prime/benchstat-old.txt @@ -2,6 +2,6 @@ goos: linux goarch: amd64 pkg: prime cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkNth-4 18 101300890 ns/op 7236517 B/op 4784 allocs/op +BenchmarkNth-4 15 99131219 ns/op 7228028 B/op 4761 allocs/op PASS -ok prime 1.956s +ok prime 1.606s diff --git a/go/nth-prime/coverage-annotations.txt b/go/nth-prime/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/nth-prime/coverage.html b/go/nth-prime/coverage.html index 23731b10..9c46c5fb 100644 --- a/go/nth-prime/coverage.html +++ b/go/nth-prime/coverage.html @@ -88,7 +88,7 @@ ) // Nth returns the nth prime number. An error must be returned if the nth prime number can't be calculated ('n' is equal or less than zero) -func Nth(input int) (int, error) { +func Nth(input int) (int, error) { if input < 1 { return 0, errors.New("the nth prime has to be equal to or greater than 1") } @@ -133,9 +133,9 @@ numbers[i] = true } - for number, isPrime := range numbers { - if isPrime { - for x, j := 1, number*number; j <= limit; x, j = x+1, number*number+x*number { + for number, isPrime := range numbers { + if isPrime { + for x, j := 1, number*number; j <= limit; x, j = x+1, number*number+x*number { numbers[j] = false } } diff --git a/go/nth-prime/coverage.out b/go/nth-prime/coverage.out index 246400f0..7918c03d 100644 --- a/go/nth-prime/coverage.out +++ b/go/nth-prime/coverage.out @@ -1,25 +1,25 @@ mode: count prime/nth_prime.go:11.34,12.15 1 16 -prime/nth_prime.go:16.2,23.27 4 14 -prime/nth_prime.go:31.2,31.19 1 14 prime/nth_prime.go:12.15,14.3 1 2 +prime/nth_prime.go:16.2,23.27 4 14 prime/nth_prime.go:23.27,29.3 3 14 +prime/nth_prime.go:31.2,31.19 1 14 prime/nth_prime.go:35.60,39.31 2 14 +prime/nth_prime.go:39.31,41.3 1 7 prime/nth_prime.go:44.2,49.16 2 14 +prime/nth_prime.go:49.16,51.3 1 14 prime/nth_prime.go:52.2,52.33 1 14 +prime/nth_prime.go:52.33,54.3 1 55347 prime/nth_prime.go:56.2,56.39 1 14 +prime/nth_prime.go:56.39,57.14 1 87932 +prime/nth_prime.go:57.14,58.81 1 23214 +prime/nth_prime.go:58.81,60.5 1 234792 prime/nth_prime.go:64.2,71.25 6 14 -prime/nth_prime.go:88.2,88.39 1 14 -prime/nth_prime.go:94.2,96.15 2 14 -prime/nth_prime.go:39.31,41.3 1 7 -prime/nth_prime.go:49.16,51.3 1 14 -prime/nth_prime.go:52.33,54.3 1 55347 -prime/nth_prime.go:56.39,57.14 1 83648 -prime/nth_prime.go:57.14,58.81 1 28053 -prime/nth_prime.go:58.81,60.5 1 295141 prime/nth_prime.go:71.25,73.21 1 415 -prime/nth_prime.go:85.3,85.10 1 415 prime/nth_prime.go:73.21,78.23 4 113 prime/nth_prime.go:78.23,82.5 3 19430 +prime/nth_prime.go:85.3,85.10 1 415 +prime/nth_prime.go:88.2,88.39 1 14 prime/nth_prime.go:88.39,89.14 1 92101 prime/nth_prime.go:89.14,91.4 1 10654 +prime/nth_prime.go:94.2,96.15 2 14 diff --git a/go/nth-prime/prime-doc.md b/go/nth-prime/prime-doc.md index e4762813..64880995 100755 --- a/go/nth-prime/prime-doc.md +++ b/go/nth-prime/prime-doc.md @@ -6,7 +6,7 @@ import "prime" ``` -Package prime determines the nth prime\. +Package prime determines the nth prime. ## Index @@ -19,7 +19,7 @@ Package prime determines the nth prime\. func Nth(input int) (int, error) ``` -Nth returns the nth prime number\. An error must be returned if the nth prime number can't be calculated \('n' is equal or less than zero\) +Nth returns the nth prime number. An error must be returned if the nth prime number can't be calculated \('n' is equal or less than zero\)

Example

diff --git a/go/nth-prime/run-tests-go.txt b/go/nth-prime/run-tests-go.txt index 5cda37d5..e479dab3 100644 --- a/go/nth-prime/run-tests-go.txt +++ b/go/nth-prime/run-tests-go.txt @@ -5,166 +5,809 @@ Go packages: prime =============================================================================== -golint prime +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.014s +sys 0m0.028s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +nth_prime_test.go:28:6: Error return value is not checked (errcheck) + Nth(10001) + ^ +nth_prime.go:35: Function 'findPrimeWithSieve' is too long (61 > 60) (funlen) +func findPrimeWithSieve(searchTarget int, limit int) []int { +nth_prime.go:10:140: Comment should end in a period (godot) +// Nth returns the nth prime number. An error must be returned if the nth prime number can't be calculated ('n' is equal or less than zero) + ^ +nth_prime.go:38:45: `substract` is a misspelling of `subtract` (misspell) + // If limit is greater than 2 and is even, substract 1. + ^ +nth_prime.go:21:17: var-declaration: should omit type int from declaration of var searchSize; it will be inferred from the right-hand side (revive) + var searchSize int = input * 11 + ^ +nth_prime_test.go:8:23: Using the variable on range scope `tc` in function literal (scopelint) + actual, err := Nth(tc.input) + ^ +nth_prime_test.go:10:9: Using the variable on range scope `tc` in function literal (scopelint) + case tc.err != "": + ^ +nth_prime_test.go:12:54: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("Nth(%d) expected error: %q, got: %d", tc.input, tc.err, actual) + ^ +nth_prime.go:71: unnecessary leading newline (whitespace) + for outer <= sqrtLimit { + +nth_prime.go:17:2: declarations should never be cuddled (wsl) + var prime int + ^ +nth_prime.go:52:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 3; i <= limit; i += 2 { + ^ +nth_prime.go:68:2: declarations should never be cuddled (wsl) + var square int + ^ +nth_prime.go:69:2: declarations should never be cuddled (wsl) + var inner int + ^ +nth_prime_test.go:27:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:6:5: tests is a global variable (gochecknoglobals) +var tests = []struct { + ^ +nth_prime.go:13:13: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"the nth prime has to be equal to or greater than 1\")" (goerr113) + return 0, errors.New("the nth prime has to be equal to or greater than 1") + ^ +nth_prime.go:49:14: mnd: Magic number: 2, in detected (gomnd) + if limit >= 2 { + ^ +nth_prime.go:76:38: mnd: Magic number: 2, in detected (gomnd) + inner = square * (outer * (loop - 2)) + ^ +nth_prime.go:81:39: mnd: Magic number: 2, in detected (gomnd) + inner = square * (outer * (loop - 2)) + ^ +nth_prime_test.go:5:1: Function TestNth missing the call to method parallel (paralleltest) +func TestNth(t *testing.T) { +^ +nth_prime_test.go:6:2: Range statement for test TestNth missing the call to method parallel in test Run (paralleltest) + for _, tc := range tests { + ^ +cases_test.go:1:9: package should be `prime_test` instead of `prime` (testpackage) +package prime + ^ +nth_prime_examples_test.go:1:9: package should be `prime_test` instead of `prime` (testpackage) +package prime + ^ +nth_prime_test.go:1:9: package should be `prime_test` instead of `prime` (testpackage) +package prime + ^ + +real 0m0.531s +user 0m0.774s +sys 0m0.439s + + + ============================================================================== + +Exit code: -1 + +real 0m0.570s +user 0m0.795s +sys 0m0.477s + +real 0m0.574s +user 0m0.796s +sys 0m0.479s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.014s +sys 0m0.015s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +nth_prime.go + (21, 17) https://revive.run/r#var-declaration should omit type int from declaration of var searchSize; it will be inferred from the right-hand side + + + ✖ 1 problem (0 errors) (1 warnings) + +real 0m0.058s +user 0m0.023s +sys 0m0.050s + + + ============================================================================== + +Exit code: 0 + +real 0m0.088s +user 0m0.043s +sys 0m0.073s + +real 0m0.090s +user 0m0.045s +sys 0m0.074s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.012s +sys 0m0.015s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "errors" without types was imported from "prime" + +real 0m0.091s +user 0m0.125s +sys 0m0.094s + + + ============================================================================== + +Exit code: -1 + +real 0m0.122s +user 0m0.143s +sys 0m0.120s + +real 0m0.124s +user 0m0.144s +sys 0m0.121s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.035s +user 0m0.023s +sys 0m0.019s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +nth_prime.go:21:17: should omit type int from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.189s +user 0m0.274s +sys 0m0.180s + + + ============================================================================== + +Exit code: -1 + +real 0m0.237s +user 0m0.303s +sys 0m0.208s + +real 0m0.240s +user 0m0.305s +sys 0m0.208s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.010s +sys 0m0.020s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./nth_prime.go:35:1: paramTypeCombine: func(searchTarget int, limit int) []int could be replaced with func(searchTarget, limit int) []int + +real 0m0.818s +user 0m2.011s +sys 0m0.321s + + + ============================================================================== + +Exit code: -1 + +real 0m0.851s +user 0m2.028s +sys 0m0.351s + +real 0m0.853s +user 0m2.028s +sys 0m0.352s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.015s +sys 0m0.011s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.092s +user 0m0.153s +sys 0m0.116s + + + ============================================================================== + +Exit code: 0 + +real 0m0.120s +user 0m0.176s +sys 0m0.133s + +real 0m0.122s +user 0m0.178s +sys 0m0.133s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.045s +user 0m0.021s +sys 0m0.050s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.025s +user 0m0.015s +sys 0m0.020s + + + ============================================================================== + +Exit code: 0 + +real 0m0.093s +user 0m0.047s +sys 0m0.091s + +real 0m0.095s +user 0m0.049s +sys 0m0.092s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck -real 0m0.166s -user 0m0.111s -sys 0m0.142s +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.037s +user 0m0.022s +sys 0m0.034s + + + ============================================================================== + +Running: errcheck ./... + +nth_prime_test.go:28:6: Nth(10001) + +real 0m0.459s +user 0m1.364s +sys 0m0.268s + + + ============================================================================== + +Exit code: -1 + +real 0m0.521s +user 0m1.396s +sys 0m0.324s + +real 0m0.523s +user 0m1.396s +sys 0m0.326s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.010s +sys 0m0.013s + + + ============================================================================== + +Running: gocyclo . + +13 prime findPrimeWithSieve nth_prime.go:35:1 +6 prime TestNth nth_prime_test.go:5:1 +3 prime BenchmarkNth nth_prime_test.go:23:1 +3 prime Nth nth_prime.go:11:1 +2 prime ExampleNth nth_prime_examples_test.go:7:1 + +real 0m0.002s +user 0m0.000s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.030s +user 0m0.016s +sys 0m0.024s + +real 0m0.032s +user 0m0.018s +sys 0m0.024s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + +nth_prime.go:38:44: "substract" is a misspelling of "subtract" +run-tests-go.txt:49:21: "substract" is a misspelling of "subtract" +run-tests-go.txt:50:44: "substract" is a misspelling of "subtract" +coverage.html:118:51: "substract" is a misspelling of "subtract" + +real 0m0.025s +user 0m0.030s +sys 0m0.011s + + + ============================================================================== + +Exit code: 0 + +real 0m0.037s +user 0m0.033s +sys 0m0.025s + +real 0m0.040s +user 0m0.034s +sys 0m0.027s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.015s +sys 0m0.019s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:25:22 Including rules: default +[gosec] 2023/09/07 00:25:22 Excluding rules: default +[gosec] 2023/09/07 00:25:22 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/nth-prime +[gosec] 2023/09/07 00:25:22 Checking package: prime +[gosec] 2023/09/07 00:25:22 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/nth-prime/nth_prime.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 97 + Nosec : 0 + Issues : 0 + + +real 0m0.109s +user 0m0.108s +sys 0m0.076s + + + ============================================================================== + +Exit code: 0 + +real 0m0.144s +user 0m0.128s +sys 0m0.106s + +real 0m0.146s +user 0m0.130s +sys 0m0.106s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out prime +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.013s +sys 0m0.020s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestNth === RUN TestNth/first_prime === RUN TestNth/second_prime === RUN TestNth/sixth_prime === RUN TestNth/big_prime === RUN TestNth/there_is_no_zeroth_prime ---- PASS: TestNth (0.07s) +--- PASS: TestNth (0.03s) --- PASS: TestNth/first_prime (0.00s) --- PASS: TestNth/second_prime (0.00s) --- PASS: TestNth/sixth_prime (0.00s) - --- PASS: TestNth/big_prime (0.07s) + --- PASS: TestNth/big_prime (0.03s) --- PASS: TestNth/there_is_no_zeroth_prime (0.00s) === RUN ExampleNth --- PASS: ExampleNth (0.00s) PASS coverage: 100.0% of statements -ok prime 0.087s coverage: 100.0% of statements +ok prime 0.031s coverage: 100.0% of statements -real 0m0.662s -user 0m0.774s -sys 0m0.445s +real 0m0.213s +user 0m0.293s +sys 0m0.186s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + prime/nth_prime.go:11: Nth 100.0% prime/nth_prime.go:35: findPrimeWithSieve 100.0% total: (statements) 100.0% -real 0m0.197s -user 0m0.206s -sys 0m0.150s +real 0m0.041s +user 0m0.047s +sys 0m0.047s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.161s -user 0m0.135s -sys 0m0.161s +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.038s +user 0m0.031s +sys 0m0.060s -=============================================================================== -go test -v -race -covermode=atomic prime + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.015s +user 0m0.014s +sys 0m0.010s + +real 0m0.015s +user 0m0.014s +sys 0m0.010s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestNth === RUN TestNth/first_prime === RUN TestNth/second_prime === RUN TestNth/sixth_prime === RUN TestNth/big_prime === RUN TestNth/there_is_no_zeroth_prime ---- PASS: TestNth (0.33s) +--- PASS: TestNth (0.09s) --- PASS: TestNth/first_prime (0.00s) --- PASS: TestNth/second_prime (0.00s) --- PASS: TestNth/sixth_prime (0.00s) - --- PASS: TestNth/big_prime (0.33s) + --- PASS: TestNth/big_prime (0.09s) --- PASS: TestNth/there_is_no_zeroth_prime (0.00s) === RUN ExampleNth --- PASS: ExampleNth (0.00s) PASS coverage: 100.0% of statements -ok prime 0.368s coverage: 100.0% of statements +ok prime 1.114s coverage: 100.0% of statements + +real 0m1.338s +user 0m0.343s +sys 0m0.171s -real 0m1.010s -user 0m1.061s -sys 0m0.522s + + ============================================================================== + +Exit code: 0 + +real 0m1.678s +user 0m0.747s +sys 0m0.501s + +real 0m1.679s +user 0m0.747s +sys 0m0.503s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: prime -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkNth-4 15 99131219 ns/op 7228028 B/op 4761 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkNth +BenchmarkNth-8 54 19159865 ns/op 6984784 B/op 2936 allocs/op PASS -ok prime 1.606s +ok prime 1.060s -real 0m2.119s -user 0m2.645s -sys 0m0.576s +real 0m1.215s +user 0m1.257s +sys 0m0.189s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestNth +=== RUN TestNth/first_prime +=== RUN TestNth/second_prime +=== RUN TestNth/sixth_prime +=== RUN TestNth/big_prime +=== RUN TestNth/there_is_no_zeroth_prime +--- PASS: TestNth (0.03s) + --- PASS: TestNth/first_prime (0.00s) + --- PASS: TestNth/second_prime (0.00s) + --- PASS: TestNth/sixth_prime (0.00s) + --- PASS: TestNth/big_prime (0.03s) + --- PASS: TestNth/there_is_no_zeroth_prime (0.00s) +=== RUN ExampleNth +--- PASS: ExampleNth (0.00s) PASS -ok prime 0.203s +ok prime 0.028s -real 0m1.725s -user 0m1.885s -sys 0m1.271s +real 0m0.173s +user 0m0.217s +sys 0m0.172s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m1.394s -user 0m1.416s -sys 0m0.747s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -Nth-4 101ms ± 0% 99ms ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -Nth-4 7.24MB ± 0% 7.23MB ± 0% ~ (p=1.000 n=1+1) - -name old allocs/op new allocs/op delta -Nth-4 4.78k ± 0% 4.76k ± 0% ~ (p=1.000 n=1+1) - -real 0m0.023s -user 0m0.004s -sys 0m0.018s - -=============================================================================== - -go vet prime - -real 0m1.045s -user 0m1.105s -sys 0m0.768s - -=============================================================================== - -go fix prime +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: prime +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Nth-8 19.16m ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Nth-8 6.661Mi ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Nth-8 2.936k ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.239s -user 0m0.197s -sys 0m0.212s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Nth-4 99.13m ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +Nth-4 6.893Mi ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./nth-prime -[gosec] 2022/07/26 07:27:45 Including rules: default -[gosec] 2022/07/26 07:27:45 Excluding rules: default -[gosec] 2022/07/26 07:27:45 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/nth-prime -2022/07/26 07:27:46 internal error: package "errors" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +Nth-4 4.761k ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.791s -user 0m0.867s -sys 0m0.618s +real 0m0.007s +user 0m0.001s +sys 0m0.004s =============================================================================== gomarkdoc --output prime-doc.md -real 0m0.138s -user 0m0.079s -sys 0m0.050s +real 0m0.010s +user 0m0.002s +sys 0m0.008s =============================================================================== @@ -180,9 +823,9 @@ func Nth(input int) (int, error) number can't be calculated ('n' is equal or less than zero) -real 0m0.374s -user 0m0.282s -sys 0m0.297s +real 0m0.048s +user 0m0.029s +sys 0m0.035s =============================================================================== diff --git a/go/nucleotide-count/benchstat-new.txt b/go/nucleotide-count/benchstat-new.txt index 01848ce1..8004f34f 100644 --- a/go/nucleotide-count/benchstat-new.txt +++ b/go/nucleotide-count/benchstat-new.txt @@ -1,2 +1,2 @@ PASS -ok dna 0.012s +ok dna 0.002s diff --git a/go/nucleotide-count/benchstat-old.txt b/go/nucleotide-count/benchstat-old.txt index d3fa266f..01848ce1 100644 --- a/go/nucleotide-count/benchstat-old.txt +++ b/go/nucleotide-count/benchstat-old.txt @@ -1,2 +1,2 @@ PASS -ok dna 0.018s +ok dna 0.012s diff --git a/go/nucleotide-count/coverage-annotations.txt b/go/nucleotide-count/coverage-annotations.txt new file mode 100644 index 00000000..e4197e37 --- /dev/null +++ b/go/nucleotide-count/coverage-annotations.txt @@ -0,0 +1,29 @@ + +43 func (d DNA) Counts() (Histogram, error) { +44 var h Histogram = Histogram{ +45 'A': 0, +46 'C': 0, +47 'G': 0, +48 'T': 0, +49 } +50 +51 if len(d) == 0 { +52 return h, nil +53 } +54 +55 if ok, e := d.IsValid(); !ok { +56 return h, e +57 } +58 +59 for _, nucleotide := range d { +60 h[nucleotide]++ +61 } +62 +63 if debug { +64 MISS fmt.Printf("%s\n", d) +65 MISS fmt.Printf("historgram: %#v\n", h) +66 } +67 +68 return h, nil +69 } + diff --git a/go/nucleotide-count/coverage.out b/go/nucleotide-count/coverage.out index c6ba8f3d..f38aebef 100644 --- a/go/nucleotide-count/coverage.out +++ b/go/nucleotide-count/coverage.out @@ -1,14 +1,14 @@ mode: count dna/nucleotide_count.go:20.38,24.79 2 6 -dna/nucleotide_count.go:28.2,28.18 1 4 dna/nucleotide_count.go:24.79,26.3 1 2 +dna/nucleotide_count.go:28.2,28.18 1 4 dna/nucleotide_count.go:32.30,35.2 1 2 dna/nucleotide_count.go:43.42,51.17 2 7 -dna/nucleotide_count.go:55.2,55.31 1 6 -dna/nucleotide_count.go:59.2,59.31 1 4 -dna/nucleotide_count.go:63.2,63.11 1 4 -dna/nucleotide_count.go:68.2,68.15 1 4 dna/nucleotide_count.go:51.17,53.3 1 1 +dna/nucleotide_count.go:55.2,55.31 1 6 dna/nucleotide_count.go:55.31,57.3 1 2 +dna/nucleotide_count.go:59.2,59.31 1 4 dna/nucleotide_count.go:59.31,61.3 1 82 +dna/nucleotide_count.go:63.2,63.11 1 4 dna/nucleotide_count.go:63.11,66.3 2 0 +dna/nucleotide_count.go:68.2,68.15 1 4 diff --git a/go/nucleotide-count/dna-doc.md b/go/nucleotide-count/dna-doc.md index 9aef8057..d1274eff 100755 --- a/go/nucleotide-count/dna-doc.md +++ b/go/nucleotide-count/dna-doc.md @@ -6,7 +6,7 @@ import "dna" ``` -Package dna is a package used to inspect DNA sequences\. +Package dna is a package used to inspect DNA sequences. ## Index @@ -19,7 +19,7 @@ Package dna is a package used to inspect DNA sequences\. ## type [DNA]() -DNA is a list of nucleotides\. +DNA is a list of nucleotides. ```go type DNA string @@ -81,7 +81,7 @@ e: func (d DNA) Counts() (Histogram, error) ``` -Counts generates a histogram of valid nucleotides in the given DNA\. Returns an error if d contains an invalid nucleotide\. / Counts is a method on the DNA type\. A method is a function with a special receiver argument\. The receiver appears in its own argument list between the func keyword and the method name\. Here\, the Counts method has a receiver of type DNA named d\. +Counts generates a histogram of valid nucleotides in the given DNA. Returns an error if d contains an invalid nucleotide. / Counts is a method on the DNA type. A method is a function with a special receiver argument. The receiver appears in its own argument list between the func keyword and the method name. Here, the Counts method has a receiver of type DNA named d. ### func \(DNA\) [IsValid]() @@ -89,7 +89,7 @@ Counts generates a histogram of valid nucleotides in the given DNA\. Returns an func (d DNA) IsValid() (bool, error) ``` -IsValid returns true if the DNA strand is valid\. +IsValid returns true if the DNA strand is valid. ### func \(DNA\) [String]() @@ -97,11 +97,11 @@ IsValid returns true if the DNA strand is valid\. func (d DNA) String() string ``` -String returns a pretty formated representation of a DNA type\. +String returns a pretty formated representation of a DNA type. ## type [Histogram]() -Histogram is a mapping from nucleotide to its count in given DNA\. Choose a suitable data type\. +Histogram is a mapping from nucleotide to its count in given DNA. Choose a suitable data type. ```go type Histogram map[rune]int diff --git a/go/nucleotide-count/dna-doc.txt b/go/nucleotide-count/dna-doc.txt index 6ae34cd9..ff07d668 100644 --- a/go/nucleotide-count/dna-doc.txt +++ b/go/nucleotide-count/dna-doc.txt @@ -8,11 +8,11 @@ type DNA string DNA is a list of nucleotides. func (d DNA) Counts() (Histogram, error) - Counts generates a histogram of valid nucleotides in the given DNA. Returns - an error if d contains an invalid nucleotide. / Counts is a method on the - DNA type. A method is a function with a special receiver argument. The - receiver appears in its own argument list between the func keyword and the - method name. Here, the Counts method has a receiver of type DNA named d. + Counts generates a histogram of valid nucleotides in the given DNA. + Returns an error if d contains an invalid nucleotide. / Counts is a method + on the DNA type. A method is a function with a special receiver argument. + The receiver appears in its own argument list between the func keyword and + the method name. Here, the Counts method has a receiver of type DNA named d. func (d DNA) IsValid() (bool, error) IsValid returns true if the DNA strand is valid. diff --git a/go/nucleotide-count/run-tests-go.txt b/go/nucleotide-count/run-tests-go.txt index 0934c7f1..a9968b20 100644 --- a/go/nucleotide-count/run-tests-go.txt +++ b/go/nucleotide-count/run-tests-go.txt @@ -5,15 +5,594 @@ Go packages: dna =============================================================================== -golint dna +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.015s +sys 0m0.031s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +nucleotide_count.go:64:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo) + fmt.Printf("%s\n", d) + ^ +nucleotide_count.go:65:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo) + fmt.Printf("historgram: %#v\n", h) + ^ +nucleotide_count.go:39: File is not `gci`-ed with --skip-generated -s standard,default (gci) +/// +nucleotide_count.go:10:11: var-declaration: should omit type bool from declaration of var debug; it will be inferred from the right-hand side (revive) +var debug bool = false + ^ +nucleotide_count.go:44:8: var-declaration: should omit type Histogram from declaration of var h; it will be inferred from the right-hand side (revive) + var h Histogram = Histogram{ + ^ +nucleotide_count_test.go:11:15: Using the variable on range scope `tc` in function literal (scopelint) + dna := DNA(tc.strand) + ^ +nucleotide_count_test.go:14:9: Using the variable on range scope `tc` in function literal (scopelint) + case tc.errorExpected: + ^ +nucleotide_count_test.go:16:58: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("DNA.Counts(%q) expected error, got: %#v", tc.strand, actual) + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +nucleotide_count.go:25:17: err113: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"DNA sequence, %q, contains invalid nucleotides\", string(d))" (goerr113) + return false, fmt.Errorf("DNA sequence, %q, contains invalid nucleotides", string(d)) + ^ +nucleotide_count_examples_test.go:7:1: tests: ExampleDNA_Valid refers to unknown field or method: DNA.Valid (govet) +func ExampleDNA_Valid() { +^ +nucleotide_count_examples_test.go:19:1: tests: ExampleDNA_Invalid refers to unknown field or method: DNA.Invalid (govet) +func ExampleDNA_Invalid() { +^ +nucleotide_count_test.go:8:1: Function TestCounts missing the call to method parallel (paralleltest) +func TestCounts(t *testing.T) { +^ +nucleotide_count_test.go:9:2: Range statement for test TestCounts missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +cases_test.go:1:9: package should be `dna_test` instead of `dna` (testpackage) +package dna + ^ +nucleotide_count_examples_test.go:1:9: package should be `dna_test` instead of `dna` (testpackage) +package dna + ^ +nucleotide_count_test.go:1:9: package should be `dna_test` instead of `dna` (testpackage) +package dna + ^ + +real 0m0.546s +user 0m0.839s +sys 0m0.571s + + + ============================================================================== + +Exit code: -1 + +real 0m0.593s +user 0m0.862s +sys 0m0.622s + +real 0m0.597s +user 0m0.865s +sys 0m0.624s -real 0m0.316s -user 0m0.316s -sys 0m0.316s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.031s +sys 0m0.031s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +nucleotide_count.go + (10, 11) https://revive.run/r#var-declaration should omit type bool from declaration of var debug; it will be inferred from the right-hand side + (44, 8) https://revive.run/r#var-declaration should omit type Histogram from declaration of var h; it will be inferred from the right-hand side + + + ✖ 2 problems (0 errors) (2 warnings) + +real 0m0.061s +user 0m0.035s +sys 0m0.046s + + + ============================================================================== + +Exit code: 0 + +real 0m0.104s +user 0m0.072s +sys 0m0.088s + +real 0m0.106s +user 0m0.074s +sys 0m0.088s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.037s +user 0m0.030s +sys 0m0.037s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "dna" + +real 0m0.102s +user 0m0.148s +sys 0m0.131s + + + ============================================================================== + +Exit code: -1 + +real 0m0.161s +user 0m0.184s +sys 0m0.189s + +real 0m0.165s +user 0m0.187s +sys 0m0.190s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.013s +sys 0m0.028s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +nucleotide_count.go:44:8: should omit type Histogram from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.198s +user 0m0.241s +sys 0m0.163s + + + ============================================================================== + +Exit code: -1 + +real 0m0.229s +user 0m0.258s +sys 0m0.202s + +real 0m0.231s +user 0m0.258s +sys 0m0.204s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.028s +sys 0m0.026s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.857s +user 0m1.976s +sys 0m0.305s + + + ============================================================================== + +Exit code: 0 + +real 0m0.893s +user 0m2.008s +sys 0m0.342s + +real 0m0.895s +user 0m2.010s +sys 0m0.342s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.022s +sys 0m0.032s + + + ============================================================================== + +Running: go vet ./... + +# dna +./nucleotide_count_examples_test.go:7:1: ExampleDNA_Valid refers to unknown field or method: DNA.Valid +./nucleotide_count_examples_test.go:19:1: ExampleDNA_Invalid refers to unknown field or method: DNA.Invalid + +real 0m0.082s +user 0m0.130s +sys 0m0.087s + + + ============================================================================== + +Exit code: -1 + +real 0m0.119s +user 0m0.158s +sys 0m0.129s + +real 0m0.121s +user 0m0.158s +sys 0m0.130s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.020s +sys 0m0.030s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.024s +user 0m0.019s +sys 0m0.024s + + + ============================================================================== + +Exit code: 0 + +real 0m0.058s +user 0m0.048s +sys 0m0.061s + +real 0m0.059s +user 0m0.048s +sys 0m0.062s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.024s +sys 0m0.018s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.476s +user 0m1.411s +sys 0m0.312s + + + ============================================================================== + +Exit code: 0 + +real 0m0.509s +user 0m1.439s +sys 0m0.339s + +real 0m0.511s +user 0m1.441s +sys 0m0.339s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.029s +sys 0m0.023s + + + ============================================================================== + +Running: gocyclo . + +6 dna TestCounts nucleotide_count_test.go:8:1 +5 dna (DNA).Counts nucleotide_count.go:43:1 +2 dna (DNA).IsValid nucleotide_count.go:20:1 +1 dna ExampleDNA_Invalid nucleotide_count_examples_test.go:19:1 +1 dna ExampleDNA_Valid nucleotide_count_examples_test.go:7:1 +1 dna (DNA).String nucleotide_count.go:32:1 + +real 0m0.003s +user 0m0.000s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.042s +user 0m0.036s +sys 0m0.035s + +real 0m0.044s +user 0m0.036s +sys 0m0.036s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.025s +user 0m0.024s +sys 0m0.015s + + + ============================================================================== + +Exit code: 0 + +real 0m0.044s +user 0m0.032s +sys 0m0.033s + +real 0m0.046s +user 0m0.034s +sys 0m0.033s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out dna +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.022s +sys 0m0.034s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:25:28 Including rules: default +[gosec] 2023/09/07 00:25:28 Excluding rules: default +[gosec] 2023/09/07 00:25:28 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/nucleotide-count +[gosec] 2023/09/07 00:25:28 Checking package: dna +[gosec] 2023/09/07 00:25:28 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/nucleotide-count/nucleotide_count.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 69 + Nosec : 0 + Issues : 0 + + +real 0m0.126s +user 0m0.126s +sys 0m0.097s + + + ============================================================================== + +Exit code: 0 + +real 0m0.168s +user 0m0.154s +sys 0m0.141s + +real 0m0.170s +user 0m0.155s +sys 0m0.142s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.011s +sys 0m0.028s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestCounts === RUN TestCounts/empty_strand === RUN TestCounts/can_count_one_nucleotide_in_single-character_input @@ -32,42 +611,92 @@ go test -v -covermode=count -coverprofile coverage.out dna --- PASS: ExampleDNA_Invalid (0.00s) PASS coverage: 87.5% of statements -ok dna 0.011s coverage: 87.5% of statements +ok dna 0.003s coverage: 87.5% of statements -real 0m0.587s -user 0m0.633s -sys 0m0.452s +real 0m0.173s +user 0m0.193s +sys 0m0.130s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + dna/nucleotide_count.go:20: IsValid 100.0% dna/nucleotide_count.go:32: String 100.0% dna/nucleotide_count.go:43: Counts 81.8% total: (statements) 87.5% -real 0m0.269s -user 0m0.288s -sys 0m0.208s +real 0m0.049s +user 0m0.054s +sys 0m0.062s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.219s -user 0m0.240s -sys 0m0.218s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic dna +real 0m0.054s +user 0m0.054s +sys 0m0.093s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +43 func (d DNA) Counts() (Histogram, error) { +44 var h Histogram = Histogram{ +45 'A': 0, +46 'C': 0, +47 'G': 0, +48 'T': 0, +49 } +50 +51 if len(d) == 0 { +52 return h, nil +53 } +54 +55 if ok, e := d.IsValid(); !ok { +56 return h, e +57 } +58 +59 for _, nucleotide := range d { +60 h[nucleotide]++ +61 } +62 +63 if debug { +64 MISS fmt.Printf("%s\n", d) +65 MISS fmt.Printf("historgram: %#v\n", h) +66 } +67 +68 return h, nil +69 } + + +real 0m0.021s +user 0m0.021s +sys 0m0.021s + +real 0m0.021s +user 0m0.021s +sys 0m0.021s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestCounts === RUN TestCounts/empty_strand === RUN TestCounts/can_count_one_nucleotide_in_single-character_input === RUN TestCounts/strand_with_repeated_nucleotide === RUN TestCounts/strand_with_multiple_nucleotides === RUN TestCounts/strand_with_invalid_nucleotides ---- PASS: TestCounts (0.01s) +--- PASS: TestCounts (0.00s) --- PASS: TestCounts/empty_strand (0.00s) --- PASS: TestCounts/can_count_one_nucleotide_in_single-character_input (0.00s) --- PASS: TestCounts/strand_with_repeated_nucleotide (0.00s) @@ -79,87 +708,79 @@ go test -v -race -covermode=atomic dna --- PASS: ExampleDNA_Invalid (0.00s) PASS coverage: 87.5% of statements -ok dna 0.044s coverage: 87.5% of statements +ok dna 1.018s coverage: 87.5% of statements -real 0m0.616s -user 0m0.653s -sys 0m0.369s +real 0m1.251s +user 0m0.274s +sys 0m0.174s -=============================================================================== -mv -v benchstat-new.txt benchstat-old.txt -renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + ============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -PASS -ok dna 0.012s +Exit code: 0 -real 0m0.568s -user 0m0.583s -sys 0m0.409s +real 0m1.584s +user 0m0.614s +sys 0m0.518s -=============================================================================== - -go test -tags bonus -PASS -ok dna 0.006s - -real 0m0.484s -user 0m0.549s -sys 0m0.386s +real 0m1.586s +user 0m0.615s +sys 0m0.520s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m0.661s -user 0m0.815s -sys 0m0.378s - -benchstat benchstat-old.txt benchstat-new.txt - -real 0m0.011s -user 0m0.002s -sys 0m0.005s - -=============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go vet dna -# dna -./nucleotide_count_examples_test.go:7:1: ExampleDNA_Valid refers to unknown field or method: DNA.Valid -./nucleotide_count_examples_test.go:19:1: ExampleDNA_Invalid refers to unknown field or method: DNA.Invalid +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok dna 0.002s -real 0m0.344s -user 0m0.419s -sys 0m0.330s +real 0m0.148s +user 0m0.187s +sys 0m0.130s =============================================================================== -go fix dna +gotest -v -tags bonus +=== RUN TestCounts +=== RUN TestCounts/empty_strand +=== RUN TestCounts/can_count_one_nucleotide_in_single-character_input +=== RUN TestCounts/strand_with_repeated_nucleotide +=== RUN TestCounts/strand_with_multiple_nucleotides +=== RUN TestCounts/strand_with_invalid_nucleotides +--- PASS: TestCounts (0.00s) + --- PASS: TestCounts/empty_strand (0.00s) + --- PASS: TestCounts/can_count_one_nucleotide_in_single-character_input (0.00s) + --- PASS: TestCounts/strand_with_repeated_nucleotide (0.00s) + --- PASS: TestCounts/strand_with_multiple_nucleotides (0.00s) + --- PASS: TestCounts/strand_with_invalid_nucleotides (0.00s) +=== RUN ExampleDNA_Valid +--- PASS: ExampleDNA_Valid (0.00s) +=== RUN ExampleDNA_Invalid +--- PASS: ExampleDNA_Invalid (0.00s) +PASS +ok dna 0.003s -real 0m0.193s -user 0m0.180s -sys 0m0.165s +real 0m0.129s +user 0m0.165s +sys 0m0.134s =============================================================================== -gosec ./nucleotide-count -[gosec] 2022/07/26 07:24:08 Including rules: default -[gosec] 2022/07/26 07:24:08 Excluding rules: default -[gosec] 2022/07/26 07:24:08 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/nucleotide-count -2022/07/26 07:24:09 internal error: package "fmt" without types was imported from "command-line-arguments" +benchstat benchstat-old.txt benchstat-new.txt -real 0m0.506s -user 0m0.577s -sys 0m0.412s +real 0m0.002s +user 0m0.001s +sys 0m0.001s =============================================================================== gomarkdoc --output dna-doc.md -real 0m0.032s -user 0m0.027s -sys 0m0.014s +real 0m0.012s +user 0m0.007s +sys 0m0.005s =============================================================================== @@ -174,11 +795,11 @@ type DNA string DNA is a list of nucleotides. func (d DNA) Counts() (Histogram, error) - Counts generates a histogram of valid nucleotides in the given DNA. Returns - an error if d contains an invalid nucleotide. / Counts is a method on the - DNA type. A method is a function with a special receiver argument. The - receiver appears in its own argument list between the func keyword and the - method name. Here, the Counts method has a receiver of type DNA named d. + Counts generates a histogram of valid nucleotides in the given DNA. + Returns an error if d contains an invalid nucleotide. / Counts is a method + on the DNA type. A method is a function with a special receiver argument. + The receiver appears in its own argument list between the func keyword and + the method name. Here, the Counts method has a receiver of type DNA named d. func (d DNA) IsValid() (bool, error) IsValid returns true if the DNA strand is valid. @@ -191,9 +812,9 @@ type Histogram map[rune]int suitable data type. -real 0m0.261s -user 0m0.199s -sys 0m0.257s +real 0m0.036s +user 0m0.024s +sys 0m0.036s =============================================================================== diff --git a/go/pangram/benchstat-new.txt b/go/pangram/benchstat-new.txt index 5160aea1..2ff8aea8 100644 --- a/go/pangram/benchstat-new.txt +++ b/go/pangram/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: pangram -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkPangram-4 26893 56473 ns/op 8478 B/op 147 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkPangram +BenchmarkPangram-8 61730 19476 ns/op 8611 B/op 147 allocs/op PASS -ok pangram 2.050s +ok pangram 1.403s diff --git a/go/pangram/benchstat-old.txt b/go/pangram/benchstat-old.txt index 8d692617..5160aea1 100644 --- a/go/pangram/benchstat-old.txt +++ b/go/pangram/benchstat-old.txt @@ -2,6 +2,6 @@ goos: linux goarch: amd64 pkg: pangram cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkPangram-4 17280 66059 ns/op 8575 B/op 149 allocs/op +BenchmarkPangram-4 26893 56473 ns/op 8478 B/op 147 allocs/op PASS -ok pangram 1.890s +ok pangram 2.050s diff --git a/go/pangram/coverage-annotations.txt b/go/pangram/coverage-annotations.txt new file mode 100644 index 00000000..8fa19d0c --- /dev/null +++ b/go/pangram/coverage-annotations.txt @@ -0,0 +1,37 @@ + +12 func IsPangram(input string) bool { +13 +14 if len(input) == 0 { +15 return false +16 } +17 +18 // Get rid of all things not letters. +19 reStr := `[[:^alpha:]]` // `([[:cntrl:]]|[[:digit:]]|[[:space:]]|[[:punct:]]|[[:xdigit:]])` +20 +21 re, e := regexp.Compile(reStr) +22 if e != nil { +23 // the raw re string is static but you can still make mistakes, better +24 // to panic during tests than quietly "working" incorrectly. +25 MISS panic(e) +26 } +27 +28 input = re.ReplaceAllString(input, "") +29 +30 // The string needs at least 26 letters to have the posibility of being a pangram. +31 if len(input) < 26 { +32 return false +33 } +34 +35 // Make it lowercase to simplify checks. +36 input = strings.ToLower(input) +37 +38 // Check to see if all 26 letters are in the string. Fail when we can't find one of them. +39 for _, a := range alpha { +40 if !strings.Contains(input, string(a)) { +41 return false +42 } +43 } +44 +45 return true +46 } + diff --git a/go/pangram/coverage.out b/go/pangram/coverage.out index 91f1fb11..85e2217e 100644 --- a/go/pangram/coverage.out +++ b/go/pangram/coverage.out @@ -1,11 +1,11 @@ mode: count pangram/pangram.go:12.35,14.21 1 12 -pangram/pangram.go:19.2,22.14 3 11 -pangram/pangram.go:28.2,31.21 2 11 -pangram/pangram.go:36.2,39.26 2 10 -pangram/pangram.go:45.2,45.13 1 6 pangram/pangram.go:14.21,16.3 1 1 +pangram/pangram.go:19.2,22.14 3 11 pangram/pangram.go:22.14,25.11 1 0 +pangram/pangram.go:28.2,31.21 2 11 pangram/pangram.go:31.21,33.3 1 1 +pangram/pangram.go:36.2,39.26 2 10 pangram/pangram.go:39.26,40.42 1 207 pangram/pangram.go:40.42,42.4 1 4 +pangram/pangram.go:45.2,45.13 1 6 diff --git a/go/pangram/pangram-doc.md b/go/pangram/pangram-doc.md index 8aacfa60..7f4ef057 100755 --- a/go/pangram/pangram-doc.md +++ b/go/pangram/pangram-doc.md @@ -6,7 +6,7 @@ import "pangram" ``` -Package pangram determines if a sentence is a pangram\. +Package pangram determines if a sentence is a pangram. ## Index @@ -19,7 +19,7 @@ Package pangram determines if a sentence is a pangram\. func IsPangram(input string) bool ``` -IsPangram returns true if the string contains all the ASCII letters \(a to z\)\. +IsPangram returns true if the string contains all the ASCII letters \(a to z\).

Example

diff --git a/go/pangram/run-tests-go.txt b/go/pangram/run-tests-go.txt index d604af77..c6bab3b9 100644 --- a/go/pangram/run-tests-go.txt +++ b/go/pangram/run-tests-go.txt @@ -5,15 +5,571 @@ Go packages: pangram =============================================================================== -golint pangram +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.142s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.015s +sys 0m0.019s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +pangram.go:13: File is not `gofumpt`-ed (gofumpt) + +pangram_test.go:10:27: Using the variable on range scope `tc` in function literal (scopelint) + if actual := IsPangram(tc.input); actual != tc.expected { + ^ +pangram_test.go:11:46: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("IsPangram(%q) = %t, want: %t", tc.input, actual, tc.expected) + ^ +pangram.go:12: unnecessary leading newline (whitespace) +func IsPangram(input string) bool { + +pangram_test.go:21:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +pangram.go:31:18: mnd: Magic number: 26, in detected (gomnd) + if len(input) < 26 { + ^ +pangram_test.go:7:1: Function TestPangram missing the call to method parallel (paralleltest) +func TestPangram(t *testing.T) { +^ +pangram_test.go:8:2: Range statement for test TestPangram missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +cases_test.go:1:9: package should be `pangram_test` instead of `pangram` (testpackage) +package pangram + ^ +pangram_examples_test.go:1:9: package should be `pangram_test` instead of `pangram` (testpackage) +package pangram + ^ +pangram_test.go:1:9: package should be `pangram_test` instead of `pangram` (testpackage) +package pangram + ^ +pangram.go:21:2: variable name 're' is too short for the scope of its usage (varnamelen) + re, e := regexp.Compile(reStr) + ^ + +real 0m0.526s +user 0m0.748s +sys 0m0.485s + + + ============================================================================== + +Exit code: -1 + +real 0m0.561s +user 0m0.770s +sys 0m0.514s + +real 0m0.564s +user 0m0.771s +sys 0m0.515s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.014s +sys 0m0.021s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.054s +user 0m0.030s +sys 0m0.040s + + + ============================================================================== + +Exit code: 0 + +real 0m0.086s +user 0m0.050s +sys 0m0.068s + +real 0m0.088s +user 0m0.050s +sys 0m0.070s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.020s +sys 0m0.026s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "regexp" without types was imported from "pangram" + +real 0m0.086s +user 0m0.122s +sys 0m0.098s + + + ============================================================================== + +Exit code: -1 + +real 0m0.128s +user 0m0.148s +sys 0m0.138s + +real 0m0.130s +user 0m0.149s +sys 0m0.139s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.022s +sys 0m0.023s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.166s +user 0m0.223s +sys 0m0.121s + + + ============================================================================== + +Exit code: 0 + +real 0m0.206s +user 0m0.249s +sys 0m0.157s + +real 0m0.209s +user 0m0.250s +sys 0m0.159s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.020s +sys 0m0.025s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./pangram.go:14:5: emptyStringTest: replace `len(input) == 0` with `input == ""` + +real 0m0.810s +user 0m1.880s +sys 0m0.309s + + + ============================================================================== + +Exit code: -1 + +real 0m0.851s +user 0m1.904s +sys 0m0.347s + +real 0m0.853s +user 0m1.904s +sys 0m0.348s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.019s +sys 0m0.010s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.072s +user 0m0.111s +sys 0m0.086s + + + ============================================================================== + +Exit code: 0 + +real 0m0.114s +user 0m0.139s +sys 0m0.116s + +real 0m0.116s +user 0m0.141s +sys 0m0.117s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.014s +sys 0m0.018s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.024s +user 0m0.015s +sys 0m0.022s + + + ============================================================================== + +Exit code: 0 + +real 0m0.055s +user 0m0.036s +sys 0m0.048s + +real 0m0.057s +user 0m0.036s +sys 0m0.050s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.012s +sys 0m0.021s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.449s +user 0m1.263s +sys 0m0.272s + + + ============================================================================== + +Exit code: 0 + +real 0m0.490s +user 0m1.279s +sys 0m0.313s + +real 0m0.491s +user 0m1.280s +sys 0m0.313s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.013s +sys 0m0.020s + + + ============================================================================== + +Running: gocyclo . + +6 pangram IsPangram pangram.go:12:1 +4 pangram BenchmarkPangram pangram_test.go:17:1 +3 pangram TestPangram pangram_test.go:7:1 +1 pangram ExampleIsPangram pangram_examples_test.go:7:1 + +real 0m0.003s +user 0m0.000s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.033s +user 0m0.021s +sys 0m0.029s + +real 0m0.036s +user 0m0.022s +sys 0m0.030s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.040s +user 0m0.034s +sys 0m0.018s + + + ============================================================================== + +Exit code: 0 + +real 0m0.052s +user 0m0.042s +sys 0m0.028s + +real 0m0.054s +user 0m0.043s +sys 0m0.029s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.035s +user 0m0.022s +sys 0m0.027s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:25:33 Including rules: default +[gosec] 2023/09/07 00:25:33 Excluding rules: default +[gosec] 2023/09/07 00:25:33 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/pangram +[gosec] 2023/09/07 00:25:33 Checking package: pangram +[gosec] 2023/09/07 00:25:33 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/pangram/pangram.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 46 + Nosec : 0 + Issues : 0 + + +real 0m0.116s user 0m0.113s -sys 0m0.132s +sys 0m0.114s + + + ============================================================================== + +Exit code: 0 + +real 0m0.163s +user 0m0.140s +sys 0m0.153s + +real 0m0.165s +user 0m0.140s +sys 0m0.154s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out pangram +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.018s +sys 0m0.017s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestPangram === RUN TestPangram/empty_sentence === RUN TestPangram/perfect_lower_case @@ -25,7 +581,7 @@ go test -v -covermode=count -coverprofile coverage.out pangram === RUN TestPangram/missing_letters_replaced_by_numbers === RUN TestPangram/mixed_case_and_punctuation === RUN TestPangram/a-m_and_A-M_are_26_different_characters_but_not_a_pangram ---- PASS: TestPangram (0.01s) +--- PASS: TestPangram (0.00s) --- PASS: TestPangram/empty_sentence (0.00s) --- PASS: TestPangram/perfect_lower_case (0.00s) --- PASS: TestPangram/only_lower_case (0.00s) @@ -40,33 +596,91 @@ go test -v -covermode=count -coverprofile coverage.out pangram --- PASS: ExampleIsPangram (0.00s) PASS coverage: 92.9% of statements -ok pangram 0.012s coverage: 92.9% of statements +ok pangram 0.003s coverage: 92.9% of statements -real 0m0.595s -user 0m0.657s -sys 0m0.453s +real 0m0.173s +user 0m0.232s +sys 0m0.153s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + pangram/pangram.go:12: IsPangram 92.9% total: (statements) 92.9% -real 0m0.205s -user 0m0.171s -sys 0m0.203s +real 0m0.043s +user 0m0.060s +sys 0m0.047s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.172s -user 0m0.150s -sys 0m0.225s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic pangram +real 0m0.055s +user 0m0.058s +sys 0m0.082s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +12 func IsPangram(input string) bool { +13 +14 if len(input) == 0 { +15 return false +16 } +17 +18 // Get rid of all things not letters. +19 reStr := `[[:^alpha:]]` // `([[:cntrl:]]|[[:digit:]]|[[:space:]]|[[:punct:]]|[[:xdigit:]])` +20 +21 re, e := regexp.Compile(reStr) +22 if e != nil { +23 // the raw re string is static but you can still make mistakes, better +24 // to panic during tests than quietly "working" incorrectly. +25 MISS panic(e) +26 } +27 +28 input = re.ReplaceAllString(input, "") +29 +30 // The string needs at least 26 letters to have the posibility of being a pangram. +31 if len(input) < 26 { +32 return false +33 } +34 +35 // Make it lowercase to simplify checks. +36 input = strings.ToLower(input) +37 +38 // Check to see if all 26 letters are in the string. Fail when we can't find one of them. +39 for _, a := range alpha { +40 if !strings.Contains(input, string(a)) { +41 return false +42 } +43 } +44 +45 return true +46 } + + +real 0m0.018s +user 0m0.015s +sys 0m0.016s + +real 0m0.018s +user 0m0.015s +sys 0m0.016s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestPangram === RUN TestPangram/empty_sentence === RUN TestPangram/perfect_lower_case @@ -78,7 +692,7 @@ go test -v -race -covermode=atomic pangram === RUN TestPangram/missing_letters_replaced_by_numbers === RUN TestPangram/mixed_case_and_punctuation === RUN TestPangram/a-m_and_A-M_are_26_different_characters_but_not_a_pangram ---- PASS: TestPangram (0.01s) +--- PASS: TestPangram (0.00s) --- PASS: TestPangram/empty_sentence (0.00s) --- PASS: TestPangram/perfect_lower_case (0.00s) --- PASS: TestPangram/only_lower_case (0.00s) @@ -93,97 +707,128 @@ go test -v -race -covermode=atomic pangram --- PASS: ExampleIsPangram (0.00s) PASS coverage: 92.9% of statements -ok pangram 0.048s coverage: 92.9% of statements +ok pangram 1.015s coverage: 92.9% of statements + +real 0m1.258s +user 0m0.300s +sys 0m0.191s + + + ============================================================================== + +Exit code: 0 -real 0m0.675s -user 0m0.773s -sys 0m0.435s +real 0m1.580s +user 0m0.691s +sys 0m0.514s + +real 0m1.582s +user 0m0.691s +sys 0m0.516s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: pangram -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkPangram-4 26893 56473 ns/op 8478 B/op 147 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkPangram +BenchmarkPangram-8 61730 19476 ns/op 8611 B/op 147 allocs/op PASS -ok pangram 2.050s +ok pangram 1.403s -real 0m2.458s -user 0m2.887s -sys 0m0.435s +real 0m1.553s +user 0m1.639s +sys 0m0.172s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestPangram +=== RUN TestPangram/empty_sentence +=== RUN TestPangram/perfect_lower_case +=== RUN TestPangram/only_lower_case +=== RUN TestPangram/missing_the_letter_'x' +=== RUN TestPangram/missing_the_letter_'h' +=== RUN TestPangram/with_underscores +=== RUN TestPangram/with_numbers +=== RUN TestPangram/missing_letters_replaced_by_numbers +=== RUN TestPangram/mixed_case_and_punctuation +=== RUN TestPangram/a-m_and_A-M_are_26_different_characters_but_not_a_pangram +--- PASS: TestPangram (0.00s) + --- PASS: TestPangram/empty_sentence (0.00s) + --- PASS: TestPangram/perfect_lower_case (0.00s) + --- PASS: TestPangram/only_lower_case (0.00s) + --- PASS: TestPangram/missing_the_letter_'x' (0.00s) + --- PASS: TestPangram/missing_the_letter_'h' (0.00s) + --- PASS: TestPangram/with_underscores (0.00s) + --- PASS: TestPangram/with_numbers (0.00s) + --- PASS: TestPangram/missing_letters_replaced_by_numbers (0.00s) + --- PASS: TestPangram/mixed_case_and_punctuation (0.00s) + --- PASS: TestPangram/a-m_and_A-M_are_26_different_characters_but_not_a_pangram (0.00s) +=== RUN ExampleIsPangram +--- PASS: ExampleIsPangram (0.00s) PASS -ok pangram 0.003s +ok pangram 0.002s -real 0m0.485s -user 0m0.552s -sys 0m0.345s +real 0m0.135s +user 0m0.161s +sys 0m0.133s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m0.925s -user 0m0.615s -sys 0m0.395s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -Pangram-4 66.1µs ± 0% 56.5µs ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -Pangram-4 8.57kB ± 0% 8.48kB ± 0% ~ (p=1.000 n=1+1) - -name old allocs/op new allocs/op delta -Pangram-4 149 ± 0% 147 ± 0% ~ (p=1.000 n=1+1) - -real 0m0.015s -user 0m0.002s -sys 0m0.019s - -=============================================================================== - -go vet pangram - -real 0m0.498s -user 0m0.560s -sys 0m0.458s - -=============================================================================== +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: pangram +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Pangram-8 19.48µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Pangram-8 8.409Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Pangram-8 147.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -go fix pangram +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Pangram-4 56.47µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.192s -user 0m0.164s -sys 0m0.158s + │ benchstat-old.txt │ + │ B/op │ +Pangram-4 8.279Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ allocs/op │ +Pangram-4 147.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./pangram -[gosec] 2022/07/26 07:23:04 Including rules: default -[gosec] 2022/07/26 07:23:04 Excluding rules: default -[gosec] 2022/07/26 07:23:04 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/pangram -2022/07/26 07:23:04 internal error: package "regexp" without types was imported from "command-line-arguments" - -real 0m0.484s -user 0m0.551s -sys 0m0.347s +real 0m0.003s +user 0m0.001s +sys 0m0.002s =============================================================================== gomarkdoc --output pangram-doc.md -real 0m0.031s -user 0m0.021s -sys 0m0.015s +real 0m0.009s +user 0m0.002s +sys 0m0.007s =============================================================================== @@ -199,9 +844,9 @@ func IsPangram(input string) bool z). -real 0m0.241s -user 0m0.177s -sys 0m0.185s +real 0m0.037s +user 0m0.016s +sys 0m0.037s =============================================================================== diff --git a/go/parallel-letter-frequency/benchstat-new.txt b/go/parallel-letter-frequency/benchstat-new.txt index 3fd62f63..e0e828d8 100644 --- a/go/parallel-letter-frequency/benchstat-new.txt +++ b/go/parallel-letter-frequency/benchstat-new.txt @@ -1,12 +1,18 @@ -Using function ConcurrentFrequency() goos: linux goarch: amd64 pkg: letter -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkFrequency/input_size_0-4 16 70983193 ns/op 11973416 B/op 99321 allocs/op -BenchmarkFrequency/input_size_1-4 9 126952655 ns/op 19622605 B/op 160333 allocs/op -BenchmarkFrequency/input_size_2-4 3 333811087 ns/op 52220378 B/op 429904 allocs/op -BenchmarkSequentialFrequency-4 2300 436503 ns/op 17572 B/op 13 allocs/op -BenchmarkConcurrentFrequency-4 2443 611976 ns/op 12581 B/op 68 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkFrequency +Using function ConcurrentFrequency() +BenchmarkFrequency/input_size_0 +BenchmarkFrequency/input_size_0-8 64 20260311 ns/op 12324932 B/op 95852 allocs/op +BenchmarkFrequency/input_size_1 +BenchmarkFrequency/input_size_1-8 37 29984914 ns/op 20376356 B/op 154535 allocs/op +BenchmarkFrequency/input_size_2 +BenchmarkFrequency/input_size_2-8 16 74479344 ns/op 55023086 B/op 415782 allocs/op +BenchmarkSequentialFrequency +BenchmarkSequentialFrequency-8 5330 225888 ns/op 17454 B/op 11 allocs/op +BenchmarkConcurrentFrequency +BenchmarkConcurrentFrequency-8 6834 152324 ns/op 14302 B/op 63 allocs/op PASS -ok letter 8.529s +ok letter 9.512s diff --git a/go/parallel-letter-frequency/benchstat-old.txt b/go/parallel-letter-frequency/benchstat-old.txt new file mode 100644 index 00000000..3fd62f63 --- /dev/null +++ b/go/parallel-letter-frequency/benchstat-old.txt @@ -0,0 +1,12 @@ +Using function ConcurrentFrequency() +goos: linux +goarch: amd64 +pkg: letter +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkFrequency/input_size_0-4 16 70983193 ns/op 11973416 B/op 99321 allocs/op +BenchmarkFrequency/input_size_1-4 9 126952655 ns/op 19622605 B/op 160333 allocs/op +BenchmarkFrequency/input_size_2-4 3 333811087 ns/op 52220378 B/op 429904 allocs/op +BenchmarkSequentialFrequency-4 2300 436503 ns/op 17572 B/op 13 allocs/op +BenchmarkConcurrentFrequency-4 2443 611976 ns/op 12581 B/op 68 allocs/op +PASS +ok letter 8.529s diff --git a/go/parallel-letter-frequency/coverage-annotations.txt b/go/parallel-letter-frequency/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/parallel-letter-frequency/coverage.html b/go/parallel-letter-frequency/coverage.html index e46a921f..b077c78f 100644 --- a/go/parallel-letter-frequency/coverage.html +++ b/go/parallel-letter-frequency/coverage.html @@ -87,7 +87,7 @@ // data as a FreqMap. func Frequency(s string) FreqMap { m := FreqMap{} - for _, r := range s { + for _, r := range s { m[r]++ } return m diff --git a/go/parallel-letter-frequency/coverage.out b/go/parallel-letter-frequency/coverage.out index 370a3d64..7c7f5649 100644 --- a/go/parallel-letter-frequency/coverage.out +++ b/go/parallel-letter-frequency/coverage.out @@ -1,13 +1,13 @@ mode: count letter/parallel_letter_frequency.go:8.34,10.22 2 6 +letter/parallel_letter_frequency.go:10.22,12.3 1 24673 letter/parallel_letter_frequency.go:13.2,13.10 1 6 -letter/parallel_letter_frequency.go:10.22,12.3 1 26014 letter/parallel_letter_frequency.go:18.50,25.30 4 1 -letter/parallel_letter_frequency.go:29.2,29.29 1 1 -letter/parallel_letter_frequency.go:36.2,36.16 1 1 -letter/parallel_letter_frequency.go:43.2,43.16 1 1 letter/parallel_letter_frequency.go:25.30,27.3 1 4 +letter/parallel_letter_frequency.go:29.2,29.29 1 1 letter/parallel_letter_frequency.go:29.29,30.20 1 4 letter/parallel_letter_frequency.go:30.20,33.4 2 4 +letter/parallel_letter_frequency.go:36.2,36.16 1 1 letter/parallel_letter_frequency.go:36.16,38.25 2 4 letter/parallel_letter_frequency.go:38.25,40.4 1 185 +letter/parallel_letter_frequency.go:43.2,43.16 1 1 diff --git a/go/parallel-letter-frequency/letter-doc.md b/go/parallel-letter-frequency/letter-doc.md index 6d58921e..6f945d64 100755 --- a/go/parallel-letter-frequency/letter-doc.md +++ b/go/parallel-letter-frequency/letter-doc.md @@ -15,7 +15,7 @@ import "letter" ## type [FreqMap]() -FreqMap records the frequency of each rune in a given text\. +FreqMap records the frequency of each rune in a given text. ```go type FreqMap map[rune]int @@ -27,7 +27,7 @@ type FreqMap map[rune]int func ConcurrentFrequency(lines []string) FreqMap ``` -ConcurrentFrequency counts the frequency of each rune in the given strings\, by making use of concurrency\. +ConcurrentFrequency counts the frequency of each rune in the given strings, by making use of concurrency. ### func [Frequency]() @@ -35,7 +35,7 @@ ConcurrentFrequency counts the frequency of each rune in the given strings\, by func Frequency(s string) FreqMap ``` -Frequency counts the frequency of each rune in a given text and returns this data as a FreqMap\. +Frequency counts the frequency of each rune in a given text and returns this data as a FreqMap.

Example

diff --git a/go/parallel-letter-frequency/run-tests-go.txt b/go/parallel-letter-frequency/run-tests-go.txt index cfcf8e7b..2934009f 100644 --- a/go/parallel-letter-frequency/run-tests-go.txt +++ b/go/parallel-letter-frequency/run-tests-go.txt @@ -5,22 +5,714 @@ Go packages: letter =============================================================================== -golint letter -/home/vpayno/git_vpayno/exercism-workspace/go/parallel-letter-frequency/parallel_letter_frequency_benchmarks_test.go:79:20: error strings should not be capitalized or end with punctuation or a newline +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.272s -user 0m0.341s -sys 0m0.224s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.009s +sys 0m0.008s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[linters_context] rowserrcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649." +level=warning msg="[linters_context] structcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649." +level=warning msg="[linters_context] wastedassign is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649." +parallel_letter_frequency_benchmarks_test.go:84:2: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo) + fmt.Printf("Using function %s()\n", funcName) + ^ +parallel_letter_frequency_benchmarks_test.go:12:40: Comment should end in a period (godot) +// benchMode values: serial, concurrent + ^ +parallel_letter_frequency_benchmarks_test.go:79:20: error strings should not be capitalized or end with punctuation or a newline (golint) + panic(fmt.Errorf("Can't find %q in benchModes -> %#v\n", benchMode, benchModes)) + ^ +parallel_letter_frequency_test.go:130: line is 123 characters (lll) +it's the result of forty years underground! Allow me to indulge my fancy. You see, gentlemen, reason is an excellent thing, +parallel_letter_frequency_test.go:133: line is 126 characters (lll) +And although our life, in this manifestation of it, is often worthless, yet it is life and not simply extracting square roots. +parallel_letter_frequency_test.go:134: line is 126 characters (lll) +Here I, for instance, quite naturally want to live, in order to satisfy all my capacities for life, and not simply my capacity +parallel_letter_frequency_test.go:135: line is 126 characters (lll) +for reasoning, that is, not simply one twentieth of my capacity for life. What does reason know? Reason only knows what it has +parallel_letter_frequency_test.go:137: line is 132 characters (lll) +and human nature acts as a whole, with everything that is in it, consciously or unconsciously, and, even it if goes wrong, it lives. +parallel_letter_frequency_test.go:138: line is 122 characters (lll) +I suspect, gentlemen, that you are looking at me with compassion; you tell me again that an enlightened and developed man, +parallel_letter_frequency_test.go:139: line is 145 characters (lll) +such, in short, as the future man will be, cannot consciously desire anything disadvantageous to himself, that that can be proved mathematically. +parallel_letter_frequency_test.go:140: line is 147 characters (lll) +I thoroughly agree, it can - by mathematics. But I repeat for the hundredth time, there is one case, one only, when man may consciously, purposely, +parallel_letter_frequency_test.go:141: line is 147 characters (lll) +desire what is injurious to himself, what is stupid, very stupid - simply in order to have the right to desire for himself even what is very stupid +parallel_letter_frequency_test.go:142: line is 145 characters (lll) +and not to be bound by an obligation to desire only what is sensible. Of course, this very stupid thing, this caprice of ours, may be in reality, +parallel_letter_frequency_test.go:143: line is 144 characters (lll) +gentlemen, more advantageous for us than anything else on earth, especially in certain cases. And in particular it may be more advantageous than +parallel_letter_frequency_test.go:144: line is 130 characters (lll) +any advantage even when it does us obvious harm, and contradicts the soundest conclusions of our reason concerning our advantage - +parallel_letter_frequency_test.go:145: line is 132 characters (lll) +for in any circumstances it preserves for us what is most precious and most important - that is, our personality, our individuality. +parallel_letter_frequency_test.go:146: line is 134 characters (lll) +Some, you see, maintain that this really is the most precious thing for mankind; choice can, of course, if it chooses, be in agreement +parallel_letter_frequency_test.go:147: line is 125 characters (lll) +with reason; and especially if this be not abused but kept within bounds. It is profitable and some- times even praiseworthy. +parallel_letter_frequency_test.go:148: line is 130 characters (lll) +But very often, and even most often, choice is utterly and stubbornly opposed to reason ... and ... and ... do you know that that, +parallel_letter_frequency_test.go:149: line is 141 characters (lll) +too, is profitable, sometimes even praiseworthy? Gentlemen, let us suppose that man is not stupid. (Indeed one cannot refuse to suppose that, +parallel_letter_frequency_test.go:150: line is 133 characters (lll) +if only from the one consideration, that, if man is stupid, then who is wise?) But if he is not stupid, he is monstrously ungrateful! +parallel_letter_frequency_test.go:151: line is 151 characters (lll) +Phenomenally ungrateful. In fact, I believe that the best definition of man is the ungrateful biped. But that is not all, that is not his worst defect; +parallel_letter_frequency_test.go:152: line is 124 characters (lll) +his worst defect is his perpetual moral obliquity, perpetual - from the days of the Flood to the Schleswig-Holstein period.` +parallel_letter_frequency_benchmarks_test.go:27:9: `interchangably` is a misspelling of `interchangeably` (misspell) +// used interchangably in the benchmark function. + ^ +parallel_letter_frequency_benchmarks_test.go:75:20: `algorithims` is a misspelling of `algorithm` (misspell) + // with different algorithims. + ^ +parallel_letter_frequency_benchmarks_test.go:42:2: Consider pre-allocating `inputs` (prealloc) + var inputs []book = []book{} + ^ +parallel_letter_frequency_benchmarks_test.go:13:15: var-declaration: should omit type string from declaration of var benchMode; it will be inferred from the right-hand side (revive) +var benchMode string = "concurency" + ^ +parallel_letter_frequency_benchmarks_test.go:17:16: var-declaration: should omit type freqFunc from declaration of var benchModes; it will be inferred from the right-hand side (revive) +var benchModes freqFunc = freqFunc{ + ^ +parallel_letter_frequency_benchmarks_test.go:36:16: var-declaration: should omit type []string from declaration of var bookFiles; it will be inferred from the right-hand side (revive) + var bookFiles []string = []string{ + ^ +parallel_letter_frequency_benchmarks_test.go:69:12: var-declaration: should omit type []book from declaration of var table; it will be inferred from the right-hand side (revive) + var table []book = setup() + ^ +parallel_letter_frequency_benchmarks_test.go:92:23: Using the variable on range scope `v` in function literal (scopelint) + r = benchmarkFunc(v.input) + ^ +parallel_letter_frequency.go:13:2: return statements should not be cuddled if block has more than two lines (wsl) + return m + ^ +parallel_letter_frequency.go:38:3: ranges should only be cuddled with assignments used in the iteration (wsl) + for k, v := range <-c { + ^ +parallel_letter_frequency_benchmarks_test.go:58:2: block should not end with a whitespace (or comment) (wsl) + } + ^ +parallel_letter_frequency_benchmarks_test.go:72:2: declarations should never be cuddled (wsl) + var r FreqMap + ^ +parallel_letter_frequency_test.go:160:2: return statements should not be cuddled if block has more than two lines (wsl) + return m + ^ +parallel_letter_frequency_test.go:175:2: only one cuddle assignment allowed before if statement (wsl) + if !reflect.DeepEqual(oSeq, seq) { + ^ +parallel_letter_frequency_test.go:184:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +parallel_letter_frequency_test.go:193:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +parallel_letter_frequency_test.go:129:16: Duplicate words (that) found (dupword) + dostoevsky4 = `"Yes, but here I come to a stop! Gentlemen, you must excuse me for being over-philosophical; + ^ +parallel_letter_frequency_test.go:15:2: dostoevsky1 is a global variable (gochecknoglobals) + dostoevsky1 = `I am a sick man.... I am a spiteful man. I am an unattractive man. + ^ +parallel_letter_frequency_test.go:58:2: dostoevsky2 is a global variable (gochecknoglobals) + dostoevsky2 = `Gentlemen, I am joking, and I know myself that my jokes are not brilliant + ^ +parallel_letter_frequency_test.go:97:2: dostoevsky3 is a global variable (gochecknoglobals) + dostoevsky3 = `But these are all golden dreams. Oh, tell me, who was it first announced, + ^ +parallel_letter_frequency_test.go:163:1: Function TestConcurrentFrequency missing the call to method parallel (paralleltest) +func TestConcurrentFrequency(t *testing.T) { +^ +parallel_letter_frequency_test.go:172:1: Function TestSequentialFrequency missing the call to method parallel (paralleltest) +func TestSequentialFrequency(t *testing.T) { +^ +parallel_letter_frequency_benchmarks_test.go:83:13: SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck) + funcName = strings.Title(funcName) + ^ +parallel_letter_frequency_benchmarks_test.go:1:9: package should be `letter_test` instead of `letter` (testpackage) +package letter + ^ +parallel_letter_frequency_examples_test.go:1:9: package should be `letter_test` instead of `letter` (testpackage) +package letter + ^ +parallel_letter_frequency_test.go:1:9: package should be `letter_test` instead of `letter` (testpackage) +package letter + ^ +parallel_letter_frequency.go:23:2: variable name 'c' is too short for the scope of its usage (varnamelen) + c := make(chan FreqMap, len(lines)) + ^ + +real 0m0.658s +user 0m0.997s +sys 0m0.686s + + + ============================================================================== + +Exit code: -1 + +real 0m0.683s +user 0m1.011s +sys 0m0.703s + +real 0m0.685s +user 0m1.011s +sys 0m0.705s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.004s +sys 0m0.011s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +parallel_letter_frequency.go + (1, 1) https://revive.run/r#package-comments should have a package comment + +parallel_letter_frequency_benchmarks_test.go + (13, 15) https://revive.run/r#var-declaration should omit type string from declaration of var benchMode; it will be inferred from the right-hand side + (17, 16) https://revive.run/r#var-declaration should omit type freqFunc from declaration of var benchModes; it will be inferred from the right-hand side + (36, 16) https://revive.run/r#var-declaration should omit type []string from declaration of var bookFiles; it will be inferred from the right-hand side + (42, 13) https://revive.run/r#var-declaration should omit type []book from declaration of var inputs; it will be inferred from the right-hand side + (69, 12) https://revive.run/r#var-declaration should omit type []book from declaration of var table; it will be inferred from the right-hand side + (79, 20) https://revive.run/r#error-strings error strings should not be capitalized or end with punctuation or a newline + + + ✖ 7 problems (0 errors) (7 warnings) + +real 0m0.104s +user 0m0.065s +sys 0m0.054s + + + ============================================================================== + +Exit code: 0 + +real 0m0.127s +user 0m0.073s +sys 0m0.077s + +real 0m0.129s +user 0m0.074s +sys 0m0.078s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.011s +sys 0m0.010s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "letter [letter.test]" + +real 0m0.093s +user 0m0.130s +sys 0m0.104s + + + ============================================================================== + +Exit code: -1 + +real 0m0.124s +user 0m0.149s +sys 0m0.124s + +real 0m0.125s +user 0m0.150s +sys 0m0.125s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.003s +sys 0m0.013s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +parallel_letter_frequency.go:1:1: at least one file in a package should have a package comment (ST1000) +parallel_letter_frequency_benchmarks_test.go:36:16: should omit type []string from declaration; it will be inferred from the right-hand side (ST1023) +parallel_letter_frequency_benchmarks_test.go:42:13: should omit type []book from declaration; it will be inferred from the right-hand side (ST1023) +parallel_letter_frequency_benchmarks_test.go:69:12: should omit type []book from declaration; it will be inferred from the right-hand side (ST1023) +parallel_letter_frequency_benchmarks_test.go:83:13: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (SA1019) + +real 0m0.180s +user 0m0.232s +sys 0m0.140s + + + ============================================================================== + +Exit code: -1 + +real 0m0.206s +user 0m0.245s +sys 0m0.159s + +real 0m0.208s +user 0m0.247s +sys 0m0.160s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.016s +user 0m0.013s +sys 0m0.007s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./parallel_letter_frequency_test.go:166:2: commentedOutCode: may want to remove commented-out code + +real 0m0.844s +user 0m2.025s +sys 0m0.318s + + + ============================================================================== + +Exit code: -1 + +real 0m0.871s +user 0m2.044s +sys 0m0.333s + +real 0m0.873s +user 0m2.046s +sys 0m0.333s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.002s +sys 0m0.012s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.086s +user 0m0.104s +sys 0m0.095s + + + ============================================================================== + +Exit code: 0 + +real 0m0.108s +user 0m0.114s +sys 0m0.113s + +real 0m0.110s +user 0m0.116s +sys 0m0.113s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.016s +user 0m0.006s +sys 0m0.014s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.022s +user 0m0.014s +sys 0m0.013s + + + ============================================================================== + +Exit code: 0 + +real 0m0.051s +user 0m0.028s +sys 0m0.036s + +real 0m0.053s +user 0m0.030s +sys 0m0.036s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.013s +sys 0m0.013s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.485s +user 0m1.383s +sys 0m0.326s + + + ============================================================================== + +Exit code: 0 + +real 0m0.528s +user 0m1.407s +sys 0m0.358s + +real 0m0.530s +user 0m1.408s +sys 0m0.359s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.007s +sys 0m0.009s + + + ============================================================================== + +Running: gocyclo . + +5 letter BenchmarkFrequency parallel_letter_frequency_benchmarks_test.go:66:1 +5 letter ConcurrentFrequency parallel_letter_frequency.go:18:1 +3 letter BenchmarkConcurrentFrequency parallel_letter_frequency_test.go:189:1 +3 letter BenchmarkSequentialFrequency parallel_letter_frequency_test.go:180:1 +3 letter setup parallel_letter_frequency_benchmarks_test.go:34:1 +2 letter TestSequentialFrequency parallel_letter_frequency_test.go:172:1 +2 letter TestConcurrentFrequency parallel_letter_frequency_test.go:163:1 +2 letter OriginalFrequency parallel_letter_frequency_test.go:155:1 +2 letter Frequency parallel_letter_frequency.go:8:1 +1 letter ExampleFrequency parallel_letter_frequency_examples_test.go:7:1 +1 letter cleanup parallel_letter_frequency_benchmarks_test.go:63:1 +1 letter concurrentFrequency parallel_letter_frequency_benchmarks_test.go:28:1 + +real 0m0.003s +user 0m0.001s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.027s +user 0m0.013s +sys 0m0.023s + +real 0m0.029s +user 0m0.013s +sys 0m0.025s =============================================================================== -go install golang.org/x/tools/cmd/cover@latest +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + +parallel_letter_frequency_benchmarks_test.go:27:8: "interchangably" is a misspelling of "interchangeably" +parallel_letter_frequency_benchmarks_test.go:75:19: "algorithims" is a misspelling of "algorithm" +run-tests-go.txt:93:52: "interchangably" is a misspelling of "interchangeably" +run-tests-go.txt:94:8: "interchangably" is a misspelling of "interchangeably" +run-tests-go.txt:96:53: "algorithims" is a misspelling of "algorithm" +run-tests-go.txt:97:19: "algorithims" is a misspelling of "algorithm" +resources-pride_and_prejudice.txt:2897:33: "Phillipses" is a misspelling of "Phillies" +resources-pride_and_prejudice.txt:5377:6: "Phillipses" is a misspelling of "Phillies" +resources-pride_and_prejudice.txt:14166:25: "expences" is a misspelling of "expense" +resources-moby_dick_or_the_whale.txt:4136:0: "shrinked" is a misspelling of "shrunk" +resources-moby_dick_or_the_whale.txt:5420:16: "unforseen" is a misspelling of "unforeseen" +resources-moby_dick_or_the_whale.txt:15535:18: "sufficit" is a misspelling of "sufficient" +resources-war_and_peace.txt:4104:64: "vell" is a misspelling of "well" +resources-war_and_peace.txt:4136:3: "vell" is a misspelling of "well" +resources-war_and_peace.txt:7477:56: "Quarante" is a misspelling of "Quarantine" +resources-war_and_peace.txt:16575:0: "unconciousness" is a misspelling of "unconsciousness" +resources-war_and_peace.txt:19350:4: "accidently" is a misspelling of "accidentally" +resources-war_and_peace.txt:20444:21: "affaires" is a misspelling of "affairs" +resources-war_and_peace.txt:20483:4: "affaires" is a misspelling of "affairs" +resources-war_and_peace.txt:36548:0: "quarante" is a misspelling of "quarantine" +resources-war_and_peace.txt:57074:43: "Ukranian" is a misspelling of "Ukrainian" +resources-war_and_peace.txt:58865:12: "occuring" is a misspelling of "occurring" + +real 0m0.333s +user 0m0.628s +sys 0m0.039s + + + ============================================================================== + +Exit code: 0 + +real 0m0.345s +user 0m0.635s +sys 0m0.049s + +real 0m0.347s +user 0m0.636s +sys 0m0.051s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.005s +sys 0m0.012s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:25:40 Including rules: default +[gosec] 2023/09/07 00:25:40 Excluding rules: default +[gosec] 2023/09/07 00:25:40 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/parallel-letter-frequency +[gosec] 2023/09/07 00:25:40 Checking package: letter +[gosec] 2023/09/07 00:25:40 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/parallel-letter-frequency/parallel_letter_frequency.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 44 + Nosec : 0 + Issues : 0 + + +real 0m0.087s +user 0m0.073s +sys 0m0.046s -real 0m1.159s -user 0m0.770s -sys 0m0.583s -go test -v -covermode=count -coverprofile coverage.out letter + ============================================================================== + +Exit code: 0 + +real 0m0.122s +user 0m0.088s +sys 0m0.075s + +real 0m0.124s +user 0m0.090s +sys 0m0.076s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.005s +sys 0m0.011s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestConcurrentFrequency --- PASS: TestConcurrentFrequency (0.00s) === RUN TestSequentialFrequency @@ -29,138 +721,212 @@ go test -v -covermode=count -coverprofile coverage.out letter --- PASS: ExampleFrequency (0.00s) PASS coverage: 100.0% of statements -ok letter 0.018s coverage: 100.0% of statements +ok letter 0.004s coverage: 100.0% of statements -real 0m0.762s -user 0m0.887s -sys 0m0.570s +real 0m0.180s +user 0m0.246s +sys 0m0.144s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + letter/parallel_letter_frequency.go:8: Frequency 100.0% letter/parallel_letter_frequency.go:18: ConcurrentFrequency 100.0% total: (statements) 100.0% -real 0m0.120s -user 0m0.048s -sys 0m0.102s +real 0m0.028s +user 0m0.012s +sys 0m0.024s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.142s -user 0m0.054s -sys 0m0.121s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic letter -=== RUN TestConcurrentFrequency ---- PASS: TestConcurrentFrequency (0.02s) -=== RUN TestSequentialFrequency ---- PASS: TestSequentialFrequency (0.01s) -=== RUN ExampleFrequency ---- PASS: ExampleFrequency (0.00s) -PASS -coverage: 100.0% of statements -ok letter 0.074s coverage: 100.0% of statements +real 0m0.029s +user 0m0.008s +sys 0m0.028s -real 0m1.172s -user 0m1.229s -sys 0m0.720s -=============================================================================== + ============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -Using function ConcurrentFrequency() -goos: linux -goarch: amd64 -pkg: letter -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkFrequency/input_size_0-4 16 70983193 ns/op 11973416 B/op 99321 allocs/op -BenchmarkFrequency/input_size_1-4 9 126952655 ns/op 19622605 B/op 160333 allocs/op -BenchmarkFrequency/input_size_2-4 3 333811087 ns/op 52220378 B/op 429904 allocs/op -BenchmarkSequentialFrequency-4 2300 436503 ns/op 17572 B/op 13 allocs/op -BenchmarkConcurrentFrequency-4 2443 611976 ns/op 12581 B/op 68 allocs/op -PASS -ok letter 8.529s +Running: cover_annotate -real 0m9.073s -user 0m20.333s -sys 0m2.750s +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt -=============================================================================== +real 0m0.019s +user 0m0.011s +sys 0m0.014s -go test -tags bonus -PASS -ok letter 0.015s +real 0m0.019s +user 0m0.011s +sys 0m0.014s -real 0m0.611s -user 0m0.758s -sys 0m0.484s -=============================================================================== + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -go install golang.org/x/perf/cmd/benchstat@latest +=== RUN TestConcurrentFrequency +--- PASS: TestConcurrentFrequency (0.01s) +=== RUN TestSequentialFrequency +--- PASS: TestSequentialFrequency (0.00s) +=== RUN ExampleFrequency +--- PASS: ExampleFrequency (0.00s) +PASS +coverage: 100.0% of statements +ok letter 1.029s coverage: 100.0% of statements -real 0m3.274s -user 0m0.683s -sys 0m0.544s +real 0m1.273s +user 0m0.332s +sys 0m0.181s -benchstat benchstat-old.txt benchstat-new.txt -benchstat: open benchstat-old.txt: no such file or directory -real 0m0.014s -user 0m0.000s -sys 0m0.003s + ============================================================================== -=============================================================================== +Exit code: 0 -go vet letter +real 0m1.558s +user 0m0.622s +sys 0m0.416s -real 0m0.413s -user 0m0.439s -sys 0m0.492s +real 0m1.561s +user 0m0.622s +sys 0m0.419s =============================================================================== -go fix letter +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -real 0m0.057s -user 0m0.032s -sys 0m0.036s +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +goos: linux +goarch: amd64 +pkg: letter +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkFrequency +Using function ConcurrentFrequency() +BenchmarkFrequency/input_size_0 +BenchmarkFrequency/input_size_0-8 64 20260311 ns/op 12324932 B/op 95852 allocs/op +BenchmarkFrequency/input_size_1 +BenchmarkFrequency/input_size_1-8 37 29984914 ns/op 20376356 B/op 154535 allocs/op +BenchmarkFrequency/input_size_2 +BenchmarkFrequency/input_size_2-8 16 74479344 ns/op 55023086 B/op 415782 allocs/op +BenchmarkSequentialFrequency +BenchmarkSequentialFrequency-8 5330 225888 ns/op 17454 B/op 11 allocs/op +BenchmarkConcurrentFrequency +BenchmarkConcurrentFrequency-8 6834 152324 ns/op 14302 B/op 63 allocs/op +PASS +ok letter 9.512s + +real 0m9.672s +user 0m32.749s +sys 0m1.178s =============================================================================== -gosec ./parallel-letter-frequency -[gosec] 2022/06/26 16:48:49 Including rules: default -[gosec] 2022/06/26 16:48:49 Excluding rules: default -[gosec] 2022/06/26 16:48:49 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/parallel-letter-frequency -[gosec] 2022/06/26 16:48:49 Checking package: letter -[gosec] 2022/06/26 16:48:49 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/parallel-letter-frequency/parallel_letter_frequency.go -Results: +gotest -v -tags bonus +=== RUN TestConcurrentFrequency +--- PASS: TestConcurrentFrequency (0.00s) +=== RUN TestSequentialFrequency +--- PASS: TestSequentialFrequency (0.00s) +=== RUN ExampleFrequency +--- PASS: ExampleFrequency (0.00s) +PASS +ok letter 0.003s +real 0m0.140s +user 0m0.194s +sys 0m0.120s -Summary: - Files: 1 - Lines: 44 - Nosec: 0 - Issues: 0 +=============================================================================== +benchstat benchstat-old.txt benchstat-new.txt +benchstat-new.txt:5: missing iteration count +benchstat-new.txt:7: missing iteration count +benchstat-new.txt:9: missing iteration count +benchstat-new.txt:11: missing iteration count +benchstat-new.txt:13: missing iteration count +benchstat-new.txt:15: missing iteration count +goos: linux +goarch: amd64 +pkg: letter +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Frequency/input_size_0-8 20.26m ± ∞ ¹ +Frequency/input_size_1-8 29.98m ± ∞ ¹ +Frequency/input_size_2-8 74.48m ± ∞ ¹ +SequentialFrequency-8 225.9µ ± ∞ ¹ +ConcurrentFrequency-8 152.3µ ± ∞ ¹ +geomean 4.350m +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Frequency/input_size_0-8 11.75Mi ± ∞ ¹ +Frequency/input_size_1-8 19.43Mi ± ∞ ¹ +Frequency/input_size_2-8 52.47Mi ± ∞ ¹ +SequentialFrequency-8 17.04Ki ± ∞ ¹ +ConcurrentFrequency-8 13.97Ki ± ∞ ¹ +geomean 1.222Mi +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Frequency/input_size_0-8 95.85k ± ∞ ¹ +Frequency/input_size_1-8 154.5k ± ∞ ¹ +Frequency/input_size_2-8 415.8k ± ∞ ¹ +SequentialFrequency-8 11.00 ± ∞ ¹ +ConcurrentFrequency-8 63.00 ± ∞ ¹ +geomean 5.322k +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.283s -user 0m0.355s -sys 0m0.182s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Frequency/input_size_0-4 70.98m ± ∞ ¹ +Frequency/input_size_1-4 127.0m ± ∞ ¹ +Frequency/input_size_2-4 333.8m ± ∞ ¹ +SequentialFrequency-4 436.5µ ± ∞ ¹ +ConcurrentFrequency-4 612.0µ ± ∞ ¹ +geomean 15.17m +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ B/op │ +Frequency/input_size_0-4 11.42Mi ± ∞ ¹ +Frequency/input_size_1-4 18.71Mi ± ∞ ¹ +Frequency/input_size_2-4 49.80Mi ± ∞ ¹ +SequentialFrequency-4 17.16Ki ± ∞ ¹ +ConcurrentFrequency-4 12.29Ki ± ∞ ¹ +geomean 1.164Mi +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ allocs/op │ +Frequency/input_size_0-4 99.32k ± ∞ ¹ +Frequency/input_size_1-4 160.3k ± ∞ ¹ +Frequency/input_size_2-4 429.9k ± ∞ ¹ +SequentialFrequency-4 13.00 ± ∞ ¹ +ConcurrentFrequency-4 68.00 ± ∞ ¹ +geomean 5.707k +¹ need >= 6 samples for confidence interval at level 0.95 + +real 0m0.002s +user 0m0.001s +sys 0m0.002s =============================================================================== gomarkdoc --output letter-doc.md -real 0m0.053s -user 0m0.056s -sys 0m0.029s +real 0m0.009s +user 0m0.005s +sys 0m0.004s =============================================================================== @@ -182,9 +948,9 @@ func Frequency(s string) FreqMap data as a FreqMap. -real 0m0.428s -user 0m0.124s -sys 0m0.268s +real 0m1.466s +user 0m0.051s +sys 0m0.051s =============================================================================== diff --git a/go/parsing-log-files/benchstat-new.txt b/go/parsing-log-files/benchstat-new.txt index 479d348b..c652da68 100644 --- a/go/parsing-log-files/benchstat-new.txt +++ b/go/parsing-log-files/benchstat-new.txt @@ -1,2 +1,2 @@ PASS -ok parsinglogfiles 0.010s +ok parsinglogfiles 0.003s diff --git a/go/parsing-log-files/benchstat-old.txt b/go/parsing-log-files/benchstat-old.txt new file mode 100644 index 00000000..479d348b --- /dev/null +++ b/go/parsing-log-files/benchstat-old.txt @@ -0,0 +1,2 @@ +PASS +ok parsinglogfiles 0.010s diff --git a/go/parsing-log-files/coverage-annotations.txt b/go/parsing-log-files/coverage-annotations.txt new file mode 100644 index 00000000..283f628d --- /dev/null +++ b/go/parsing-log-files/coverage-annotations.txt @@ -0,0 +1,79 @@ + +36 func CountQuotedPasswords(lines []string) int { +37 var count int +38 var regexpString string = `(?i)".*password.*"` +39 +40 re, error := regexp.Compile(regexpString) +41 +42 if error != nil { +43 MISS panic(error) +44 } +45 +46 for _, line := range lines { +47 count += len(re.FindAllString(line, -1)) +48 } +49 +50 return count +51 } + + + 8 func IsValidLine(text string) bool { + 9 var regexpString string = `^\[(TRC|DBG|INF|WRN|ERR|FTL)\].*$` +10 +11 isMatch, error := regexp.MatchString(regexpString, text) +12 +13 if error != nil { +14 MISS panic(error) +15 } +16 +17 return isMatch +18 } + + +54 func RemoveEndOfLineText(text string) string { +55 var replacement string +56 var regexpString string = `(?i)end-of-line[0-9]+` +57 +58 re, error := regexp.Compile(regexpString) +59 +60 if error != nil { +61 MISS panic(error) +62 } +63 +64 replacement = re.ReplaceAllString(text, "") +65 +66 return replacement +67 } + + +21 func SplitLogLine(text string) []string { +22 var regexpString string = `\b<[-~=*]*>\b` +23 +24 re, error := regexp.Compile(regexpString) +25 +26 if error != nil { +27 MISS panic(error) +28 } +29 +30 tokens := re.Split(text, -1) +31 +32 return tokens +33 } + + +70 func TagWithUserName(lines []string) []string { +71 var regexpString string = `^(.*User +\b)([A-Za-z][A-Za-z0-9]+)(\b.*)$` +72 +73 re, error := regexp.Compile(regexpString) +74 +75 if error != nil { +76 MISS panic(error) +77 } +78 +79 for index, line := range lines { +80 lines[index] = re.ReplaceAllString(line, `[USR] $2 $1$2$3`) +81 } +82 +83 return lines +84 } + diff --git a/go/parsing-log-files/coverage.out b/go/parsing-log-files/coverage.out index f5fe26e8..29ef5890 100644 --- a/go/parsing-log-files/coverage.out +++ b/go/parsing-log-files/coverage.out @@ -1,20 +1,20 @@ mode: count parsinglogfiles/parsing_log_files.go:8.36,13.18 3 10 -parsinglogfiles/parsing_log_files.go:17.2,17.16 1 10 parsinglogfiles/parsing_log_files.go:13.18,14.15 1 0 +parsinglogfiles/parsing_log_files.go:17.2,17.16 1 10 parsinglogfiles/parsing_log_files.go:21.41,26.18 3 6 -parsinglogfiles/parsing_log_files.go:30.2,32.15 2 6 parsinglogfiles/parsing_log_files.go:26.18,27.15 1 0 +parsinglogfiles/parsing_log_files.go:30.2,32.15 2 6 parsinglogfiles/parsing_log_files.go:36.47,42.18 4 3 -parsinglogfiles/parsing_log_files.go:46.2,46.29 1 3 -parsinglogfiles/parsing_log_files.go:50.2,50.14 1 3 parsinglogfiles/parsing_log_files.go:42.18,43.15 1 0 +parsinglogfiles/parsing_log_files.go:46.2,46.29 1 3 parsinglogfiles/parsing_log_files.go:46.29,48.3 1 10 +parsinglogfiles/parsing_log_files.go:50.2,50.14 1 3 parsinglogfiles/parsing_log_files.go:54.46,60.18 4 2 -parsinglogfiles/parsing_log_files.go:64.2,66.20 2 2 parsinglogfiles/parsing_log_files.go:60.18,61.15 1 0 +parsinglogfiles/parsing_log_files.go:64.2,66.20 2 2 parsinglogfiles/parsing_log_files.go:70.47,75.18 3 2 -parsinglogfiles/parsing_log_files.go:79.2,79.33 1 2 -parsinglogfiles/parsing_log_files.go:83.2,83.14 1 2 parsinglogfiles/parsing_log_files.go:75.18,76.15 1 0 +parsinglogfiles/parsing_log_files.go:79.2,79.33 1 2 parsinglogfiles/parsing_log_files.go:79.33,81.3 1 8 +parsinglogfiles/parsing_log_files.go:83.2,83.14 1 2 diff --git a/go/parsing-log-files/parsinglogfiles-doc.md b/go/parsing-log-files/parsinglogfiles-doc.md index 041576a0..81f710fd 100755 --- a/go/parsing-log-files/parsinglogfiles-doc.md +++ b/go/parsing-log-files/parsinglogfiles-doc.md @@ -21,7 +21,7 @@ import "parsinglogfiles" func CountQuotedPasswords(lines []string) int ``` -CountQuotedPasswords returns the count of quoted passwords from the array of log lines\. +CountQuotedPasswords returns the count of quoted passwords from the array of log lines.

Example

@@ -55,7 +55,7 @@ CountQuotedPasswords returns the count of quoted passwords from the array of log func IsValidLine(text string) bool ``` -IsValidLine returns true if the text starts with one of \[TRC\]\, \[DBG\]\, \[INF\]\, \[WRN\]\, \[ERR\]\, \[FTL\]\. +IsValidLine returns true if the text starts with one of \[TRC\], \[DBG\], \[INF\], \[WRN\], \[ERR\], \[FTL\].

Example

@@ -86,7 +86,7 @@ false func RemoveEndOfLineText(text string) string ``` -RemoveEndOfLineText returns a string without \`end\-of\-line\[0\-9\]\+\`\. +RemoveEndOfLineText returns a string without \`end\-of\-line\[0\-9\]\+\`.

Example

@@ -113,7 +113,7 @@ RemoveEndOfLineText returns a string without \`end\-of\-line\[0\-9\]\+\`\. func SplitLogLine(text string) []string ``` -SplitLogLine returns a string slice of fields from the passed text\. +SplitLogLine returns a string slice of fields from the passed text.

Example

@@ -140,7 +140,7 @@ SplitLogLine returns a string slice of fields from the passed text\. func TagWithUserName(lines []string) []string ``` -TagWithUserName returns a slice of strings with user mentions\. +TagWithUserName returns a slice of strings with user mentions.

Example

diff --git a/go/parsing-log-files/run-tests-go.txt b/go/parsing-log-files/run-tests-go.txt index 0f1b5d19..b01faf25 100644 --- a/go/parsing-log-files/run-tests-go.txt +++ b/go/parsing-log-files/run-tests-go.txt @@ -5,15 +5,649 @@ Go packages: parsinglogfiles =============================================================================== -golint parsinglogfiles +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.247s -user 0m0.194s -sys 0m0.167s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.011s +sys 0m0.020s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +parsing_log_files.go:9:19: var-declaration: should omit type string from declaration of var regexpString; it will be inferred from the right-hand side (revive) + var regexpString string = `^\[(TRC|DBG|INF|WRN|ERR|FTL)\].*$` + ^ +parsing_log_files.go:22:19: var-declaration: should omit type string from declaration of var regexpString; it will be inferred from the right-hand side (revive) + var regexpString string = `\b<[-~=*]*>\b` + ^ +parsing_log_files.go:38:19: var-declaration: should omit type string from declaration of var regexpString; it will be inferred from the right-hand side (revive) + var regexpString string = `(?i)".*password.*"` + ^ +parsing_log_files_test.go:49:23: Using the variable on range scope `tt` in function literal (scopelint) + got := IsValidLine(tt.text) + ^ +parsing_log_files_test.go:50:12: Using the variable on range scope `tt` in function literal (scopelint) + want := tt.expected + ^ +parsing_log_files_test.go:92:24: Using the variable on range scope `tt` in function literal (scopelint) + got := SplitLogLine(tt.text) + ^ +parsing_log_files_examples_test.go:51:2: ranges should only be cuddled with assignments used in the iteration (wsl) + for _, line := range result { + ^ +parsing_log_files_examples_test.go:54:2: expressions should not be cuddled with blocks (wsl) + fmt.Println("}") + ^ +parsing_log_files_test.go:202:2: if statements should only be cuddled with assignments (wsl) + if len(a) == 0 { + ^ +parsing_log_files_test.go:205:2: only one cuddle assignment allowed before range statement (wsl) + for i := range a { + ^ +parsing_log_files_test.go:210:2: return statements should not be cuddled if block has more than two lines (wsl) + return true + ^ +parsing_log_files_examples_test.go:14:2: Duplicate words (false) found (dupword) + // false + ^ +parsing_log_files_test.go:5:1: Function TestIsValidLine missing the call to method parallel (paralleltest) +func TestIsValidLine(t *testing.T) { +^ +parsing_log_files_test.go:47:2: Range statement for test TestIsValidLine missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +parsing_log_files_test.go:58:1: Function TestSplitLogLine missing the call to method parallel (paralleltest) +func TestSplitLogLine(t *testing.T) { +^ +parsing_log_files_test.go:90:2: Range statement for test TestSplitLogLine missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +parsing_log_files_test.go:101:1: Function TestCountQuotedPasswords missing the call to method parallel (paralleltest) +func TestCountQuotedPasswords(t *testing.T) { +^ +parsing_log_files_test.go:126:2: Range statement for test TestCountQuotedPasswords missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +parsing_log_files_test.go:137:1: Function TestRemoveEndOfLineText missing the call to method parallel (paralleltest) +func TestRemoveEndOfLineText(t *testing.T) { +^ +parsing_log_files_test.go:149:2: Range statement for test TestRemoveEndOfLineText missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +parsing_log_files_test.go:160:1: Function TestTagWithUserName missing the call to method parallel (paralleltest) +func TestTagWithUserName(t *testing.T) { +^ +parsing_log_files_test.go:182:2: Range statement for test TestTagWithUserName missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +parsing_log_files.go:11:11: variable error has same name as predeclared identifier (predeclared) + isMatch, error := regexp.MatchString(regexpString, text) + ^ +parsing_log_files.go:24:6: variable error has same name as predeclared identifier (predeclared) + re, error := regexp.Compile(regexpString) + ^ +parsing_log_files.go:40:6: variable error has same name as predeclared identifier (predeclared) + re, error := regexp.Compile(regexpString) + ^ +parsing_log_files_examples_test.go:1:9: package should be `parsinglogfiles_test` instead of `parsinglogfiles` (testpackage) +package parsinglogfiles + ^ +parsing_log_files_test.go:1:9: package should be `parsinglogfiles_test` instead of `parsinglogfiles` (testpackage) +package parsinglogfiles + ^ +parsing_log_files_test.go:198:23: parameter name 'a' is too short for the scope of its usage (varnamelen) +func stringSliceEqual(a, b []string) bool { + ^ + +real 0m0.521s +user 0m0.875s +sys 0m0.488s + + + ============================================================================== + +Exit code: -1 + +real 0m0.558s +user 0m0.893s +sys 0m0.525s + +real 0m0.562s +user 0m0.896s +sys 0m0.528s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.015s +sys 0m0.029s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +parsing_log_files.go + (9, 19) https://revive.run/r#var-declaration should omit type string from declaration of var regexpString; it will be inferred from the right-hand side + (22, 19) https://revive.run/r#var-declaration should omit type string from declaration of var regexpString; it will be inferred from the right-hand side + (38, 19) https://revive.run/r#var-declaration should omit type string from declaration of var regexpString; it will be inferred from the right-hand side + (56, 19) https://revive.run/r#var-declaration should omit type string from declaration of var regexpString; it will be inferred from the right-hand side + (71, 19) https://revive.run/r#var-declaration should omit type string from declaration of var regexpString; it will be inferred from the right-hand side + (1, 1) https://revive.run/r#package-comments should have a package comment + + + ✖ 6 problems (0 errors) (6 warnings) + +real 0m0.066s +user 0m0.041s +sys 0m0.045s + + + ============================================================================== + +Exit code: 0 + +real 0m0.104s +user 0m0.062s +sys 0m0.083s + +real 0m0.106s +user 0m0.063s +sys 0m0.084s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.018s +sys 0m0.034s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "regexp" without types was imported from "parsinglogfiles" + +real 0m0.104s +user 0m0.159s +sys 0m0.135s + + + ============================================================================== + +Exit code: -1 + +real 0m0.153s +user 0m0.182s +sys 0m0.186s + +real 0m0.156s +user 0m0.184s +sys 0m0.188s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.022s +sys 0m0.015s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +parsing_log_files.go:1:1: at least one file in a package should have a package comment (ST1000) +parsing_log_files.go:9:19: should omit type string from declaration; it will be inferred from the right-hand side (ST1023) +parsing_log_files.go:22:19: should omit type string from declaration; it will be inferred from the right-hand side (ST1023) +parsing_log_files.go:38:19: should omit type string from declaration; it will be inferred from the right-hand side (ST1023) +parsing_log_files.go:56:19: should omit type string from declaration; it will be inferred from the right-hand side (ST1023) +parsing_log_files.go:71:19: should omit type string from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.172s +user 0m0.231s +sys 0m0.110s + + + ============================================================================== + +Exit code: -1 + +real 0m0.208s +user 0m0.259s +sys 0m0.133s + +real 0m0.210s +user 0m0.260s +sys 0m0.134s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.012s +sys 0m0.015s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./parsing_log_files.go:11:11: builtinShadow: shadowing of predeclared identifier: error +./parsing_log_files.go:24:6: builtinShadow: shadowing of predeclared identifier: error +./parsing_log_files.go:40:6: builtinShadow: shadowing of predeclared identifier: error +./parsing_log_files.go:58:6: builtinShadow: shadowing of predeclared identifier: error +./parsing_log_files.go:73:6: builtinShadow: shadowing of predeclared identifier: error + +real 0m0.798s +user 0m2.028s +sys 0m0.293s + + + ============================================================================== + +Exit code: -1 + +real 0m0.827s +user 0m2.044s +sys 0m0.317s + +real 0m0.829s +user 0m2.044s +sys 0m0.319s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.009s +sys 0m0.026s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.072s +user 0m0.093s +sys 0m0.111s + + + ============================================================================== + +Exit code: 0 + +real 0m0.106s +user 0m0.108s +sys 0m0.146s + +real 0m0.108s +user 0m0.108s +sys 0m0.148s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.012s +sys 0m0.021s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.024s +user 0m0.014s +sys 0m0.020s + + + ============================================================================== + +Exit code: 0 + +real 0m0.056s +user 0m0.031s +sys 0m0.051s + +real 0m0.058s +user 0m0.032s +sys 0m0.052s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.037s +user 0m0.028s +sys 0m0.028s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.423s +user 0m1.166s +sys 0m0.266s + + + ============================================================================== + +Exit code: 0 + +real 0m0.478s +user 0m1.204s +sys 0m0.309s + +real 0m0.482s +user 0m1.204s +sys 0m0.312s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.016s +sys 0m0.032s + + + ============================================================================== + +Running: gocyclo . + +5 parsinglogfiles stringSliceEqual parsing_log_files_test.go:198:1 +5 parsinglogfiles TestTagWithUserName parsing_log_files_test.go:160:1 +3 parsinglogfiles TestRemoveEndOfLineText parsing_log_files_test.go:137:1 +3 parsinglogfiles TestCountQuotedPasswords parsing_log_files_test.go:101:1 +3 parsinglogfiles TestSplitLogLine parsing_log_files_test.go:58:1 +3 parsinglogfiles TestIsValidLine parsing_log_files_test.go:5:1 +3 parsinglogfiles TagWithUserName parsing_log_files.go:70:1 +3 parsinglogfiles CountQuotedPasswords parsing_log_files.go:36:1 +2 parsinglogfiles ExampleTagWithUserName parsing_log_files_examples_test.go:42:1 +2 parsinglogfiles RemoveEndOfLineText parsing_log_files.go:54:1 +2 parsinglogfiles SplitLogLine parsing_log_files.go:21:1 +2 parsinglogfiles IsValidLine parsing_log_files.go:8:1 +1 parsinglogfiles ExampleRemoveEndOfLineText parsing_log_files_examples_test.go:36:1 +1 parsinglogfiles ExampleCountQuotedPasswords parsing_log_files_examples_test.go:23:1 +1 parsinglogfiles ExampleSplitLogLine parsing_log_files_examples_test.go:17:1 +1 parsinglogfiles ExampleIsValidLine parsing_log_files_examples_test.go:7:1 + +real 0m0.003s +user 0m0.002s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.052s +user 0m0.025s +sys 0m0.048s + +real 0m0.055s +user 0m0.025s +sys 0m0.050s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.028s +user 0m0.027s +sys 0m0.015s + + + ============================================================================== + +Exit code: 0 + +real 0m0.047s +user 0m0.036s +sys 0m0.033s + +real 0m0.050s +user 0m0.038s +sys 0m0.034s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.016s +sys 0m0.022s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:25:55 Including rules: default +[gosec] 2023/09/07 00:25:55 Excluding rules: default +[gosec] 2023/09/07 00:25:55 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/parsing-log-files +[gosec] 2023/09/07 00:25:55 Checking package: parsinglogfiles +[gosec] 2023/09/07 00:25:55 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/parsing-log-files/parsing_log_files.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 84 + Nosec : 0 + Issues : 0 + + +real 0m0.112s +user 0m0.113s +sys 0m0.106s + + + ============================================================================== + +Exit code: 0 + +real 0m0.148s +user 0m0.131s +sys 0m0.141s + +real 0m0.150s +user 0m0.132s +sys 0m0.142s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out parsinglogfiles +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.015s +sys 0m0.020s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestIsValidLine === RUN TestIsValidLine/Valid_ERR_message === RUN TestIsValidLine/Valid_INF_message @@ -68,15 +702,17 @@ go test -v -covermode=count -coverprofile coverage.out parsinglogfiles --- PASS: ExampleTagWithUserName (0.00s) PASS coverage: 84.8% of statements -ok parsinglogfiles 0.022s coverage: 84.8% of statements +ok parsinglogfiles 0.003s coverage: 84.8% of statements -real 0m0.713s -user 0m0.766s -sys 0m0.441s +real 0m0.177s +user 0m0.228s +sys 0m0.160s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + parsinglogfiles/parsing_log_files.go:8: IsValidLine 80.0% parsinglogfiles/parsing_log_files.go:21: SplitLogLine 83.3% parsinglogfiles/parsing_log_files.go:36: CountQuotedPasswords 87.5% @@ -84,21 +720,119 @@ parsinglogfiles/parsing_log_files.go:54: RemoveEndOfLineText 85.7% parsinglogfiles/parsing_log_files.go:70: TagWithUserName 85.7% total: (statements) 84.8% -real 0m0.192s -user 0m0.185s -sys 0m0.189s +real 0m0.046s +user 0m0.050s +sys 0m0.063s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.188s -user 0m0.195s -sys 0m0.169s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic parsinglogfiles +real 0m0.041s +user 0m0.052s +sys 0m0.061s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +36 func CountQuotedPasswords(lines []string) int { +37 var count int +38 var regexpString string = `(?i)".*password.*"` +39 +40 re, error := regexp.Compile(regexpString) +41 +42 if error != nil { +43 MISS panic(error) +44 } +45 +46 for _, line := range lines { +47 count += len(re.FindAllString(line, -1)) +48 } +49 +50 return count +51 } + + + 8 func IsValidLine(text string) bool { + 9 var regexpString string = `^\[(TRC|DBG|INF|WRN|ERR|FTL)\].*$` +10 +11 isMatch, error := regexp.MatchString(regexpString, text) +12 +13 if error != nil { +14 MISS panic(error) +15 } +16 +17 return isMatch +18 } + + +54 func RemoveEndOfLineText(text string) string { +55 var replacement string +56 var regexpString string = `(?i)end-of-line[0-9]+` +57 +58 re, error := regexp.Compile(regexpString) +59 +60 if error != nil { +61 MISS panic(error) +62 } +63 +64 replacement = re.ReplaceAllString(text, "") +65 +66 return replacement +67 } + + +21 func SplitLogLine(text string) []string { +22 var regexpString string = `\b<[-~=*]*>\b` +23 +24 re, error := regexp.Compile(regexpString) +25 +26 if error != nil { +27 MISS panic(error) +28 } +29 +30 tokens := re.Split(text, -1) +31 +32 return tokens +33 } + + +70 func TagWithUserName(lines []string) []string { +71 var regexpString string = `^(.*User +\b)([A-Za-z][A-Za-z0-9]+)(\b.*)$` +72 +73 re, error := regexp.Compile(regexpString) +74 +75 if error != nil { +76 MISS panic(error) +77 } +78 +79 for index, line := range lines { +80 lines[index] = re.ReplaceAllString(line, `[USR] $2 $1$2$3`) +81 } +82 +83 return lines +84 } + + +real 0m0.021s +user 0m0.009s +sys 0m0.024s + +real 0m0.021s +user 0m0.009s +sys 0m0.024s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestIsValidLine === RUN TestIsValidLine/Valid_ERR_message === RUN TestIsValidLine/Valid_INF_message @@ -107,7 +841,7 @@ go test -v -race -covermode=atomic parsinglogfiles === RUN TestIsValidLine/Invalid_tag === RUN TestIsValidLine/Line_with_less_characters_than_5 === RUN TestIsValidLine/Empty_line ---- PASS: TestIsValidLine (0.01s) +--- PASS: TestIsValidLine (0.00s) --- PASS: TestIsValidLine/Valid_ERR_message (0.00s) --- PASS: TestIsValidLine/Valid_INF_message (0.00s) --- PASS: TestIsValidLine/Invalid_ERR_message (0.00s) @@ -153,71 +887,115 @@ go test -v -race -covermode=atomic parsinglogfiles --- PASS: ExampleTagWithUserName (0.00s) PASS coverage: 84.8% of statements -ok parsinglogfiles 0.063s coverage: 84.8% of statements +ok parsinglogfiles 1.019s coverage: 84.8% of statements -real 0m1.157s -user 0m1.001s -sys 0m0.697s +real 0m1.262s +user 0m0.278s +sys 0m0.191s -=============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -PASS -ok parsinglogfiles 0.010s + ============================================================================== -real 0m0.727s -user 0m0.744s -sys 0m0.535s +Exit code: 0 -=============================================================================== +real 0m1.587s +user 0m0.645s +sys 0m0.533s -go test -tags bonus -PASS -ok parsinglogfiles 0.010s - -real 0m0.503s -user 0m0.561s -sys 0m0.378s +real 0m1.594s +user 0m0.650s +sys 0m0.535s =============================================================================== -No old benchmarks to run benchstat against. +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -=============================================================================== - -go vet parsinglogfiles +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok parsinglogfiles 0.003s -real 0m0.349s -user 0m0.429s -sys 0m0.323s +real 0m0.237s +user 0m0.269s +sys 0m0.212s =============================================================================== -go fix parsinglogfiles +gotest -v -tags bonus +=== RUN TestIsValidLine +=== RUN TestIsValidLine/Valid_ERR_message +=== RUN TestIsValidLine/Valid_INF_message +=== RUN TestIsValidLine/Invalid_ERR_message +=== RUN TestIsValidLine/Invalid_INF_message +=== RUN TestIsValidLine/Invalid_tag +=== RUN TestIsValidLine/Line_with_less_characters_than_5 +=== RUN TestIsValidLine/Empty_line +--- PASS: TestIsValidLine (0.00s) + --- PASS: TestIsValidLine/Valid_ERR_message (0.00s) + --- PASS: TestIsValidLine/Valid_INF_message (0.00s) + --- PASS: TestIsValidLine/Invalid_ERR_message (0.00s) + --- PASS: TestIsValidLine/Invalid_INF_message (0.00s) + --- PASS: TestIsValidLine/Invalid_tag (0.00s) + --- PASS: TestIsValidLine/Line_with_less_characters_than_5 (0.00s) + --- PASS: TestIsValidLine/Empty_line (0.00s) +=== RUN TestSplitLogLine +=== RUN TestSplitLogLine/three_sections +=== RUN TestSplitLogLine/three_sections_with_different_symbols_inside_angular_brackets +=== RUN TestSplitLogLine/two_sections_with_no_characters_between_angular_brackets +=== RUN TestSplitLogLine/single_section_with_some_angular_brackets +=== RUN TestSplitLogLine/empty_text +--- PASS: TestSplitLogLine (0.00s) + --- PASS: TestSplitLogLine/three_sections (0.00s) + --- PASS: TestSplitLogLine/three_sections_with_different_symbols_inside_angular_brackets (0.00s) + --- PASS: TestSplitLogLine/two_sections_with_no_characters_between_angular_brackets (0.00s) + --- PASS: TestSplitLogLine/single_section_with_some_angular_brackets (0.00s) + --- PASS: TestSplitLogLine/empty_text (0.00s) +=== RUN TestCountQuotedPasswords +=== RUN TestCountQuotedPasswords/text_with_two_matches +=== RUN TestCountQuotedPasswords/text_with_no_matches +--- PASS: TestCountQuotedPasswords (0.00s) + --- PASS: TestCountQuotedPasswords/text_with_two_matches (0.00s) + --- PASS: TestCountQuotedPasswords/text_with_no_matches (0.00s) +=== RUN TestRemoveEndOfLineText +=== RUN TestRemoveEndOfLineText/INF_message +--- PASS: TestRemoveEndOfLineText (0.00s) + --- PASS: TestRemoveEndOfLineText/INF_message (0.00s) +=== RUN TestTagWithUserName +=== RUN TestTagWithUserName/INF_message +--- PASS: TestTagWithUserName (0.00s) + --- PASS: TestTagWithUserName/INF_message (0.00s) +=== RUN ExampleIsValidLine +--- PASS: ExampleIsValidLine (0.00s) +=== RUN ExampleSplitLogLine +--- PASS: ExampleSplitLogLine (0.00s) +=== RUN ExampleCountQuotedPasswords +--- PASS: ExampleCountQuotedPasswords (0.00s) +=== RUN ExampleRemoveEndOfLineText +--- PASS: ExampleRemoveEndOfLineText (0.00s) +=== RUN ExampleTagWithUserName +--- PASS: ExampleTagWithUserName (0.00s) +PASS +ok parsinglogfiles 0.004s real 0m0.154s -user 0m0.138s -sys 0m0.106s +user 0m0.180s +sys 0m0.137s =============================================================================== -gosec ./parsing-log-files -[gosec] 2022/07/26 07:20:23 Including rules: default -[gosec] 2022/07/26 07:20:23 Excluding rules: default -[gosec] 2022/07/26 07:20:23 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/parsing-log-files -2022/07/26 07:20:24 internal error: package "regexp" without types was imported from "command-line-arguments" +benchstat benchstat-old.txt benchstat-new.txt -real 0m0.441s -user 0m0.461s -sys 0m0.312s +real 0m0.003s +user 0m0.002s +sys 0m0.001s =============================================================================== gomarkdoc --output parsinglogfiles-doc.md -real 0m0.030s -user 0m0.028s -sys 0m0.020s +real 0m0.019s +user 0m0.014s +sys 0m0.007s =============================================================================== @@ -245,9 +1023,9 @@ func TagWithUserName(lines []string) []string TagWithUserName returns a slice of strings with user mentions. -real 0m0.181s -user 0m0.157s -sys 0m0.157s +real 0m0.051s +user 0m0.031s +sys 0m0.037s =============================================================================== diff --git a/go/party-robot/benchstat-new.txt b/go/party-robot/benchstat-new.txt index 88508d8f..8dbc5860 100644 --- a/go/party-robot/benchstat-new.txt +++ b/go/party-robot/benchstat-new.txt @@ -1,2 +1,2 @@ PASS -ok partyrobot 0.039s +ok partyrobot 0.003s diff --git a/go/party-robot/benchstat-old.txt b/go/party-robot/benchstat-old.txt new file mode 100644 index 00000000..88508d8f --- /dev/null +++ b/go/party-robot/benchstat-old.txt @@ -0,0 +1,2 @@ +PASS +ok partyrobot 0.039s diff --git a/go/party-robot/coverage-annotations.txt b/go/party-robot/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/party-robot/partyrobot-doc.md b/go/party-robot/partyrobot-doc.md index 62e77023..11d35c19 100755 --- a/go/party-robot/partyrobot-doc.md +++ b/go/party-robot/partyrobot-doc.md @@ -19,7 +19,7 @@ import "partyrobot" func AssignTable(name string, table int, neighbor, direction string, distance float64) string ``` -AssignTable assigns a table to each guest\. +AssignTable assigns a table to each guest.

Example

@@ -48,7 +48,7 @@ You will be sitting next to Frank. func HappyBirthday(name string, age int) string ``` -HappyBirthday wishes happy birthday to the birthday person and exclaims their age\. +HappyBirthday wishes happy birthday to the birthday person and exclaims their age.

Example

@@ -75,7 +75,7 @@ Happy birthday Frank! You are now 58 years old! func Welcome(name string) string ``` -Welcome greets a person by name\. +Welcome greets a person by name.

Example

diff --git a/go/party-robot/run-tests-go.txt b/go/party-robot/run-tests-go.txt index c501ca75..dc65ef78 100644 --- a/go/party-robot/run-tests-go.txt +++ b/go/party-robot/run-tests-go.txt @@ -5,15 +5,587 @@ Go packages: partyrobot =============================================================================== -golint partyrobot +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.024s +sys 0m0.033s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +party_robot_test.go:63: Function 'TestAssignTable' is too long (69 > 60) (funlen) +func TestAssignTable(t *testing.T) { +party_robot_test.go:80: line is 192 characters (lll) + want: "Welcome to my party, Chihiro!\nYou have been assigned to table 022. Your table is straight ahead, exactly 9.2 meters from here.\nYou will be sitting next to Akachi Chikondi.", +party_robot_test.go:89: line is 184 characters (lll) + want: "Welcome to my party, Xuân Jing!\nYou have been assigned to table 004. Your table is by the façade, exactly 23.5 meters from here.\nYou will be sitting next to Renée.", +party_robot_test.go:98: line is 181 characters (lll) + want: "Welcome to my party, Paula!\nYou have been assigned to table 101. Your table is on the right, exactly 100.0 meters from here.\nYou will be sitting next to Chioma.", +party_robot_test.go:27:22: Using the variable on range scope `tt` in function literal (scopelint) + if got := Welcome(tt.name); got != tt.want { + ^ +party_robot_test.go:28:43: Using the variable on range scope `tt` in function literal (scopelint) + t.Errorf("Welcome(%s) = %s, want %s", tt.name, got, tt.want) + ^ +party_robot_test.go:56:28: Using the variable on range scope `tt` in function literal (scopelint) + if got := HappyBirthday(tt.name, tt.age); got != tt.want { + ^ +party_robot_test.go:129: unnecessary trailing newline (whitespace) + + } +party_robot_test.go:8:1: Function TestWelcome missing the call to method parallel (paralleltest) +func TestWelcome(t *testing.T) { +^ +party_robot_test.go:25:2: Range statement for test TestWelcome missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +party_robot_test.go:34:1: Function TestHappyBirthday missing the call to method parallel (paralleltest) +func TestHappyBirthday(t *testing.T) { +^ +party_robot_test.go:54:2: Range statement for test TestHappyBirthday missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +party_robot_test.go:101:2: Range statement for test TestAssignTable missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +party_robot_examples_test.go:1:9: package should be `partyrobot_test` instead of `partyrobot` (testpackage) +package partyrobot + ^ +party_robot_test.go:1:9: package should be `partyrobot_test` instead of `partyrobot` (testpackage) +package partyrobot + ^ +party_robot.go:19:6: variable name 's' is too short for the scope of its usage (varnamelen) + var s string + ^ + +real 0m0.526s +user 0m0.699s +sys 0m0.463s + + + ============================================================================== + +Exit code: -1 + +real 0m0.569s +user 0m0.727s +sys 0m0.506s + +real 0m0.572s +user 0m0.728s +sys 0m0.507s -real 0m0.285s -user 0m0.279s -sys 0m0.248s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.028s +sys 0m0.031s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +party_robot.go + (1, 1) https://revive.run/r#package-comments should have a package comment + + + ✖ 1 problem (0 errors) (1 warnings) + +real 0m0.044s +user 0m0.025s +sys 0m0.030s + + + ============================================================================== + +Exit code: 0 + +real 0m0.087s +user 0m0.061s +sys 0m0.070s + +real 0m0.090s +user 0m0.063s +sys 0m0.071s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.019s +sys 0m0.027s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "partyrobot" + +real 0m0.110s +user 0m0.136s +sys 0m0.131s + + + ============================================================================== + +Exit code: -1 + +real 0m0.153s +user 0m0.163s +sys 0m0.171s + +real 0m0.156s +user 0m0.165s +sys 0m0.172s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out partyrobot +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.021s +sys 0m0.028s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +party_robot.go:1:1: at least one file in a package should have a package comment (ST1000) + +real 0m0.200s +user 0m0.241s +sys 0m0.129s + + + ============================================================================== + +Exit code: -1 + +real 0m0.243s +user 0m0.269s +sys 0m0.173s + +real 0m0.245s +user 0m0.270s +sys 0m0.174s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.018s +sys 0m0.021s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.865s +user 0m2.070s +sys 0m0.324s + + + ============================================================================== + +Exit code: 0 + +real 0m0.897s +user 0m2.095s +sys 0m0.352s + +real 0m0.899s +user 0m2.096s +sys 0m0.353s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.019s +sys 0m0.037s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.088s +user 0m0.135s +sys 0m0.118s + + + ============================================================================== + +Exit code: 0 + +real 0m0.129s +user 0m0.162s +sys 0m0.160s + +real 0m0.131s +user 0m0.162s +sys 0m0.162s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.021s +sys 0m0.019s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.027s +user 0m0.022s +sys 0m0.022s + + + ============================================================================== + +Exit code: 0 + +real 0m0.060s +user 0m0.048s +sys 0m0.051s + +real 0m0.062s +user 0m0.050s +sys 0m0.051s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.024s +sys 0m0.027s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.443s +user 0m1.277s +sys 0m0.271s + + + ============================================================================== + +Exit code: 0 + +real 0m0.491s +user 0m1.313s +sys 0m0.310s + +real 0m0.494s +user 0m1.315s +sys 0m0.311s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.020s +sys 0m0.032s + + + ============================================================================== + +Running: gocyclo . + +6 partyrobot TestAssignTable party_robot_test.go:63:1 +3 partyrobot TestHappyBirthday party_robot_test.go:34:1 +3 partyrobot TestWelcome party_robot_test.go:8:1 +1 partyrobot ExampleAssignTable party_robot_examples_test.go:19:1 +1 partyrobot ExampleHappyBirthday party_robot_examples_test.go:13:1 +1 partyrobot ExampleWelcome party_robot_examples_test.go:7:1 +1 partyrobot AssignTable party_robot.go:18:1 +1 partyrobot HappyBirthday party_robot.go:13:1 +1 partyrobot Welcome party_robot.go:8:1 + +real 0m0.003s +user 0m0.001s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.043s +user 0m0.029s +sys 0m0.043s + +real 0m0.046s +user 0m0.030s +sys 0m0.045s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.034s +user 0m0.035s +sys 0m0.016s + + + ============================================================================== + +Exit code: 0 + +real 0m0.052s +user 0m0.042s +sys 0m0.031s + +real 0m0.054s +user 0m0.042s +sys 0m0.033s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.030s +sys 0m0.030s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:26:00 Including rules: default +[gosec] 2023/09/07 00:26:00 Excluding rules: default +[gosec] 2023/09/07 00:26:00 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/party-robot +[gosec] 2023/09/07 00:26:00 Checking package: partyrobot +[gosec] 2023/09/07 00:26:00 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/party-robot/party_robot.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 28 + Nosec : 0 + Issues : 0 + + +real 0m0.110s +user 0m0.114s +sys 0m0.097s + + + ============================================================================== + +Exit code: 0 + +real 0m0.158s +user 0m0.153s +sys 0m0.139s + +real 0m0.160s +user 0m0.155s +sys 0m0.139s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.026s +sys 0m0.028s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestWelcome === RUN TestWelcome/Greet_Chihiro_with_a_welcoming_message === RUN TestWelcome/Greet_Xuân_Jing_with_a_welcoming_message @@ -42,35 +614,56 @@ go test -v -covermode=count -coverprofile coverage.out partyrobot --- PASS: ExampleAssignTable (0.00s) PASS coverage: 100.0% of statements -ok partyrobot 0.005s coverage: 100.0% of statements +ok partyrobot 0.002s coverage: 100.0% of statements -real 0m0.761s -user 0m0.851s -sys 0m0.527s +real 0m0.175s +user 0m0.242s +sys 0m0.149s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + partyrobot/party_robot.go:8: Welcome 100.0% partyrobot/party_robot.go:13: HappyBirthday 100.0% partyrobot/party_robot.go:18: AssignTable 100.0% total: (statements) 100.0% -real 0m0.280s -user 0m0.250s -sys 0m0.214s +real 0m0.068s +user 0m0.090s +sys 0m0.088s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.239s -user 0m0.204s -sys 0m0.191s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic partyrobot +real 0m0.048s +user 0m0.063s +sys 0m0.066s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.020s +user 0m0.016s +sys 0m0.028s + +real 0m0.020s +user 0m0.016s +sys 0m0.028s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestWelcome === RUN TestWelcome/Greet_Chihiro_with_a_welcoming_message === RUN TestWelcome/Greet_Xuân_Jing_with_a_welcoming_message @@ -99,71 +692,89 @@ go test -v -race -covermode=atomic partyrobot --- PASS: ExampleAssignTable (0.00s) PASS coverage: 100.0% of statements -ok partyrobot 0.049s coverage: 100.0% of statements +ok partyrobot 1.013s coverage: 100.0% of statements -real 0m0.895s -user 0m0.876s -sys 0m0.561s +real 0m1.264s +user 0m0.308s +sys 0m0.173s -=============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -PASS -ok partyrobot 0.039s + ============================================================================== -real 0m0.747s -user 0m0.829s -sys 0m0.523s +Exit code: 0 -=============================================================================== - -go test -tags bonus -PASS -ok partyrobot 0.020s +real 0m1.621s +user 0m0.750s +sys 0m0.551s -real 0m0.783s -user 0m0.929s -sys 0m0.532s +real 0m1.623s +user 0m0.753s +sys 0m0.551s =============================================================================== -No old benchmarks to run benchstat against. - -=============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go vet partyrobot +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok partyrobot 0.003s -real 0m0.505s -user 0m0.661s -sys 0m0.365s +real 0m0.166s +user 0m0.228s +sys 0m0.160s =============================================================================== -go fix partyrobot +gotest -v -tags bonus +=== RUN TestWelcome +=== RUN TestWelcome/Greet_Chihiro_with_a_welcoming_message +=== RUN TestWelcome/Greet_Xuân_Jing_with_a_welcoming_message +--- PASS: TestWelcome (0.00s) + --- PASS: TestWelcome/Greet_Chihiro_with_a_welcoming_message (0.00s) + --- PASS: TestWelcome/Greet_Xuân_Jing_with_a_welcoming_message (0.00s) +=== RUN TestHappyBirthday +=== RUN TestHappyBirthday/Wish_Chihiro_Happy_Birthday_with_name_and_age +=== RUN TestHappyBirthday/Wish_Xuân_Jing_Happy_Birthday_with_name_and_age +--- PASS: TestHappyBirthday (0.00s) + --- PASS: TestHappyBirthday/Wish_Chihiro_Happy_Birthday_with_name_and_age (0.00s) + --- PASS: TestHappyBirthday/Wish_Xuân_Jing_Happy_Birthday_with_name_and_age (0.00s) +=== RUN TestAssignTable +=== RUN TestAssignTable/Greet_Chihiro_and_give_them_directions_to_their_seat +=== RUN TestAssignTable/Greet_Xuân_Jing_and_give_them_directions_to_their_seat +=== RUN TestAssignTable/Greet_Paula_and_give_them_directions_to_their_seat +--- PASS: TestAssignTable (0.00s) + --- PASS: TestAssignTable/Greet_Chihiro_and_give_them_directions_to_their_seat (0.00s) + --- PASS: TestAssignTable/Greet_Xuân_Jing_and_give_them_directions_to_their_seat (0.00s) + --- PASS: TestAssignTable/Greet_Paula_and_give_them_directions_to_their_seat (0.00s) +=== RUN ExampleWelcome +--- PASS: ExampleWelcome (0.00s) +=== RUN ExampleHappyBirthday +--- PASS: ExampleHappyBirthday (0.00s) +=== RUN ExampleAssignTable +--- PASS: ExampleAssignTable (0.00s) +PASS +ok partyrobot 0.002s -real 0m0.338s -user 0m0.253s -sys 0m0.191s +real 0m0.149s +user 0m0.206s +sys 0m0.153s =============================================================================== -gosec ./party-robot -[gosec] 2022/07/25 08:27:44 Including rules: default -[gosec] 2022/07/25 08:27:44 Excluding rules: default -[gosec] 2022/07/25 08:27:44 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/party-robot -2022/07/25 08:27:45 internal error: package "fmt" without types was imported from "command-line-arguments" +benchstat benchstat-old.txt benchstat-new.txt -real 0m0.605s -user 0m0.630s -sys 0m0.443s +real 0m0.002s +user 0m0.001s +sys 0m0.001s =============================================================================== gomarkdoc --output partyrobot-doc.md -real 0m0.086s -user 0m0.022s -sys 0m0.076s +real 0m0.014s +user 0m0.007s +sys 0m0.006s =============================================================================== @@ -184,9 +795,9 @@ func Welcome(name string) string Welcome greets a person by name. -real 0m0.337s -user 0m0.278s -sys 0m0.320s +real 0m0.048s +user 0m0.023s +sys 0m0.047s =============================================================================== diff --git a/go/pascals-triangle/benchstat-new.txt b/go/pascals-triangle/benchstat-new.txt index 370aef16..deeb77c5 100644 --- a/go/pascals-triangle/benchstat-new.txt +++ b/go/pascals-triangle/benchstat-new.txt @@ -1,10 +1,10 @@ goos: linux goarch: amd64 pkg: pascal -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkPascalsTriangleFixed -BenchmarkPascalsTriangleFixed-4 48778 24572 ns/op 6136 B/op 95 allocs/op +BenchmarkPascalsTriangleFixed-8 250542 5328 ns/op 6136 B/op 95 allocs/op BenchmarkPascalsTriangleIncreasing -BenchmarkPascalsTriangleIncreasing-4 5218 235783 ns/op 45312 B/op 884 allocs/op +BenchmarkPascalsTriangleIncreasing-8 26805 40437 ns/op 45312 B/op 884 allocs/op PASS -ok pascal 2.774s +ok pascal 3.761s diff --git a/go/pascals-triangle/benchstat-old.txt b/go/pascals-triangle/benchstat-old.txt new file mode 100644 index 00000000..370aef16 --- /dev/null +++ b/go/pascals-triangle/benchstat-old.txt @@ -0,0 +1,10 @@ +goos: linux +goarch: amd64 +pkg: pascal +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkPascalsTriangleFixed +BenchmarkPascalsTriangleFixed-4 48778 24572 ns/op 6136 B/op 95 allocs/op +BenchmarkPascalsTriangleIncreasing +BenchmarkPascalsTriangleIncreasing-4 5218 235783 ns/op 45312 B/op 884 allocs/op +PASS +ok pascal 2.774s diff --git a/go/pascals-triangle/coverage.out b/go/pascals-triangle/coverage.out index 1664e27d..1327ce28 100644 --- a/go/pascals-triangle/coverage.out +++ b/go/pascals-triangle/coverage.out @@ -1,18 +1,18 @@ mode: count pascal/pascals_triangle.go:9.34,10.16 1 28 -pascal/pascals_triangle.go:14.2,16.29 2 27 -pascal/pascals_triangle.go:27.2,27.17 1 27 pascal/pascals_triangle.go:10.16,12.3 1 1 +pascal/pascals_triangle.go:14.2,16.29 2 27 pascal/pascals_triangle.go:16.29,19.27 2 251 -pascal/pascals_triangle.go:24.3,24.36 1 251 pascal/pascals_triangle.go:19.27,22.4 2 1555 +pascal/pascals_triangle.go:24.3,24.36 1 251 +pascal/pascals_triangle.go:27.2,27.17 1 27 pascal/pascals_triangle.go:32.36,33.11 1 4674 -pascal/pascals_triangle.go:37.2,39.26 2 4673 -pascal/pascals_triangle.go:43.2,43.15 1 4673 pascal/pascals_triangle.go:33.11,35.3 1 1 +pascal/pascals_triangle.go:37.2,39.26 2 4673 pascal/pascals_triangle.go:39.26,41.3 1 27322 +pascal/pascals_triangle.go:43.2,43.15 1 4673 pascal/pascals_triangle.go:48.38,49.11 1 1559 -pascal/pascals_triangle.go:53.2,53.11 1 1558 -pascal/pascals_triangle.go:58.2,62.28 4 1557 pascal/pascals_triangle.go:49.11,51.3 1 1 +pascal/pascals_triangle.go:53.2,53.11 1 1558 pascal/pascals_triangle.go:53.11,55.3 1 1 +pascal/pascals_triangle.go:58.2,62.28 4 1557 diff --git a/go/pascals-triangle/run-tests-go.txt b/go/pascals-triangle/run-tests-go.txt index 95ee334d..f5fdf453 100644 --- a/go/pascals-triangle/run-tests-go.txt +++ b/go/pascals-triangle/run-tests-go.txt @@ -5,80 +5,444 @@ Go packages: pascal =============================================================================== -golangci-lint run ./... +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m9.737s -user 0m19.281s -sys 0m3.785s +Running GoLangCi-Lint -=============================================================================== +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.012s +sys 0m0.019s -golint ./... -real 0m0.077s -user 0m0.078s -sys 0m0.072s + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +pascals_triangle_examples_test.go:69: line is 121 characters (lll) + // 6: [][]int{[]int{1}, []int{1, 1}, []int{1, 2, 1}, []int{1, 3, 3, 1}, []int{1, 4, 6, 4, 1}, []int{1, 5, 10, 10, 5, 1}} +pascals_triangle_test.go:38:3: only one cuddle assignment allowed before if statement (wsl) + if !reflect.DeepEqual(res, want) { + ^ +pascals_triangle_test.go:50:2: return statements should not be cuddled if block has more than two lines (wsl) + return + ^ +pascals_triangle_test.go:59:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +pascals_triangle_test.go:70:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +pascals_triangle_test.go:9:5: triangleTestCases is a global variable (gochecknoglobals) +var triangleTestCases = [][]int{ + ^ +pascals_triangle_test.go:32:5: testSize is a global variable (gochecknoglobals) +var testSize = len(triangleTestCases) + ^ +pascals_triangle.go:34:13: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"Factorial(n): n must be >= 0\")" (goerr113) + return 0, errors.New("Factorial(n): n must be >= 0") + ^ +pascals_triangle.go:50:13: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"NChooseK(n, k): k must be >= 0\")" (goerr113) + return 0, errors.New("NChooseK(n, k): k must be >= 0") + ^ +pascals_triangle.go:54:13: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"NChooseK(n, k): n must be >= k\")" (goerr113) + return 0, errors.New("NChooseK(n, k): n must be >= k") + ^ +pascals_triangle_test.go:46:1: named return "s" with type "string" found (nonamedreturns) +func format(t [][]int) (s string) { +^ +pascals_triangle_test.go:34:1: Function TestTriangle missing the call to method parallel (paralleltest) +func TestTriangle(t *testing.T) { +^ +pascals_triangle_examples_test.go:1:9: package should be `pascal_test` instead of `pascal` (testpackage) +package pascal + ^ +pascals_triangle_test.go:1:9: package should be `pascal_test` instead of `pascal` (testpackage) +package pascal + ^ +pascals_triangle.go:37:2: variable name 'f' is too short for the scope of its usage (varnamelen) + f := 1 + ^ +pascals_triangle.go:32:16: parameter name 'n' is too short for the scope of its usage (varnamelen) +func Factorial(n int) (int, error) { + ^ +pascals_triangle.go:48:15: parameter name 'n' is too short for the scope of its usage (varnamelen) +func NChooseK(n, k int) (int, error) { + ^ + +real 0m0.473s +user 0m0.673s +sys 0m0.461s + + + ============================================================================== + +Exit code: -1 + +real 0m0.514s +user 0m0.693s +sys 0m0.496s + +real 0m0.517s +user 0m0.695s +sys 0m0.498s =============================================================================== -revive -formatter=stylish ./... +Running: ../../.github/citools/go/go-lint-revive -real 0m0.028s -user 0m0.020s -sys 0m0.021s +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.048s +user 0m0.024s +sys 0m0.034s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.074s +user 0m0.035s +sys 0m0.058s + + + ============================================================================== + +Exit code: 0 + +real 0m0.138s +user 0m0.065s +sys 0m0.108s + +real 0m0.140s +user 0m0.066s +sys 0m0.110s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.284s -user 0m0.264s -sys 0m0.316s +real 0m0.000s +user 0m0.000s +sys 0m0.000s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.011s +sys 0m0.027s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." +internal error: package "errors" without types was imported from "pascal" + +real 0m0.111s +user 0m0.142s +sys 0m0.131s + -real 0m0.566s -user 0m0.533s -sys 0m0.492s + ============================================================================== + +Exit code: -1 + +real 0m0.154s +user 0m0.159s +sys 0m0.170s + +real 0m0.156s +user 0m0.159s +sys 0m0.171s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.015s +sys 0m0.025s + + + ============================================================================== + +Running: staticcheck -checks=all ./... -real 0m0.445s -user 0m0.393s -sys 0m0.473s + +real 0m0.175s +user 0m0.222s +sys 0m0.151s + + + ============================================================================== + +Exit code: 0 + +real 0m0.219s +user 0m0.244s +sys 0m0.190s + +real 0m0.220s +user 0m0.246s +sys 0m0.190s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.011s +sys 0m0.021s -real 0m2.941s -user 0m4.807s -sys 0m1.254s + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.839s +user 0m2.054s +sys 0m0.299s + + + ============================================================================== + +Exit code: 0 + +real 0m0.876s +user 0m2.070s +sys 0m0.332s + +real 0m0.879s +user 0m2.072s +sys 0m0.332s =============================================================================== -go vet ./... +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== -real 0m0.356s -user 0m0.334s -sys 0m0.341s +Running: go clean ./... + + +real 0m0.028s +user 0m0.014s +sys 0m0.026s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.094s +user 0m0.150s +sys 0m0.127s + + + ============================================================================== + +Exit code: 0 + +real 0m0.140s +user 0m0.174s +sys 0m0.168s + +real 0m0.142s +user 0m0.174s +sys 0m0.169s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-fixer-go_fix -real 0m0.073s -user 0m0.041s -sys 0m0.065s +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.013s +sys 0m0.012s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.020s +user 0m0.011s +sys 0m0.013s + + + ============================================================================== + +Exit code: 0 + +real 0m0.054s +user 0m0.032s +sys 0m0.035s + +real 0m0.056s +user 0m0.032s +sys 0m0.037s =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.009s +sys 0m0.018s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.474s +user 0m1.405s +sys 0m0.328s + + + ============================================================================== + +Exit code: 0 + +real 0m0.508s +user 0m1.419s +sys 0m0.360s + +real 0m0.509s +user 0m1.420s +sys 0m0.360s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.011s +sys 0m0.026s + + + ============================================================================== + +Running: gocyclo . + 4 pascal BenchmarkPascalsTriangleIncreasing pascals_triangle_test.go:66:1 4 pascal Triangle pascals_triangle.go:9:1 3 pascal BenchmarkPascalsTriangleFixed pascals_triangle_test.go:55:1 @@ -90,33 +454,139 @@ gocyclo . 2 pascal ExampleNChooseK pascals_triangle_examples_test.go:25:1 2 pascal ExampleFactorial pascals_triangle_examples_test.go:7:1 -real 0m0.006s -user 0m0.002s -sys 0m0.002s +real 0m0.004s +user 0m0.001s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.042s +user 0m0.017s +sys 0m0.038s + +real 0m0.044s +user 0m0.017s +sys 0m0.040s =============================================================================== -misspell . +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 -real 0m0.092s -user 0m0.099s -sys 0m0.056s + + ============================================================================== + +Running: misspell . + + +real 0m0.031s +user 0m0.035s +sys 0m0.014s + + + ============================================================================== + +Exit code: 0 + +real 0m0.047s +user 0m0.041s +sys 0m0.028s + +real 0m0.050s +user 0m0.043s +sys 0m0.029s =============================================================================== -gosec ./... -[gosec] 2022/08/31 21:08:45 Including rules: default -[gosec] 2022/08/31 21:08:45 Excluding rules: default -[gosec] 2022/08/31 21:08:45 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/pascals-triangle -2022/08/31 21:08:46 internal error: package "errors" without types was imported from "command-line-arguments" +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + -real 0m0.397s -user 0m0.389s -sys 0m0.358s + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.010s +sys 0m0.022s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:26:05 Including rules: default +[gosec] 2023/09/07 00:26:05 Excluding rules: default +[gosec] 2023/09/07 00:26:05 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/pascals-triangle +[gosec] 2023/09/07 00:26:05 Checking package: pascal +[gosec] 2023/09/07 00:26:05 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/pascals-triangle/pascals_triangle.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 63 + Nosec : 0 + Issues : 0 + + +real 0m0.120s +user 0m0.107s +sys 0m0.126s + + + ============================================================================== + +Exit code: 0 + +real 0m0.161s +user 0m0.127s +sys 0m0.163s + +real 0m0.164s +user 0m0.129s +sys 0m0.164s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.016s +sys 0m0.026s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestTriangle pascals_triangle_test.go:43: [1] @@ -148,43 +618,56 @@ gotest -v -covermode=count -coverprofile coverage.out ./... --- PASS: ExampleTriangle (0.00s) PASS coverage: 100.0% of statements -ok pascal 0.027s coverage: 100.0% of statements +ok pascal 0.003s coverage: 100.0% of statements -real 0m0.775s -user 0m0.808s -sys 0m0.552s +real 0m0.181s +user 0m0.230s +sys 0m0.148s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + pascal/pascals_triangle.go:9: Triangle 100.0% pascal/pascals_triangle.go:32: Factorial 100.0% pascal/pascals_triangle.go:48: NChooseK 100.0% total: (statements) 100.0% -real 0m0.156s -user 0m0.121s -sys 0m0.170s +real 0m0.039s +user 0m0.047s +sys 0m0.051s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.150s -user 0m0.100s -sys 0m0.175s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +real 0m0.042s +user 0m0.029s +sys 0m0.058s -real 0m0.070s -user 0m0.058s -sys 0m0.066s -=============================================================================== + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.014s +user 0m0.011s +sys 0m0.009s + +real 0m0.014s +user 0m0.011s +sys 0m0.009s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestTriangle pascals_triangle_test.go:43: [1] @@ -216,29 +699,45 @@ gotest -v -race -covermode=atomic ./... --- PASS: ExampleTriangle (0.00s) PASS coverage: 100.0% of statements -ok pascal 0.060s coverage: 100.0% of statements +ok pascal 1.018s coverage: 100.0% of statements + +real 0m1.279s +user 0m0.321s +sys 0m0.228s -real 0m0.955s -user 0m0.940s -sys 0m0.561s + + ============================================================================== + +Exit code: 0 + +real 0m1.604s +user 0m0.661s +sys 0m0.537s + +real 0m1.607s +user 0m0.662s +sys 0m0.539s =============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: pascal -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkPascalsTriangleFixed -BenchmarkPascalsTriangleFixed-4 48778 24572 ns/op 6136 B/op 95 allocs/op +BenchmarkPascalsTriangleFixed-8 250542 5328 ns/op 6136 B/op 95 allocs/op BenchmarkPascalsTriangleIncreasing -BenchmarkPascalsTriangleIncreasing-4 5218 235783 ns/op 45312 B/op 884 allocs/op +BenchmarkPascalsTriangleIncreasing-8 26805 40437 ns/op 45312 B/op 884 allocs/op PASS -ok pascal 2.774s +ok pascal 3.761s -real 0m3.333s -user 0m4.716s -sys 0m0.847s +real 0m3.950s +user 0m4.248s +sys 0m0.346s =============================================================================== @@ -273,23 +772,77 @@ gotest -v -tags bonus === RUN ExampleTriangle --- PASS: ExampleTriangle (0.00s) PASS -ok pascal 0.022s +ok pascal 0.002s -real 0m0.521s -user 0m0.521s -sys 0m0.492s +real 0m0.132s +user 0m0.201s +sys 0m0.138s =============================================================================== -No old benchmarks to run benchstat against. +benchstat benchstat-old.txt benchstat-new.txt +benchstat-old.txt:5: missing iteration count +benchstat-old.txt:7: missing iteration count +benchstat-new.txt:5: missing iteration count +benchstat-new.txt:7: missing iteration count +goos: linux +goarch: amd64 +pkg: pascal +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +PascalsTriangleFixed-8 5.328µ ± ∞ ¹ +PascalsTriangleIncreasing-8 40.44µ ± ∞ ¹ +geomean 14.68µ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +PascalsTriangleFixed-8 5.992Ki ± ∞ ¹ +PascalsTriangleIncreasing-8 44.25Ki ± ∞ ¹ +geomean 16.28Ki +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +PascalsTriangleFixed-8 95.00 ± ∞ ¹ +PascalsTriangleIncreasing-8 884.0 ± ∞ ¹ +geomean 289.8 +¹ need >= 6 samples for confidence interval at level 0.95 + +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +PascalsTriangleFixed-4 24.57µ ± ∞ ¹ +PascalsTriangleIncreasing-4 235.8µ ± ∞ ¹ +geomean 76.12µ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ B/op │ +PascalsTriangleFixed-4 5.992Ki ± ∞ ¹ +PascalsTriangleIncreasing-4 44.25Ki ± ∞ ¹ +geomean 16.28Ki +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ allocs/op │ +PascalsTriangleFixed-4 95.00 ± ∞ ¹ +PascalsTriangleIncreasing-4 884.0 ± ∞ ¹ +geomean 289.8 +¹ need >= 6 samples for confidence interval at level 0.95 + +real 0m0.003s +user 0m0.002s +sys 0m0.001s =============================================================================== gomarkdoc --output pascal-doc.md -real 0m0.045s -user 0m0.027s -sys 0m0.019s +real 0m0.010s +user 0m0.004s +sys 0m0.007s =============================================================================== @@ -312,9 +865,9 @@ func Triangle(limit int) [][]int Triangle returns Pascal's Triangle for a given number. -real 0m0.147s -user 0m0.065s -sys 0m0.139s +real 0m0.040s +user 0m0.023s +sys 0m0.029s =============================================================================== diff --git a/go/perfect-numbers/benchstat-new.txt b/go/perfect-numbers/benchstat-new.txt index 8ea31fda..851df308 100644 --- a/go/perfect-numbers/benchstat-new.txt +++ b/go/perfect-numbers/benchstat-new.txt @@ -1,11 +1,11 @@ goos: linux goarch: amd64 pkg: perfect -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkClassify perfect_numbers_test.go:62: error encountered during benchmark perfect_numbers_test.go:62: error encountered during benchmark --- FAIL: BenchmarkClassify FAIL exit status 1 -FAIL perfect 1.155s +FAIL perfect 0.236s diff --git a/go/perfect-numbers/benchstat-old.txt b/go/perfect-numbers/benchstat-old.txt new file mode 100644 index 00000000..8ea31fda --- /dev/null +++ b/go/perfect-numbers/benchstat-old.txt @@ -0,0 +1,11 @@ +goos: linux +goarch: amd64 +pkg: perfect +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkClassify + perfect_numbers_test.go:62: error encountered during benchmark + perfect_numbers_test.go:62: error encountered during benchmark +--- FAIL: BenchmarkClassify +FAIL +exit status 1 +FAIL perfect 1.155s diff --git a/go/perfect-numbers/coverage.out b/go/perfect-numbers/coverage.out index c8f205b8..f862336a 100644 --- a/go/perfect-numbers/coverage.out +++ b/go/perfect-numbers/coverage.out @@ -5,20 +5,20 @@ perfect/perfect_numbers.go:30.31,31.54 1 2 perfect/perfect_numbers.go:32.29,33.52 1 2 perfect/perfect_numbers.go:34.10,35.38 1 0 perfect/perfect_numbers.go:43.53,44.17 1 20 -perfect/perfect_numbers.go:49.2,54.9 3 17 -perfect/perfect_numbers.go:63.2,63.15 1 0 perfect/perfect_numbers.go:44.17,46.3 1 3 +perfect/perfect_numbers.go:49.2,54.9 3 17 perfect/perfect_numbers.go:55.27,56.37 1 5 perfect/perfect_numbers.go:57.27,58.38 1 7 perfect/perfect_numbers.go:59.28,60.36 1 5 +perfect/perfect_numbers.go:63.2,63.15 1 0 perfect/perfect_numbers.go:67.33,68.23 1 18 -perfect/perfect_numbers.go:72.2,74.28 2 17 -perfect/perfect_numbers.go:78.2,78.12 1 17 perfect/perfect_numbers.go:68.23,70.3 1 1 +perfect/perfect_numbers.go:72.2,74.28 2 17 perfect/perfect_numbers.go:74.28,76.3 1 146 +perfect/perfect_numbers.go:78.2,78.12 1 17 perfect/perfect_numbers.go:83.36,84.17 1 19 -perfect/perfect_numbers.go:88.2,91.44 3 19 -perfect/perfect_numbers.go:97.2,97.16 1 19 perfect/perfect_numbers.go:84.17,86.3 1 0 +perfect/perfect_numbers.go:88.2,91.44 3 19 perfect/perfect_numbers.go:91.44,92.25 1 100651380 perfect/perfect_numbers.go:92.25,94.4 1 150 +perfect/perfect_numbers.go:97.2,97.16 1 19 diff --git a/go/perfect-numbers/run-tests-go.txt b/go/perfect-numbers/run-tests-go.txt index 67aecafb..622bdb19 100644 --- a/go/perfect-numbers/run-tests-go.txt +++ b/go/perfect-numbers/run-tests-go.txt @@ -5,85 +5,450 @@ Go packages: perfect =============================================================================== -golangci-lint run ./... +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m8.479s -user 0m17.131s -sys 0m3.091s +Running GoLangCi-Lint -=============================================================================== +Go version: -golint ./... + go version go1.21.0 linux/amd64 -real 0m0.051s -user 0m0.042s -sys 0m0.034s + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.009s +sys 0m0.014s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +perfect_numbers.go:1: line is 141 characters (lll) +// Package perfect is used to determinte the classification scheme of a number using Nicomachus' classification scheme for positive integers. +perfect_numbers.go:40:21: var-declaration: should omit type error from declaration of var ErrOnlyPositive; it will be inferred from the right-hand side (revive) +var ErrOnlyPositive error = errors.New("only positive errors") + ^ +perfect_numbers_test.go:16:28: Using the variable on range scope `tc` in function literal (scopelint) + actual, err := Classify(tc.input) + ^ +perfect_numbers_test.go:18:10: Using the variable on range scope `tc` in function literal (scopelint) + case !tc.ok: + ^ +perfect_numbers_test.go:21:55: Using the variable on range scope `tc` in function literal (scopelint) + t.Errorf("Classify(%d) expected error, got: %q", tc.input, actual) + ^ +perfect_numbers.go:89:2: declarations should never be cuddled (wsl) + var factor int64 + ^ +perfect_numbers_test.go:58:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +perfect_numbers_test.go:7:29: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if _, err := Classify(0); err != ErrOnlyPositive { + ^ +perfect_numbers.go:27:2: missing cases in switch of type perfect.Classification: perfect.Unknown (exhaustive) + switch c { + ^ +perfect_numbers.go:18:5: ClassificationNames is a global variable (gochecknoglobals) +var ClassificationNames = map[Classification]string{ + ^ +cases_test.go:8:5: classificationTestCases is a global variable (gochecknoglobals) +var classificationTestCases = []struct { + ^ +perfect_numbers_test.go:5:1: Function TestZeroGivesPositiveRequiredError missing the call to method parallel (paralleltest) +func TestZeroGivesPositiveRequiredError(t *testing.T) { +^ +perfect_numbers_test.go:13:1: Function TestClassifiesCorrectly missing the call to method parallel (paralleltest) +func TestClassifiesCorrectly(t *testing.T) { +^ +perfect_numbers_test.go:14:2: Range statement for test TestClassifiesCorrectly missing the call to method parallel in test Run (paralleltest) + for _, tc := range classificationTestCases { + ^ +perfect_numbers_test.go:34:1: Function TestClassificationsNotEqual missing the call to method parallel (paralleltest) +func TestClassificationsNotEqual(t *testing.T) { +^ +cases_test.go:1:9: package should be `perfect_test` instead of `perfect` (testpackage) +package perfect + ^ +perfect_numbers_examples_test.go:1:9: package should be `perfect_test` instead of `perfect` (testpackage) +package perfect + ^ +perfect_numbers_test.go:1:9: package should be `perfect_test` instead of `perfect` (testpackage) +package perfect + ^ +perfect_numbers_examples_test.go:6:2: variable name 'c' is too short for the scope of its usage (varnamelen) + c, _ := Classify(6) + ^ + +real 0m0.488s +user 0m0.743s +sys 0m0.488s + + + ============================================================================== + +Exit code: -1 + +real 0m0.518s +user 0m0.757s +sys 0m0.515s + +real 0m0.520s +user 0m0.758s +sys 0m0.517s =============================================================================== -revive -formatter=stylish ./... -perfect_numbers.go - (40, 21) https://revive.run/r#var-declaration should omit type error from declaration of var ErrOnlyPositive; it will be inferred from the right-hand side +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive +Go version: - ✖ 1 problem (0 errors) (1 warnings) + go version go1.21.0 linux/amd64 -real 0m0.043s + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.008s +sys 0m0.014s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.046s user 0m0.022s -sys 0m0.023s +sys 0m0.035s + + + ============================================================================== + +Exit code: 0 + +real 0m0.075s +user 0m0.037s +sys 0m0.058s + +real 0m0.077s +user 0m0.037s +sys 0m0.060s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.332s -user 0m0.375s -sys 0m0.354s +real 0m0.001s +user 0m0.001s +sys 0m0.000s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.018s +sys 0m0.018s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." +internal error: package "errors" without types was imported from "perfect" + +real 0m0.097s +user 0m0.134s +sys 0m0.110s + + + ============================================================================== -real 0m0.419s -user 0m0.470s -sys 0m0.408s +Exit code: -1 + +real 0m0.139s +user 0m0.163s +sys 0m0.140s + +real 0m0.142s +user 0m0.165s +sys 0m0.141s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.021s +sys 0m0.020s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + -real 0m0.572s -user 0m0.528s -sys 0m0.603s +real 0m0.164s +user 0m0.182s +sys 0m0.125s + + + ============================================================================== + +Exit code: 0 + +real 0m0.213s +user 0m0.209s +sys 0m0.163s + +real 0m0.215s +user 0m0.209s +sys 0m0.165s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.016s +user 0m0.008s +sys 0m0.012s + + + ============================================================================== -real 0m2.687s -user 0m4.634s -sys 0m1.219s +Running: gocritic check -enableAll ./... + + +real 0m0.798s +user 0m1.980s +sys 0m0.291s + + + ============================================================================== + +Exit code: 0 + +real 0m0.826s +user 0m1.992s +sys 0m0.316s + +real 0m0.827s +user 0m1.992s +sys 0m0.317s =============================================================================== -go vet ./... +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + -real 0m0.279s -user 0m0.321s -sys 0m0.270s +real 0m0.020s +user 0m0.007s +sys 0m0.017s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.076s +user 0m0.119s +sys 0m0.114s + + + ============================================================================== + +Exit code: 0 + +real 0m0.107s +user 0m0.132s +sys 0m0.140s + +real 0m0.109s +user 0m0.132s +sys 0m0.142s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.012s +sys 0m0.014s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.022s +user 0m0.014s +sys 0m0.014s + + + ============================================================================== + +Exit code: 0 + +real 0m0.059s +user 0m0.034s +sys 0m0.040s -real 0m0.101s -user 0m0.059s -sys 0m0.126s +real 0m0.060s +user 0m0.036s +sys 0m0.041s =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.006s +sys 0m0.021s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.471s +user 0m1.293s +sys 0m0.336s + + + ============================================================================== + +Exit code: 0 + +real 0m0.503s +user 0m1.308s +sys 0m0.364s + +real 0m0.505s +user 0m1.308s +sys 0m0.366s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.015s +sys 0m0.018s + + + ============================================================================== + +Running: gocyclo . + 6 perfect TestClassifiesCorrectly perfect_numbers_test.go:13:1 5 perfect BenchmarkClassify perfect_numbers_test.go:54:1 5 perfect Classify perfect_numbers.go:43:1 @@ -96,33 +461,139 @@ gocyclo . 1 perfect ExampleSum perfect_numbers_examples_test.go:29:1 1 perfect ExampleClassify perfect_numbers_examples_test.go:5:1 -real 0m0.023s -user 0m0.002s -sys 0m0.005s +real 0m0.003s +user 0m0.003s +sys 0m0.000s + + + ============================================================================== + +Exit code: 0 + +real 0m0.039s +user 0m0.024s +sys 0m0.028s + +real 0m0.041s +user 0m0.025s +sys 0m0.029s =============================================================================== -misspell . +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + -real 0m0.096s -user 0m0.116s -sys 0m0.049s + ============================================================================== + +Running: misspell . + + +real 0m0.033s +user 0m0.040s +sys 0m0.018s + + + ============================================================================== + +Exit code: 0 + +real 0m0.048s +user 0m0.048s +sys 0m0.032s + +real 0m0.051s +user 0m0.050s +sys 0m0.033s =============================================================================== -gosec ./... -[gosec] 2022/08/28 20:10:06 Including rules: default -[gosec] 2022/08/28 20:10:06 Excluding rules: default -[gosec] 2022/08/28 20:10:06 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/perfect-numbers -2022/08/28 20:10:06 internal error: package "errors" without types was imported from "command-line-arguments" +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== -real 0m0.378s -user 0m0.379s -sys 0m0.328s +Running: go clean ./... + + +real 0m0.036s +user 0m0.021s +sys 0m0.028s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:26:14 Including rules: default +[gosec] 2023/09/07 00:26:14 Excluding rules: default +[gosec] 2023/09/07 00:26:14 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/perfect-numbers +[gosec] 2023/09/07 00:26:14 Checking package: perfect +[gosec] 2023/09/07 00:26:14 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/perfect-numbers/perfect_numbers.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 98 + Nosec : 0 + Issues : 0 + + +real 0m0.127s +user 0m0.141s +sys 0m0.076s + + + ============================================================================== + +Exit code: 0 + +real 0m0.180s +user 0m0.171s +sys 0m0.118s + +real 0m0.184s +user 0m0.172s +sys 0m0.121s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.008s +sys 0m0.017s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestZeroGivesPositiveRequiredError === RUN TestZeroGivesPositiveRequiredError/GivesPositiveRequiredError --- PASS: TestZeroGivesPositiveRequiredError (0.00s) @@ -141,17 +612,17 @@ gotest -v -covermode=count -coverprofile coverage.out ./... === RUN TestClassifiesCorrectly/Edge_case_(no_factors_other_than_itself)_is_classified_correctly === RUN TestClassifiesCorrectly/Zero_is_rejected_(as_it_is_not_a_positive_integer) === RUN TestClassifiesCorrectly/Negative_integer_is_rejected_(as_it_is_not_a_positive_integer) ---- PASS: TestClassifiesCorrectly (1.12s) +--- PASS: TestClassifiesCorrectly (0.26s) --- PASS: TestClassifiesCorrectly/Smallest_perfect_number_is_classified_correctly (0.00s) --- PASS: TestClassifiesCorrectly/Medium_perfect_number_is_classified_correctly (0.00s) - --- PASS: TestClassifiesCorrectly/Large_perfect_number_is_classified_correctly (0.40s) + --- PASS: TestClassifiesCorrectly/Large_perfect_number_is_classified_correctly (0.08s) --- PASS: TestClassifiesCorrectly/Smallest_abundant_number_is_classified_correctly (0.00s) --- PASS: TestClassifiesCorrectly/Medium_abundant_number_is_classified_correctly (0.00s) - --- PASS: TestClassifiesCorrectly/Large_abundant_number_is_classified_correctly (0.34s) + --- PASS: TestClassifiesCorrectly/Large_abundant_number_is_classified_correctly (0.09s) --- PASS: TestClassifiesCorrectly/Smallest_prime_deficient_number_is_classified_correctly (0.00s) --- PASS: TestClassifiesCorrectly/Smallest_non-prime_deficient_number_is_classified_correctly (0.00s) --- PASS: TestClassifiesCorrectly/Medium_deficient_number_is_classified_correctly (0.00s) - --- PASS: TestClassifiesCorrectly/Large_deficient_number_is_classified_correctly (0.38s) + --- PASS: TestClassifiesCorrectly/Large_deficient_number_is_classified_correctly (0.09s) --- PASS: TestClassifiesCorrectly/Edge_case_(no_factors_other_than_itself)_is_classified_correctly (0.00s) --- PASS: TestClassifiesCorrectly/Zero_is_rejected_(as_it_is_not_a_positive_integer) (0.00s) --- PASS: TestClassifiesCorrectly/Negative_integer_is_rejected_(as_it_is_not_a_positive_integer) (0.00s) @@ -162,39 +633,46 @@ gotest -v -covermode=count -coverprofile coverage.out ./... === RUN ExampleSum --- PASS: ExampleSum (0.00s) === RUN ExampleFactors ---- PASS: ExampleFactors (0.01s) +--- PASS: ExampleFactors (0.00s) PASS coverage: 89.3% of statements -ok perfect 1.163s coverage: 89.3% of statements +ok perfect 0.260s coverage: 89.3% of statements -real 0m1.657s -user 0m1.731s -sys 0m0.440s +real 0m0.433s +user 0m0.474s +sys 0m0.164s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + perfect/perfect_numbers.go:26: String 80.0% perfect/perfect_numbers.go:43: Classify 88.9% perfect/perfect_numbers.go:67: Sum 100.0% perfect/perfect_numbers.go:83: Factors 87.5% total: (statements) 89.3% -real 0m0.193s -user 0m0.092s -sys 0m0.268s +real 0m0.039s +user 0m0.042s +sys 0m0.063s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.187s -user 0m0.105s -sys 0m0.289s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +real 0m0.037s +user 0m0.042s +sys 0m0.042s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt 26 func (c Classification) String() string { 27 switch c { @@ -252,13 +730,19 @@ gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annota 98 } -real 0m0.079s -user 0m0.029s -sys 0m0.075s +real 0m0.020s +user 0m0.012s +sys 0m0.015s -=============================================================================== +real 0m0.020s +user 0m0.012s +sys 0m0.015s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestZeroGivesPositiveRequiredError === RUN TestZeroGivesPositiveRequiredError/GivesPositiveRequiredError --- PASS: TestZeroGivesPositiveRequiredError (0.00s) @@ -277,17 +761,17 @@ gotest -v -race -covermode=atomic ./... === RUN TestClassifiesCorrectly/Edge_case_(no_factors_other_than_itself)_is_classified_correctly === RUN TestClassifiesCorrectly/Zero_is_rejected_(as_it_is_not_a_positive_integer) === RUN TestClassifiesCorrectly/Negative_integer_is_rejected_(as_it_is_not_a_positive_integer) ---- PASS: TestClassifiesCorrectly (14.65s) +--- PASS: TestClassifiesCorrectly (6.25s) --- PASS: TestClassifiesCorrectly/Smallest_perfect_number_is_classified_correctly (0.00s) --- PASS: TestClassifiesCorrectly/Medium_perfect_number_is_classified_correctly (0.00s) - --- PASS: TestClassifiesCorrectly/Large_perfect_number_is_classified_correctly (4.77s) + --- PASS: TestClassifiesCorrectly/Large_perfect_number_is_classified_correctly (2.08s) --- PASS: TestClassifiesCorrectly/Smallest_abundant_number_is_classified_correctly (0.00s) --- PASS: TestClassifiesCorrectly/Medium_abundant_number_is_classified_correctly (0.00s) - --- PASS: TestClassifiesCorrectly/Large_abundant_number_is_classified_correctly (4.90s) + --- PASS: TestClassifiesCorrectly/Large_abundant_number_is_classified_correctly (2.09s) --- PASS: TestClassifiesCorrectly/Smallest_prime_deficient_number_is_classified_correctly (0.00s) --- PASS: TestClassifiesCorrectly/Smallest_non-prime_deficient_number_is_classified_correctly (0.00s) --- PASS: TestClassifiesCorrectly/Medium_deficient_number_is_classified_correctly (0.00s) - --- PASS: TestClassifiesCorrectly/Large_deficient_number_is_classified_correctly (4.98s) + --- PASS: TestClassifiesCorrectly/Large_deficient_number_is_classified_correctly (2.08s) --- PASS: TestClassifiesCorrectly/Edge_case_(no_factors_other_than_itself)_is_classified_correctly (0.00s) --- PASS: TestClassifiesCorrectly/Zero_is_rejected_(as_it_is_not_a_positive_integer) (0.00s) --- PASS: TestClassifiesCorrectly/Negative_integer_is_rejected_(as_it_is_not_a_positive_integer) (0.00s) @@ -301,30 +785,46 @@ gotest -v -race -covermode=atomic ./... --- PASS: ExampleFactors (0.00s) PASS coverage: 89.3% of statements -ok perfect (cached) coverage: 89.3% of statements +ok perfect 7.267s coverage: 89.3% of statements -real 0m0.363s -user 0m0.409s -sys 0m0.375s +real 0m7.520s +user 0m6.591s +sys 0m0.197s + + + ============================================================================== + +Exit code: 0 + +real 0m8.082s +user 0m7.176s +sys 0m0.506s + +real 0m8.084s +user 0m7.177s +sys 0m0.507s =============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: perfect -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkClassify perfect_numbers_test.go:62: error encountered during benchmark perfect_numbers_test.go:62: error encountered during benchmark --- FAIL: BenchmarkClassify FAIL exit status 1 -FAIL perfect 1.155s +FAIL perfect 0.236s -real 0m1.782s -user 0m1.788s -sys 0m0.575s +real 0m0.437s +user 0m0.525s +sys 0m0.187s =============================================================================== @@ -347,17 +847,17 @@ gotest -v -tags bonus === RUN TestClassifiesCorrectly/Edge_case_(no_factors_other_than_itself)_is_classified_correctly === RUN TestClassifiesCorrectly/Zero_is_rejected_(as_it_is_not_a_positive_integer) === RUN TestClassifiesCorrectly/Negative_integer_is_rejected_(as_it_is_not_a_positive_integer) ---- PASS: TestClassifiesCorrectly (1.15s) +--- PASS: TestClassifiesCorrectly (0.24s) --- PASS: TestClassifiesCorrectly/Smallest_perfect_number_is_classified_correctly (0.00s) --- PASS: TestClassifiesCorrectly/Medium_perfect_number_is_classified_correctly (0.00s) - --- PASS: TestClassifiesCorrectly/Large_perfect_number_is_classified_correctly (0.39s) + --- PASS: TestClassifiesCorrectly/Large_perfect_number_is_classified_correctly (0.08s) --- PASS: TestClassifiesCorrectly/Smallest_abundant_number_is_classified_correctly (0.00s) --- PASS: TestClassifiesCorrectly/Medium_abundant_number_is_classified_correctly (0.00s) - --- PASS: TestClassifiesCorrectly/Large_abundant_number_is_classified_correctly (0.38s) + --- PASS: TestClassifiesCorrectly/Large_abundant_number_is_classified_correctly (0.08s) --- PASS: TestClassifiesCorrectly/Smallest_prime_deficient_number_is_classified_correctly (0.00s) --- PASS: TestClassifiesCorrectly/Smallest_non-prime_deficient_number_is_classified_correctly (0.00s) --- PASS: TestClassifiesCorrectly/Medium_deficient_number_is_classified_correctly (0.00s) - --- PASS: TestClassifiesCorrectly/Large_deficient_number_is_classified_correctly (0.37s) + --- PASS: TestClassifiesCorrectly/Large_deficient_number_is_classified_correctly (0.08s) --- PASS: TestClassifiesCorrectly/Edge_case_(no_factors_other_than_itself)_is_classified_correctly (0.00s) --- PASS: TestClassifiesCorrectly/Zero_is_rejected_(as_it_is_not_a_positive_integer) (0.00s) --- PASS: TestClassifiesCorrectly/Negative_integer_is_rejected_(as_it_is_not_a_positive_integer) (0.00s) @@ -370,23 +870,29 @@ gotest -v -tags bonus === RUN ExampleFactors --- PASS: ExampleFactors (0.00s) PASS -ok perfect 1.177s +ok perfect 0.239s -real 0m1.713s -user 0m1.747s -sys 0m0.529s +real 0m0.370s +user 0m0.383s +sys 0m0.107s =============================================================================== -No old benchmarks to run benchstat against. +benchstat benchstat-old.txt benchstat-new.txt +benchstat-old.txt:5: missing iteration count +benchstat-new.txt:5: missing iteration count + +real 0m0.002s +user 0m0.002s +sys 0m0.000s =============================================================================== gomarkdoc --output perfect-doc.md -real 0m0.037s -user 0m0.027s -sys 0m0.014s +real 0m0.011s +user 0m0.006s +sys 0m0.005s =============================================================================== @@ -441,9 +947,9 @@ func (c Classification) String() string String returns the lowercased classification name. -real 0m0.176s -user 0m0.074s -sys 0m0.187s +real 0m0.035s +user 0m0.022s +sys 0m0.024s =============================================================================== diff --git a/go/phone-number/benchstat-new.txt b/go/phone-number/benchstat-new.txt index 3b3f7a6b..24cc292e 100644 --- a/go/phone-number/benchstat-new.txt +++ b/go/phone-number/benchstat-new.txt @@ -1,9 +1,12 @@ goos: linux goarch: amd64 pkg: phonenumber -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkNumber-4 3166 767350 ns/op 219515 B/op 2160 allocs/op -BenchmarkAreaCode-4 1323 1006236 ns/op 259573 B/op 2490 allocs/op -BenchmarkFormat-4 1959 1054660 ns/op 263149 B/op 2525 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkNumber +BenchmarkNumber-8 6061 197555 ns/op 220289 B/op 2160 allocs/op +BenchmarkAreaCode +BenchmarkAreaCode-8 4852 239559 ns/op 260421 B/op 2490 allocs/op +BenchmarkFormat +BenchmarkFormat-8 4678 221805 ns/op 263819 B/op 2525 allocs/op PASS -ok phonenumber 7.047s +ok phonenumber 5.329s diff --git a/go/phone-number/benchstat-old.txt b/go/phone-number/benchstat-old.txt index 7bd9dac0..3b3f7a6b 100644 --- a/go/phone-number/benchstat-old.txt +++ b/go/phone-number/benchstat-old.txt @@ -2,8 +2,8 @@ goos: linux goarch: amd64 pkg: phonenumber cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkNumber-4 2082 754748 ns/op 219575 B/op 2160 allocs/op -BenchmarkAreaCode-4 1384 919541 ns/op 259687 B/op 2490 allocs/op -BenchmarkFormat-4 1719 862052 ns/op 263049 B/op 2525 allocs/op +BenchmarkNumber-4 3166 767350 ns/op 219515 B/op 2160 allocs/op +BenchmarkAreaCode-4 1323 1006236 ns/op 259573 B/op 2490 allocs/op +BenchmarkFormat-4 1959 1054660 ns/op 263149 B/op 2525 allocs/op PASS -ok phonenumber 4.653s +ok phonenumber 7.047s diff --git a/go/phone-number/coverage-annotations.txt b/go/phone-number/coverage-annotations.txt new file mode 100644 index 00000000..954f10e4 --- /dev/null +++ b/go/phone-number/coverage-annotations.txt @@ -0,0 +1,141 @@ + +138 func AreaCode(phoneNumber string) (string, error) { +139 // Get the digits from the input and input validation. +140 digits, eNum := Number(phoneNumber) +141 if eNum != nil { +142 return "", eNum +143 } +144 +145 // Get the first digit from the area code. +146 reStr := `^([[:digit:]]?)([[:digit:]]{3})([[:digit:]]{7})$` +147 re, e := regexp.Compile(reStr) +148 if e != nil { +149 MISS panic(e) +150 } +151 areaCode := re.ReplaceAllString(digits, `$2`) +152 +153 // Return the area code without an error. +154 return areaCode, nil +155 } + + +158 func Format(phoneNumber string) (string, error) { +159 // Get the digits from the input and input validation. +160 digits, eNum := Number(phoneNumber) +161 if eNum != nil { +162 return "", eNum +163 } +164 +165 // Get the phone number groups and format the number. +166 reStr := `^([[:digit:]]?)([[:digit:]]{3})([[:digit:]]{3})([[:digit:]]{4})$` +167 re, e := regexp.Compile(reStr) +168 if e != nil { +169 MISS panic(e) +170 } +171 fmtStr := re.ReplaceAllString(digits, `(${2}) ${3}-${4}`) +172 +173 // Return the formatted string without an error code. +174 return fmtStr, nil +175 } + + +113 func Number(phoneNumber string) (string, error) { +114 // Validate the input. +115 eVal := ValidateInput(phoneNumber) +116 if eVal != nil { +117 return "", eVal +118 } +119 +120 // Extract all the digits from the number. +121 reStr := `([[:space:]]|[[:punct:]]|[[:alpha:]]|[[:cntrl:]])` +122 re, e := regexp.Compile(reStr) +123 if e != nil { +124 MISS panic(e) +125 } +126 digits := re.ReplaceAllString(phoneNumber, ``) +127 +128 // Return the 10-dgit number (minus the contry code). +129 if len(digits) == 11 { +130 return digits[1:], nil +131 } +132 +133 // Return the 10-dgit number. +134 return digits, nil +135 } + + + 37 func ValidateInput(phoneNumber string) error { + 38 // Check the string for invalid characters. + 39 // Pointless since we can easily just remove them. + 40 reStrPunct := `[\]\[\|:;><,?/\\"'!@#$%&*^]` + 41 match, e := regexp.MatchString(reStrPunct, phoneNumber) + 42 if e != nil { + 43 MISS panic(e) + 44 } + 45 if match { + 46 return ErrContainsPunctuations + 47 } + 48 + 49 // Check to see if the phone number has letters in it. + 50 reStrLetters := `[[:alpha:]]` + 51 match, e = regexp.MatchString(reStrLetters, phoneNumber) + 52 if e != nil { + 53 MISS panic(e) + 54 } + 55 if match { + 56 return ErrContainsLetters + 57 } + 58 + 59 // Clean up the string. + 60 reStr := `([[:space:]]|[[:punct:]]|[[:alpha:]]|[[:cntrl:]])` + 61 re, e := regexp.Compile(reStr) + 62 if e != nil { + 63 MISS panic(e) + 64 } + 65 digits := re.ReplaceAllString(phoneNumber, ``) + 66 + 67 // Check the lenght of the remaining string. + 68 if len(digits) < 10 { + 69 return ErrNumOfDigits + 70 } + 71 if len(digits) > 11 { + 72 return ErrTooManyNumbers + 73 } + 74 + 75 // If it's an eleven digit number, make sure it starts with 1. + 76 if len(digits) == 11 && string(digits[0]) != "1" { + 77 return ErrElevenNotStartWithOne + 78 } + 79 + 80 // Check the starting digit of the area code. + 81 reStr = `^[[:digit:]]?([[:digit:]])[[:digit:]]{9}$` + 82 re, e = regexp.Compile(reStr) + 83 if e != nil { + 84 MISS panic(e) + 85 } + 86 digit := re.ReplaceAllString(digits, `$1`) + 87 if digit == "0" { + 88 return ErrAreaCodeStartsWithZero + 89 } + 90 if digit == "1" { + 91 return ErrAreaCodeStartsWithOne + 92 } + 93 + 94 // Check the starting digit of the exchange code. + 95 reStr = `^[[:digit:]]?[[:digit:]]{3}([[:digit:]])[[:digit:]]{6}$` + 96 re, e = regexp.Compile(reStr) + 97 if e != nil { + 98 MISS panic(e) + 99 } +100 digit = re.ReplaceAllString(digits, `$1`) +101 if digit == "0" { +102 return ErrExchangeCodeStartsWithZero +103 } +104 if digit == "1" { +105 return ErrExchangeCodeStartsWithOne +106 } +107 +108 // No errors found. +109 return nil +110 } + diff --git a/go/phone-number/coverage.out b/go/phone-number/coverage.out index 328954e8..d7487355 100644 --- a/go/phone-number/coverage.out +++ b/go/phone-number/coverage.out @@ -1,47 +1,47 @@ mode: count phonenumber/phone_number.go:37.46,42.14 3 66 -phonenumber/phone_number.go:45.2,45.11 1 66 -phonenumber/phone_number.go:50.2,52.14 3 63 -phonenumber/phone_number.go:55.2,55.11 1 63 -phonenumber/phone_number.go:60.2,62.14 3 60 -phonenumber/phone_number.go:65.2,68.22 2 60 -phonenumber/phone_number.go:71.2,71.22 1 57 -phonenumber/phone_number.go:76.2,76.51 1 54 -phonenumber/phone_number.go:81.2,83.14 3 51 -phonenumber/phone_number.go:86.2,87.18 2 51 -phonenumber/phone_number.go:90.2,90.18 1 45 -phonenumber/phone_number.go:95.2,97.14 3 39 -phonenumber/phone_number.go:100.2,101.18 2 39 -phonenumber/phone_number.go:104.2,104.18 1 33 -phonenumber/phone_number.go:109.2,109.12 1 27 phonenumber/phone_number.go:42.14,43.11 1 0 +phonenumber/phone_number.go:45.2,45.11 1 66 phonenumber/phone_number.go:45.11,47.3 1 3 +phonenumber/phone_number.go:50.2,52.14 3 63 phonenumber/phone_number.go:52.14,53.11 1 0 +phonenumber/phone_number.go:55.2,55.11 1 63 phonenumber/phone_number.go:55.11,57.3 1 3 +phonenumber/phone_number.go:60.2,62.14 3 60 phonenumber/phone_number.go:62.14,63.11 1 0 +phonenumber/phone_number.go:65.2,68.22 2 60 phonenumber/phone_number.go:68.22,70.3 1 3 +phonenumber/phone_number.go:71.2,71.22 1 57 phonenumber/phone_number.go:71.22,73.3 1 3 +phonenumber/phone_number.go:76.2,76.51 1 54 phonenumber/phone_number.go:76.51,78.3 1 3 +phonenumber/phone_number.go:81.2,83.14 3 51 phonenumber/phone_number.go:83.14,84.11 1 0 +phonenumber/phone_number.go:86.2,87.18 2 51 phonenumber/phone_number.go:87.18,89.3 1 6 +phonenumber/phone_number.go:90.2,90.18 1 45 phonenumber/phone_number.go:90.18,92.3 1 6 +phonenumber/phone_number.go:95.2,97.14 3 39 phonenumber/phone_number.go:97.14,98.11 1 0 +phonenumber/phone_number.go:100.2,101.18 2 39 phonenumber/phone_number.go:101.18,103.3 1 6 +phonenumber/phone_number.go:104.2,104.18 1 33 phonenumber/phone_number.go:104.18,106.3 1 6 +phonenumber/phone_number.go:109.2,109.12 1 27 phonenumber/phone_number.go:113.49,116.17 2 66 -phonenumber/phone_number.go:121.2,123.14 3 27 -phonenumber/phone_number.go:126.2,129.23 2 27 -phonenumber/phone_number.go:134.2,134.20 1 15 phonenumber/phone_number.go:116.17,118.3 1 39 +phonenumber/phone_number.go:121.2,123.14 3 27 phonenumber/phone_number.go:123.14,124.11 1 0 +phonenumber/phone_number.go:126.2,129.23 2 27 phonenumber/phone_number.go:129.23,131.3 1 12 +phonenumber/phone_number.go:134.2,134.20 1 15 phonenumber/phone_number.go:138.51,141.17 2 22 -phonenumber/phone_number.go:146.2,148.14 3 9 -phonenumber/phone_number.go:151.2,154.22 2 9 phonenumber/phone_number.go:141.17,143.3 1 13 +phonenumber/phone_number.go:146.2,148.14 3 9 phonenumber/phone_number.go:148.14,149.11 1 0 +phonenumber/phone_number.go:151.2,154.22 2 9 phonenumber/phone_number.go:158.49,161.17 2 22 -phonenumber/phone_number.go:166.2,168.14 3 9 -phonenumber/phone_number.go:171.2,174.20 2 9 phonenumber/phone_number.go:161.17,163.3 1 13 +phonenumber/phone_number.go:166.2,168.14 3 9 phonenumber/phone_number.go:168.14,169.11 1 0 +phonenumber/phone_number.go:171.2,174.20 2 9 diff --git a/go/phone-number/phonenumber-doc.md b/go/phone-number/phonenumber-doc.md index 41ab31e8..c71dde1e 100755 --- a/go/phone-number/phonenumber-doc.md +++ b/go/phone-number/phonenumber-doc.md @@ -6,7 +6,7 @@ import "phonenumber" ``` -Package phonenumber used to clean up NANP \(North American Numbering Plan\) phone numbers\. +Package phonenumber used to clean up NANP \(North American Numbering Plan\) phone numbers. ## Index @@ -19,55 +19,55 @@ Package phonenumber used to clean up NANP \(North American Numbering Plan\) phon ## Variables -ErrAreaCodeStartsWithOne is an error used when area codes start with one\. +ErrAreaCodeStartsWithOne is an error used when area codes start with one. ```go var ErrAreaCodeStartsWithOne = errors.New("area code cannot start with one") ``` -ErrAreaCodeStartsWithZero is an error used when area codes start with zero\. +ErrAreaCodeStartsWithZero is an error used when area codes start with zero. ```go var ErrAreaCodeStartsWithZero = errors.New("area code cannot start with zero") ``` -ErrContainsLetters is an error used when the phone number has letters in it\. +ErrContainsLetters is an error used when the phone number has letters in it. ```go var ErrContainsLetters = errors.New("letters not permitted") ``` -ErrContainsPunctuations is an error used when the phone number has punctuation in it\. +ErrContainsPunctuations is an error used when the phone number has punctuation in it. ```go var ErrContainsPunctuations = errors.New("punctuations not permitted") ``` -ErrElevenNotStartWithOne is an error used when the phone number has 11 digits and it doesn't start with one\. +ErrElevenNotStartWithOne is an error used when the phone number has 11 digits and it doesn't start with one. ```go var ErrElevenNotStartWithOne = errors.New("11 digits must start with 1") ``` -ErrExchangeCodeStartsWithOne is an error used when exchange codes start with one\. +ErrExchangeCodeStartsWithOne is an error used when exchange codes start with one. ```go var ErrExchangeCodeStartsWithOne = errors.New("exchange code cannot start with one") ``` -ErrExchangeCodeStartsWithZero is an error used when exchange codes start with zero\. +ErrExchangeCodeStartsWithZero is an error used when exchange codes start with zero. ```go var ErrExchangeCodeStartsWithZero = errors.New("exchange code cannot start with zero") ``` -ErrNumOfDigits is an error used when the phone number has less than 10 digits\. +ErrNumOfDigits is an error used when the phone number has less than 10 digits. ```go var ErrNumOfDigits = errors.New("incorrect number of digits") ``` -ErrTooManyNumbers is an error used when the phone number has more than 11 digits\. +ErrTooManyNumbers is an error used when the phone number has more than 11 digits. ```go var ErrTooManyNumbers = errors.New("more than 11 digits") @@ -79,7 +79,7 @@ var ErrTooManyNumbers = errors.New("more than 11 digits") func AreaCode(phoneNumber string) (string, error) ``` -AreaCode returns the area code from a phone number\. +AreaCode returns the area code from a phone number.

Example

@@ -112,7 +112,7 @@ AreaCode returns the area code from a phone number\. func Format(phoneNumber string) (string, error) ``` -Format returns a pretty phone number\. +Format returns a pretty phone number.

Example

@@ -145,7 +145,7 @@ Format returns a pretty phone number\. func Number(phoneNumber string) (string, error) ``` -Number returns just the digits of the passed phone number\. +Number returns just the digits of the passed phone number.

Example

@@ -178,7 +178,7 @@ Number returns just the digits of the passed phone number\. func ValidateInput(phoneNumber string) error ``` -ValidateInput returns an error if the phone number has invalid data in it\. +ValidateInput returns an error if the phone number has invalid data in it. diff --git a/go/phone-number/phonenumber-doc.txt b/go/phone-number/phonenumber-doc.txt index 244a4c5a..ef9e00a3 100644 --- a/go/phone-number/phonenumber-doc.txt +++ b/go/phone-number/phonenumber-doc.txt @@ -1,7 +1,7 @@ package phonenumber // import "phonenumber" -Package phonenumber used to clean up NANP (North American Numbering Plan) -phone numbers. +Package phonenumber used to clean up NANP (North American Numbering Plan) phone +numbers. VARIABLES diff --git a/go/phone-number/run-tests-go.txt b/go/phone-number/run-tests-go.txt index 9abbe70d..d518f733 100644 --- a/go/phone-number/run-tests-go.txt +++ b/go/phone-number/run-tests-go.txt @@ -5,15 +5,651 @@ Go packages: phonenumber =============================================================================== -golint phonenumber +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.015s +sys 0m0.028s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +phone_number_test.go:17:10: Error return value is not checked (errcheck) + Number(test.input) + ^ +phone_number_test.go:32:12: Error return value is not checked (errcheck) + AreaCode(test.input) + ^ +phone_number_test.go:47:10: Error return value is not checked (errcheck) + Format(test.input) + ^ +phone_number.go:37: Function 'ValidateInput' has too many statements (42 > 40) (funlen) +func ValidateInput(phoneNumber string) error { +phone_number.go:67:15: `lenght` is a misspelling of `length` (misspell) + // Check the lenght of the remaining string. + ^ +phone_number_test.go:60:27: Using the variable on range scope `tc` in function literal (scopelint) + actual, actualErr := f(tc.input) + ^ +phone_number_test.go:62:9: Using the variable on range scope `tc` in function literal (scopelint) + case tc.expectErr: + ^ +phone_number_test.go:64:59: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("%s(%q) expected error, got: %q", funcName, tc.input, actual) + ^ +phone_number.go:42:2: only one cuddle assignment allowed before if statement (wsl) + if e != nil { + ^ +phone_number.go:45:2: if statements should only be cuddled with assignments (wsl) + if match { + ^ +phone_number.go:52:2: only one cuddle assignment allowed before if statement (wsl) + if e != nil { + ^ +phone_number.go:55:2: if statements should only be cuddled with assignments (wsl) + if match { + ^ +phone_number.go:62:2: only one cuddle assignment allowed before if statement (wsl) + if e != nil { + ^ +phone_number.go:65:2: assignments should only be cuddled with other assignments (wsl) + digits := re.ReplaceAllString(phoneNumber, ``) + ^ +phone_number.go:71:2: if statements should only be cuddled with assignments (wsl) + if len(digits) > 11 { + ^ +phone_number.go:86:2: assignments should only be cuddled with other assignments (wsl) + digit := re.ReplaceAllString(digits, `$1`) + ^ +phone_number.go:100:2: assignments should only be cuddled with other assignments (wsl) + digit = re.ReplaceAllString(digits, `$1`) + ^ +phone_number_test.go:15:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +phone_number_test.go:30:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +phone_number_test.go:45:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:15:5: testCases is a global variable (gochecknoglobals) +var testCases = []testCase{ + ^ +phone_number.go:68:19: mnd: Magic number: 10, in detected (gomnd) + if len(digits) < 10 { + ^ +phone_number.go:129:20: mnd: Magic number: 11, in detected (gomnd) + if len(digits) == 11 { + ^ +phone_number_test.go:7:1: Function TestNumber missing the call to method parallel (paralleltest) +func TestNumber(t *testing.T) { +^ +phone_number_test.go:22:1: Function TestAreaCode missing the call to method parallel (paralleltest) +func TestAreaCode(t *testing.T) { +^ +phone_number_test.go:37:1: Function TestFormat missing the call to method parallel (paralleltest) +func TestFormat(t *testing.T) { +^ +cases_test.go:1:9: package should be `phonenumber_test` instead of `phonenumber` (testpackage) +package phonenumber + ^ +phone_number_examples_test.go:1:9: package should be `phonenumber_test` instead of `phonenumber` (testpackage) +package phonenumber + ^ +phone_number_test.go:1:9: package should be `phonenumber_test` instead of `phonenumber` (testpackage) +package phonenumber + ^ +phone_number_test.go:52:6: parameter *testing.T should be the first or after context.Context (thelper) +func runTests( + ^ +phone_number_test.go:58:6: variable name 'tc' is too short for the scope of its usage (varnamelen) + for _, tc := range testCases { + ^ +phone_number.go:41:2: variable name 'e' is too short for the scope of its usage (varnamelen) + match, e := regexp.MatchString(reStrPunct, phoneNumber) + ^ +phone_number.go:61:2: variable name 're' is too short for the scope of its usage (varnamelen) + re, e := regexp.Compile(reStr) + ^ +phone_number_test.go:54:2: parameter name 'f' is too short for the scope of its usage (varnamelen) + f func(s string) (string, error), + ^ + +real 0m0.528s +user 0m0.826s +sys 0m0.507s + + + ============================================================================== + +Exit code: -1 + +real 0m0.567s +user 0m0.847s +sys 0m0.549s + +real 0m0.571s +user 0m0.851s +sys 0m0.549s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.021s +sys 0m0.023s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.060s +user 0m0.038s +sys 0m0.038s + + + ============================================================================== + +Exit code: 0 + +real 0m0.097s +user 0m0.066s +sys 0m0.071s + +real 0m0.099s +user 0m0.067s +sys 0m0.072s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.019s +sys 0m0.021s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "errors" without types was imported from "phonenumber" + +real 0m0.097s +user 0m0.122s +sys 0m0.143s + + + ============================================================================== + +Exit code: -1 + +real 0m0.131s +user 0m0.146s +sys 0m0.175s + +real 0m0.133s +user 0m0.147s +sys 0m0.176s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.016s +sys 0m0.023s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.190s +user 0m0.278s +sys 0m0.126s + + + ============================================================================== + +Exit code: 0 + +real 0m0.223s +user 0m0.300s +sys 0m0.157s + +real 0m0.225s +user 0m0.300s +sys 0m0.159s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.017s +sys 0m0.027s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.845s +user 0m2.070s +sys 0m0.312s + + + ============================================================================== + +Exit code: 0 + +real 0m0.887s +user 0m2.093s +sys 0m0.356s + +real 0m0.890s +user 0m2.095s +sys 0m0.357s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.023s +sys 0m0.021s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.085s +user 0m0.123s +sys 0m0.100s + + + ============================================================================== + +Exit code: 0 + +real 0m0.123s +user 0m0.154s +sys 0m0.131s + +real 0m0.124s +user 0m0.155s +sys 0m0.132s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.011s +sys 0m0.023s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.022s +user 0m0.017s +sys 0m0.016s + + + ============================================================================== + +Exit code: 0 + +real 0m0.054s +user 0m0.035s +sys 0m0.048s + +real 0m0.057s +user 0m0.036s +sys 0m0.049s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.013s +sys 0m0.017s + + + ============================================================================== + +Running: errcheck ./... + +phone_number_test.go:17:10: Number(test.input) +phone_number_test.go:32:12: AreaCode(test.input) +phone_number_test.go:47:10: Format(test.input) + +real 0m0.462s +user 0m1.485s +sys 0m0.283s + + + ============================================================================== + +Exit code: -1 + +real 0m0.495s +user 0m1.503s +sys 0m0.311s + +real 0m0.497s +user 0m1.503s +sys 0m0.312s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.017s +sys 0m0.012s + + + ============================================================================== + +Running: gocyclo . + +16 phonenumber ValidateInput phone_number.go:37:1 +6 phonenumber runTests phone_number_test.go:52:1 +4 phonenumber BenchmarkFormat phone_number_test.go:41:1 +4 phonenumber BenchmarkAreaCode phone_number_test.go:26:1 +4 phonenumber BenchmarkNumber phone_number_test.go:11:1 +4 phonenumber Number phone_number.go:113:1 +3 phonenumber Format phone_number.go:158:1 +3 phonenumber AreaCode phone_number.go:138:1 +1 phonenumber TestFormat phone_number_test.go:37:1 +1 phonenumber TestAreaCode phone_number_test.go:22:1 +1 phonenumber TestNumber phone_number_test.go:7:1 +1 phonenumber ExampleFormat phone_number_examples_test.go:31:1 +1 phonenumber ExampleAreaCode phone_number_examples_test.go:19:1 +1 phonenumber ExampleNumber phone_number_examples_test.go:7:1 + +real 0m0.002s +user 0m0.001s +sys 0m0.001s + + + ============================================================================== + +Exit code: 0 + +real 0m0.032s +user 0m0.026s +sys 0m0.021s + +real 0m0.034s +user 0m0.027s +sys 0m0.021s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + +phone_number.go:67:14: "lenght" is a misspelling of "length" +run-tests-go.txt:52:24: "lenght" is a misspelling of "length" +run-tests-go.txt:53:14: "lenght" is a misspelling of "length" +run-tests-go.txt:547:24: "lenght" is a misspelling of "length" +coverage.html:147:21: "lenght" is a misspelling of "length" + +real 0m0.026s +user 0m0.031s +sys 0m0.013s + + + ============================================================================== + +Exit code: 0 + +real 0m0.036s +user 0m0.038s +sys 0m0.019s + +real 0m0.038s +user 0m0.039s +sys 0m0.021s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 -real 0m0.154s -user 0m0.184s -sys 0m0.165s + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.011s +sys 0m0.020s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:26:25 Including rules: default +[gosec] 2023/09/07 00:26:25 Excluding rules: default +[gosec] 2023/09/07 00:26:25 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/phone-number +[gosec] 2023/09/07 00:26:25 Checking package: phonenumber +[gosec] 2023/09/07 00:26:25 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/phone-number/phone_number.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 175 + Nosec : 0 + Issues : 0 + + +real 0m0.118s +user 0m0.128s +sys 0m0.095s + + + ============================================================================== + +Exit code: 0 + +real 0m0.148s +user 0m0.142s +sys 0m0.125s + +real 0m0.150s +user 0m0.144s +sys 0m0.126s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out phonenumber +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.024s +sys 0m0.019s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestNumber === RUN TestNumber/cleans_the_number === RUN TestNumber/cleans_numbers_with_dots @@ -33,7 +669,7 @@ go test -v -covermode=count -coverprofile coverage.out phonenumber === RUN TestNumber/invalid_if_area_code_starts_with_1_on_valid_11-digit_number === RUN TestNumber/invalid_if_exchange_code_starts_with_0_on_valid_11-digit_number === RUN TestNumber/invalid_if_exchange_code_starts_with_1_on_valid_11-digit_number ---- PASS: TestNumber (0.01s) +--- PASS: TestNumber (0.00s) --- PASS: TestNumber/cleans_the_number (0.00s) --- PASS: TestNumber/cleans_numbers_with_dots (0.00s) --- PASS: TestNumber/cleans_numbers_with_multiple_spaces (0.00s) @@ -71,9 +707,9 @@ go test -v -covermode=count -coverprofile coverage.out phonenumber === RUN TestAreaCode/invalid_if_area_code_starts_with_1_on_valid_11-digit_number === RUN TestAreaCode/invalid_if_exchange_code_starts_with_0_on_valid_11-digit_number === RUN TestAreaCode/invalid_if_exchange_code_starts_with_1_on_valid_11-digit_number ---- PASS: TestAreaCode (0.01s) +--- PASS: TestAreaCode (0.00s) --- PASS: TestAreaCode/cleans_the_number (0.00s) - --- PASS: TestAreaCode/cleans_numbers_with_dots (0.01s) + --- PASS: TestAreaCode/cleans_numbers_with_dots (0.00s) --- PASS: TestAreaCode/cleans_numbers_with_multiple_spaces (0.00s) --- PASS: TestAreaCode/invalid_when_9_digits (0.00s) --- PASS: TestAreaCode/invalid_when_11_digits_does_not_start_with_a_1 (0.00s) @@ -136,36 +772,198 @@ go test -v -covermode=count -coverprofile coverage.out phonenumber --- PASS: ExampleFormat (0.00s) PASS coverage: 88.7% of statements -ok phonenumber 0.034s coverage: 88.7% of statements +ok phonenumber 0.006s coverage: 88.7% of statements -real 0m0.728s -user 0m0.792s -sys 0m0.612s +real 0m0.183s +user 0m0.238s +sys 0m0.157s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + phonenumber/phone_number.go:37: ValidateInput 88.1% phonenumber/phone_number.go:113: Number 90.9% phonenumber/phone_number.go:138: AreaCode 88.9% phonenumber/phone_number.go:158: Format 88.9% total: (statements) 88.7% -real 0m0.189s -user 0m0.169s -sys 0m0.204s - -=============================================================================== - -go tool cover -html coverage.out -o coverage.html - -real 0m0.216s -user 0m0.206s -sys 0m0.216s - -=============================================================================== +real 0m0.048s +user 0m0.062s +sys 0m0.068s + + + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.038s +user 0m0.048s +sys 0m0.047s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +138 func AreaCode(phoneNumber string) (string, error) { +139 // Get the digits from the input and input validation. +140 digits, eNum := Number(phoneNumber) +141 if eNum != nil { +142 return "", eNum +143 } +144 +145 // Get the first digit from the area code. +146 reStr := `^([[:digit:]]?)([[:digit:]]{3})([[:digit:]]{7})$` +147 re, e := regexp.Compile(reStr) +148 if e != nil { +149 MISS panic(e) +150 } +151 areaCode := re.ReplaceAllString(digits, `$2`) +152 +153 // Return the area code without an error. +154 return areaCode, nil +155 } + + +158 func Format(phoneNumber string) (string, error) { +159 // Get the digits from the input and input validation. +160 digits, eNum := Number(phoneNumber) +161 if eNum != nil { +162 return "", eNum +163 } +164 +165 // Get the phone number groups and format the number. +166 reStr := `^([[:digit:]]?)([[:digit:]]{3})([[:digit:]]{3})([[:digit:]]{4})$` +167 re, e := regexp.Compile(reStr) +168 if e != nil { +169 MISS panic(e) +170 } +171 fmtStr := re.ReplaceAllString(digits, `(${2}) ${3}-${4}`) +172 +173 // Return the formatted string without an error code. +174 return fmtStr, nil +175 } + + +113 func Number(phoneNumber string) (string, error) { +114 // Validate the input. +115 eVal := ValidateInput(phoneNumber) +116 if eVal != nil { +117 return "", eVal +118 } +119 +120 // Extract all the digits from the number. +121 reStr := `([[:space:]]|[[:punct:]]|[[:alpha:]]|[[:cntrl:]])` +122 re, e := regexp.Compile(reStr) +123 if e != nil { +124 MISS panic(e) +125 } +126 digits := re.ReplaceAllString(phoneNumber, ``) +127 +128 // Return the 10-dgit number (minus the contry code). +129 if len(digits) == 11 { +130 return digits[1:], nil +131 } +132 +133 // Return the 10-dgit number. +134 return digits, nil +135 } + + + 37 func ValidateInput(phoneNumber string) error { + 38 // Check the string for invalid characters. + 39 // Pointless since we can easily just remove them. + 40 reStrPunct := `[\]\[\|:;><,?/\\"'!@#$%&*^]` + 41 match, e := regexp.MatchString(reStrPunct, phoneNumber) + 42 if e != nil { + 43 MISS panic(e) + 44 } + 45 if match { + 46 return ErrContainsPunctuations + 47 } + 48 + 49 // Check to see if the phone number has letters in it. + 50 reStrLetters := `[[:alpha:]]` + 51 match, e = regexp.MatchString(reStrLetters, phoneNumber) + 52 if e != nil { + 53 MISS panic(e) + 54 } + 55 if match { + 56 return ErrContainsLetters + 57 } + 58 + 59 // Clean up the string. + 60 reStr := `([[:space:]]|[[:punct:]]|[[:alpha:]]|[[:cntrl:]])` + 61 re, e := regexp.Compile(reStr) + 62 if e != nil { + 63 MISS panic(e) + 64 } + 65 digits := re.ReplaceAllString(phoneNumber, ``) + 66 + 67 // Check the lenght of the remaining string. + 68 if len(digits) < 10 { + 69 return ErrNumOfDigits + 70 } + 71 if len(digits) > 11 { + 72 return ErrTooManyNumbers + 73 } + 74 + 75 // If it's an eleven digit number, make sure it starts with 1. + 76 if len(digits) == 11 && string(digits[0]) != "1" { + 77 return ErrElevenNotStartWithOne + 78 } + 79 + 80 // Check the starting digit of the area code. + 81 reStr = `^[[:digit:]]?([[:digit:]])[[:digit:]]{9}$` + 82 re, e = regexp.Compile(reStr) + 83 if e != nil { + 84 MISS panic(e) + 85 } + 86 digit := re.ReplaceAllString(digits, `$1`) + 87 if digit == "0" { + 88 return ErrAreaCodeStartsWithZero + 89 } + 90 if digit == "1" { + 91 return ErrAreaCodeStartsWithOne + 92 } + 93 + 94 // Check the starting digit of the exchange code. + 95 reStr = `^[[:digit:]]?[[:digit:]]{3}([[:digit:]])[[:digit:]]{6}$` + 96 re, e = regexp.Compile(reStr) + 97 if e != nil { + 98 MISS panic(e) + 99 } +100 digit = re.ReplaceAllString(digits, `$1`) +101 if digit == "0" { +102 return ErrExchangeCodeStartsWithZero +103 } +104 if digit == "1" { +105 return ErrExchangeCodeStartsWithOne +106 } +107 +108 // No errors found. +109 return nil +110 } + + +real 0m0.018s +user 0m0.013s +sys 0m0.017s + +real 0m0.018s +user 0m0.013s +sys 0m0.017s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -go test -v -race -covermode=atomic phonenumber === RUN TestNumber === RUN TestNumber/cleans_the_number === RUN TestNumber/cleans_numbers_with_dots @@ -185,13 +983,13 @@ go test -v -race -covermode=atomic phonenumber === RUN TestNumber/invalid_if_area_code_starts_with_1_on_valid_11-digit_number === RUN TestNumber/invalid_if_exchange_code_starts_with_0_on_valid_11-digit_number === RUN TestNumber/invalid_if_exchange_code_starts_with_1_on_valid_11-digit_number ---- PASS: TestNumber (0.05s) +--- PASS: TestNumber (0.01s) --- PASS: TestNumber/cleans_the_number (0.00s) --- PASS: TestNumber/cleans_numbers_with_dots (0.00s) - --- PASS: TestNumber/cleans_numbers_with_multiple_spaces (0.01s) + --- PASS: TestNumber/cleans_numbers_with_multiple_spaces (0.00s) --- PASS: TestNumber/invalid_when_9_digits (0.00s) --- PASS: TestNumber/invalid_when_11_digits_does_not_start_with_a_1 (0.00s) - --- PASS: TestNumber/valid_when_11_digits_and_starting_with_1 (0.01s) + --- PASS: TestNumber/valid_when_11_digits_and_starting_with_1 (0.00s) --- PASS: TestNumber/valid_when_11_digits_and_starting_with_1_even_with_punctuation (0.00s) --- PASS: TestNumber/invalid_when_more_than_11_digits (0.00s) --- PASS: TestNumber/invalid_with_letters (0.00s) @@ -223,7 +1021,7 @@ go test -v -race -covermode=atomic phonenumber === RUN TestAreaCode/invalid_if_area_code_starts_with_1_on_valid_11-digit_number === RUN TestAreaCode/invalid_if_exchange_code_starts_with_0_on_valid_11-digit_number === RUN TestAreaCode/invalid_if_exchange_code_starts_with_1_on_valid_11-digit_number ---- PASS: TestAreaCode (0.03s) +--- PASS: TestAreaCode (0.01s) --- PASS: TestAreaCode/cleans_the_number (0.00s) --- PASS: TestAreaCode/cleans_numbers_with_dots (0.00s) --- PASS: TestAreaCode/cleans_numbers_with_multiple_spaces (0.00s) @@ -241,7 +1039,7 @@ go test -v -race -covermode=atomic phonenumber --- PASS: TestAreaCode/invalid_if_area_code_starts_with_0_on_valid_11-digit_number (0.00s) --- PASS: TestAreaCode/invalid_if_area_code_starts_with_1_on_valid_11-digit_number (0.00s) --- PASS: TestAreaCode/invalid_if_exchange_code_starts_with_0_on_valid_11-digit_number (0.00s) - --- PASS: TestAreaCode/invalid_if_exchange_code_starts_with_1_on_valid_11-digit_number (0.01s) + --- PASS: TestAreaCode/invalid_if_exchange_code_starts_with_1_on_valid_11-digit_number (0.00s) === RUN TestFormat === RUN TestFormat/cleans_the_number === RUN TestFormat/cleans_numbers_with_dots @@ -261,9 +1059,9 @@ go test -v -race -covermode=atomic phonenumber === RUN TestFormat/invalid_if_area_code_starts_with_1_on_valid_11-digit_number === RUN TestFormat/invalid_if_exchange_code_starts_with_0_on_valid_11-digit_number === RUN TestFormat/invalid_if_exchange_code_starts_with_1_on_valid_11-digit_number ---- PASS: TestFormat (0.04s) - --- PASS: TestFormat/cleans_the_number (0.01s) - --- PASS: TestFormat/cleans_numbers_with_dots (0.01s) +--- PASS: TestFormat (0.01s) + --- PASS: TestFormat/cleans_the_number (0.00s) + --- PASS: TestFormat/cleans_numbers_with_dots (0.00s) --- PASS: TestFormat/cleans_numbers_with_multiple_spaces (0.00s) --- PASS: TestFormat/invalid_when_9_digits (0.00s) --- PASS: TestFormat/invalid_when_11_digits_does_not_start_with_a_1 (0.00s) @@ -272,7 +1070,7 @@ go test -v -race -covermode=atomic phonenumber --- PASS: TestFormat/invalid_when_more_than_11_digits (0.00s) --- PASS: TestFormat/invalid_with_letters (0.00s) --- PASS: TestFormat/invalid_with_punctuations (0.00s) - --- PASS: TestFormat/invalid_if_area_code_starts_with_0 (0.01s) + --- PASS: TestFormat/invalid_if_area_code_starts_with_0 (0.00s) --- PASS: TestFormat/invalid_if_area_code_starts_with_1 (0.00s) --- PASS: TestFormat/invalid_if_exchange_code_starts_with_0 (0.00s) --- PASS: TestFormat/invalid_if_exchange_code_starts_with_1 (0.00s) @@ -283,118 +1081,261 @@ go test -v -race -covermode=atomic phonenumber === RUN ExampleNumber --- PASS: ExampleNumber (0.00s) === RUN ExampleAreaCode ---- PASS: ExampleAreaCode (0.01s) +--- PASS: ExampleAreaCode (0.00s) === RUN ExampleFormat ---- PASS: ExampleFormat (0.01s) +--- PASS: ExampleFormat (0.00s) PASS coverage: 88.7% of statements -ok phonenumber 0.166s coverage: 88.7% of statements +ok phonenumber 1.039s coverage: 88.7% of statements + +real 0m1.288s +user 0m0.324s +sys 0m0.172s + + + ============================================================================== + +Exit code: 0 + +real 0m1.615s +user 0m0.715s +sys 0m0.493s -real 0m0.915s -user 0m0.971s -sys 0m0.657s +real 0m1.618s +user 0m0.717s +sys 0m0.493s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: phonenumber -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkNumber-4 3166 767350 ns/op 219515 B/op 2160 allocs/op -BenchmarkAreaCode-4 1323 1006236 ns/op 259573 B/op 2490 allocs/op -BenchmarkFormat-4 1959 1054660 ns/op 263149 B/op 2525 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkNumber +BenchmarkNumber-8 6061 197555 ns/op 220289 B/op 2160 allocs/op +BenchmarkAreaCode +BenchmarkAreaCode-8 4852 239559 ns/op 260421 B/op 2490 allocs/op +BenchmarkFormat +BenchmarkFormat-8 4678 221805 ns/op 263819 B/op 2525 allocs/op PASS -ok phonenumber 7.047s +ok phonenumber 5.329s -real 0m7.570s -user 0m12.020s -sys 0m1.688s +real 0m5.475s +user 0m5.823s +sys 0m0.365s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestNumber +=== RUN TestNumber/cleans_the_number +=== RUN TestNumber/cleans_numbers_with_dots +=== RUN TestNumber/cleans_numbers_with_multiple_spaces +=== RUN TestNumber/invalid_when_9_digits +=== RUN TestNumber/invalid_when_11_digits_does_not_start_with_a_1 +=== RUN TestNumber/valid_when_11_digits_and_starting_with_1 +=== RUN TestNumber/valid_when_11_digits_and_starting_with_1_even_with_punctuation +=== RUN TestNumber/invalid_when_more_than_11_digits +=== RUN TestNumber/invalid_with_letters +=== RUN TestNumber/invalid_with_punctuations +=== RUN TestNumber/invalid_if_area_code_starts_with_0 +=== RUN TestNumber/invalid_if_area_code_starts_with_1 +=== RUN TestNumber/invalid_if_exchange_code_starts_with_0 +=== RUN TestNumber/invalid_if_exchange_code_starts_with_1 +=== RUN TestNumber/invalid_if_area_code_starts_with_0_on_valid_11-digit_number +=== RUN TestNumber/invalid_if_area_code_starts_with_1_on_valid_11-digit_number +=== RUN TestNumber/invalid_if_exchange_code_starts_with_0_on_valid_11-digit_number +=== RUN TestNumber/invalid_if_exchange_code_starts_with_1_on_valid_11-digit_number +--- PASS: TestNumber (0.00s) + --- PASS: TestNumber/cleans_the_number (0.00s) + --- PASS: TestNumber/cleans_numbers_with_dots (0.00s) + --- PASS: TestNumber/cleans_numbers_with_multiple_spaces (0.00s) + --- PASS: TestNumber/invalid_when_9_digits (0.00s) + --- PASS: TestNumber/invalid_when_11_digits_does_not_start_with_a_1 (0.00s) + --- PASS: TestNumber/valid_when_11_digits_and_starting_with_1 (0.00s) + --- PASS: TestNumber/valid_when_11_digits_and_starting_with_1_even_with_punctuation (0.00s) + --- PASS: TestNumber/invalid_when_more_than_11_digits (0.00s) + --- PASS: TestNumber/invalid_with_letters (0.00s) + --- PASS: TestNumber/invalid_with_punctuations (0.00s) + --- PASS: TestNumber/invalid_if_area_code_starts_with_0 (0.00s) + --- PASS: TestNumber/invalid_if_area_code_starts_with_1 (0.00s) + --- PASS: TestNumber/invalid_if_exchange_code_starts_with_0 (0.00s) + --- PASS: TestNumber/invalid_if_exchange_code_starts_with_1 (0.00s) + --- PASS: TestNumber/invalid_if_area_code_starts_with_0_on_valid_11-digit_number (0.00s) + --- PASS: TestNumber/invalid_if_area_code_starts_with_1_on_valid_11-digit_number (0.00s) + --- PASS: TestNumber/invalid_if_exchange_code_starts_with_0_on_valid_11-digit_number (0.00s) + --- PASS: TestNumber/invalid_if_exchange_code_starts_with_1_on_valid_11-digit_number (0.00s) +=== RUN TestAreaCode +=== RUN TestAreaCode/cleans_the_number +=== RUN TestAreaCode/cleans_numbers_with_dots +=== RUN TestAreaCode/cleans_numbers_with_multiple_spaces +=== RUN TestAreaCode/invalid_when_9_digits +=== RUN TestAreaCode/invalid_when_11_digits_does_not_start_with_a_1 +=== RUN TestAreaCode/valid_when_11_digits_and_starting_with_1 +=== RUN TestAreaCode/valid_when_11_digits_and_starting_with_1_even_with_punctuation +=== RUN TestAreaCode/invalid_when_more_than_11_digits +=== RUN TestAreaCode/invalid_with_letters +=== RUN TestAreaCode/invalid_with_punctuations +=== RUN TestAreaCode/invalid_if_area_code_starts_with_0 +=== RUN TestAreaCode/invalid_if_area_code_starts_with_1 +=== RUN TestAreaCode/invalid_if_exchange_code_starts_with_0 +=== RUN TestAreaCode/invalid_if_exchange_code_starts_with_1 +=== RUN TestAreaCode/invalid_if_area_code_starts_with_0_on_valid_11-digit_number +=== RUN TestAreaCode/invalid_if_area_code_starts_with_1_on_valid_11-digit_number +=== RUN TestAreaCode/invalid_if_exchange_code_starts_with_0_on_valid_11-digit_number +=== RUN TestAreaCode/invalid_if_exchange_code_starts_with_1_on_valid_11-digit_number +--- PASS: TestAreaCode (0.00s) + --- PASS: TestAreaCode/cleans_the_number (0.00s) + --- PASS: TestAreaCode/cleans_numbers_with_dots (0.00s) + --- PASS: TestAreaCode/cleans_numbers_with_multiple_spaces (0.00s) + --- PASS: TestAreaCode/invalid_when_9_digits (0.00s) + --- PASS: TestAreaCode/invalid_when_11_digits_does_not_start_with_a_1 (0.00s) + --- PASS: TestAreaCode/valid_when_11_digits_and_starting_with_1 (0.00s) + --- PASS: TestAreaCode/valid_when_11_digits_and_starting_with_1_even_with_punctuation (0.00s) + --- PASS: TestAreaCode/invalid_when_more_than_11_digits (0.00s) + --- PASS: TestAreaCode/invalid_with_letters (0.00s) + --- PASS: TestAreaCode/invalid_with_punctuations (0.00s) + --- PASS: TestAreaCode/invalid_if_area_code_starts_with_0 (0.00s) + --- PASS: TestAreaCode/invalid_if_area_code_starts_with_1 (0.00s) + --- PASS: TestAreaCode/invalid_if_exchange_code_starts_with_0 (0.00s) + --- PASS: TestAreaCode/invalid_if_exchange_code_starts_with_1 (0.00s) + --- PASS: TestAreaCode/invalid_if_area_code_starts_with_0_on_valid_11-digit_number (0.00s) + --- PASS: TestAreaCode/invalid_if_area_code_starts_with_1_on_valid_11-digit_number (0.00s) + --- PASS: TestAreaCode/invalid_if_exchange_code_starts_with_0_on_valid_11-digit_number (0.00s) + --- PASS: TestAreaCode/invalid_if_exchange_code_starts_with_1_on_valid_11-digit_number (0.00s) +=== RUN TestFormat +=== RUN TestFormat/cleans_the_number +=== RUN TestFormat/cleans_numbers_with_dots +=== RUN TestFormat/cleans_numbers_with_multiple_spaces +=== RUN TestFormat/invalid_when_9_digits +=== RUN TestFormat/invalid_when_11_digits_does_not_start_with_a_1 +=== RUN TestFormat/valid_when_11_digits_and_starting_with_1 +=== RUN TestFormat/valid_when_11_digits_and_starting_with_1_even_with_punctuation +=== RUN TestFormat/invalid_when_more_than_11_digits +=== RUN TestFormat/invalid_with_letters +=== RUN TestFormat/invalid_with_punctuations +=== RUN TestFormat/invalid_if_area_code_starts_with_0 +=== RUN TestFormat/invalid_if_area_code_starts_with_1 +=== RUN TestFormat/invalid_if_exchange_code_starts_with_0 +=== RUN TestFormat/invalid_if_exchange_code_starts_with_1 +=== RUN TestFormat/invalid_if_area_code_starts_with_0_on_valid_11-digit_number +=== RUN TestFormat/invalid_if_area_code_starts_with_1_on_valid_11-digit_number +=== RUN TestFormat/invalid_if_exchange_code_starts_with_0_on_valid_11-digit_number +=== RUN TestFormat/invalid_if_exchange_code_starts_with_1_on_valid_11-digit_number +--- PASS: TestFormat (0.00s) + --- PASS: TestFormat/cleans_the_number (0.00s) + --- PASS: TestFormat/cleans_numbers_with_dots (0.00s) + --- PASS: TestFormat/cleans_numbers_with_multiple_spaces (0.00s) + --- PASS: TestFormat/invalid_when_9_digits (0.00s) + --- PASS: TestFormat/invalid_when_11_digits_does_not_start_with_a_1 (0.00s) + --- PASS: TestFormat/valid_when_11_digits_and_starting_with_1 (0.00s) + --- PASS: TestFormat/valid_when_11_digits_and_starting_with_1_even_with_punctuation (0.00s) + --- PASS: TestFormat/invalid_when_more_than_11_digits (0.00s) + --- PASS: TestFormat/invalid_with_letters (0.00s) + --- PASS: TestFormat/invalid_with_punctuations (0.00s) + --- PASS: TestFormat/invalid_if_area_code_starts_with_0 (0.00s) + --- PASS: TestFormat/invalid_if_area_code_starts_with_1 (0.00s) + --- PASS: TestFormat/invalid_if_exchange_code_starts_with_0 (0.00s) + --- PASS: TestFormat/invalid_if_exchange_code_starts_with_1 (0.00s) + --- PASS: TestFormat/invalid_if_area_code_starts_with_0_on_valid_11-digit_number (0.00s) + --- PASS: TestFormat/invalid_if_area_code_starts_with_1_on_valid_11-digit_number (0.00s) + --- PASS: TestFormat/invalid_if_exchange_code_starts_with_0_on_valid_11-digit_number (0.00s) + --- PASS: TestFormat/invalid_if_exchange_code_starts_with_1_on_valid_11-digit_number (0.00s) +=== RUN ExampleNumber +--- PASS: ExampleNumber (0.00s) +=== RUN ExampleAreaCode +--- PASS: ExampleAreaCode (0.00s) +=== RUN ExampleFormat +--- PASS: ExampleFormat (0.00s) PASS -ok phonenumber 0.018s +ok phonenumber 0.010s -real 0m0.599s -user 0m0.678s -sys 0m0.458s +real 0m0.140s +user 0m0.186s +sys 0m0.127s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m0.853s -user 0m0.942s -sys 0m0.362s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -Number-4 755µs ± 0% 767µs ± 0% ~ (p=1.000 n=1+1) -AreaCode-4 920µs ± 0% 1006µs ± 0% ~ (p=1.000 n=1+1) -Format-4 862µs ± 0% 1055µs ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -Number-4 220kB ± 0% 220kB ± 0% ~ (p=1.000 n=1+1) -AreaCode-4 260kB ± 0% 260kB ± 0% ~ (p=1.000 n=1+1) -Format-4 263kB ± 0% 263kB ± 0% ~ (p=1.000 n=1+1) - -name old allocs/op new allocs/op delta -Number-4 2.16k ± 0% 2.16k ± 0% ~ (all equal) -AreaCode-4 2.49k ± 0% 2.49k ± 0% ~ (all equal) -Format-4 2.52k ± 0% 2.52k ± 0% ~ (all equal) - -real 0m0.040s -user 0m0.009s -sys 0m0.015s - -=============================================================================== - -go vet phonenumber - -real 0m0.504s -user 0m0.595s -sys 0m0.419s - -=============================================================================== - -go fix phonenumber - -real 0m0.157s -user 0m0.143s -sys 0m0.166s - -=============================================================================== - -gosec ./phone-number -[gosec] 2022/07/25 08:23:32 Including rules: default -[gosec] 2022/07/25 08:23:32 Excluding rules: default -[gosec] 2022/07/25 08:23:32 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/phone-number -2022/07/25 08:23:33 internal error: package "errors" without types was imported from "command-line-arguments" +benchstat-new.txt:5: missing iteration count +benchstat-new.txt:7: missing iteration count +benchstat-new.txt:9: missing iteration count +goos: linux +goarch: amd64 +pkg: phonenumber +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Number-8 197.6µ ± ∞ ¹ +AreaCode-8 239.6µ ± ∞ ¹ +Format-8 221.8µ ± ∞ ¹ +geomean 219.0µ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Number-8 215.1Ki ± ∞ ¹ +AreaCode-8 254.3Ki ± ∞ ¹ +Format-8 257.6Ki ± ∞ ¹ +geomean 241.6Ki +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Number-8 2.160k ± ∞ ¹ +AreaCode-8 2.490k ± ∞ ¹ +Format-8 2.525k ± ∞ ¹ +geomean 2.386k +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.471s -user 0m0.566s -sys 0m0.332s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Number-4 767.4µ ± ∞ ¹ +AreaCode-4 1.006m ± ∞ ¹ +Format-4 1.055m ± ∞ ¹ +geomean 933.8µ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ B/op │ +Number-4 214.4Ki ± ∞ ¹ +AreaCode-4 253.5Ki ± ∞ ¹ +Format-4 257.0Ki ± ∞ ¹ +geomean 240.8Ki +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ allocs/op │ +Number-4 2.160k ± ∞ ¹ +AreaCode-4 2.490k ± ∞ ¹ +Format-4 2.525k ± ∞ ¹ +geomean 2.386k +¹ need >= 6 samples for confidence interval at level 0.95 + +real 0m0.002s +user 0m0.000s +sys 0m0.003s =============================================================================== gomarkdoc --output phonenumber-doc.md -real 0m0.026s -user 0m0.021s -sys 0m0.007s +real 0m0.014s +user 0m0.009s +sys 0m0.005s =============================================================================== go doc -all phonenumber package phonenumber // import "phonenumber" -Package phonenumber used to clean up NANP (North American Numbering Plan) -phone numbers. +Package phonenumber used to clean up NANP (North American Numbering Plan) phone +numbers. VARIABLES @@ -447,9 +1388,9 @@ func ValidateInput(phoneNumber string) error ValidateInput returns an error if the phone number has invalid data in it. -real 0m0.219s -user 0m0.134s -sys 0m0.271s +real 0m0.031s +user 0m0.014s +sys 0m0.030s =============================================================================== diff --git a/go/prime-factors/benchstat-new.txt b/go/prime-factors/benchstat-new.txt index 49a66d16..0f4f0e51 100644 --- a/go/prime-factors/benchstat-new.txt +++ b/go/prime-factors/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: prime -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkPrimeFactors-4 43 27929700 ns/op 424 B/op 26 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkPrimeFactors +BenchmarkPrimeFactors-8 1116 1040714 ns/op 424 B/op 26 allocs/op PASS -ok prime 2.281s +ok prime 1.274s diff --git a/go/prime-factors/benchstat-old.txt b/go/prime-factors/benchstat-old.txt new file mode 100644 index 00000000..49a66d16 --- /dev/null +++ b/go/prime-factors/benchstat-old.txt @@ -0,0 +1,7 @@ +goos: linux +goarch: amd64 +pkg: prime +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkPrimeFactors-4 43 27929700 ns/op 424 B/op 26 allocs/op +PASS +ok prime 2.281s diff --git a/go/prime-factors/coverage-annotations.txt b/go/prime-factors/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/prime-factors/coverage.out b/go/prime-factors/coverage.out index 4c98c27b..a46f2a32 100644 --- a/go/prime-factors/coverage.out +++ b/go/prime-factors/coverage.out @@ -1,7 +1,7 @@ mode: count prime/prime_factors.go:5.36,9.24 3 13 -prime/prime_factors.go:17.2,22.17 4 13 -prime/prime_factors.go:27.2,27.16 1 13 prime/prime_factors.go:9.24,10.40 1 447311 prime/prime_factors.go:10.40,14.4 2 32 +prime/prime_factors.go:17.2,22.17 4 13 prime/prime_factors.go:22.17,25.3 2 447298 +prime/prime_factors.go:27.2,27.16 1 13 diff --git a/go/prime-factors/prime-doc.md b/go/prime-factors/prime-doc.md index c2aea3ec..864c9dea 100755 --- a/go/prime-factors/prime-doc.md +++ b/go/prime-factors/prime-doc.md @@ -6,7 +6,7 @@ import "prime" ``` -Package prime computes the prime factors of a given natural number\. +Package prime computes the prime factors of a given natural number. ## Index @@ -19,7 +19,7 @@ Package prime computes the prime factors of a given natural number\. func Factors(number int64) []int64 ``` -Factors returns an in64 list of prime factors for the given natural number\. +Factors returns an in64 list of prime factors for the given natural number.

Example

diff --git a/go/prime-factors/run-tests-go.txt b/go/prime-factors/run-tests-go.txt index 0f78b317..df3a86e7 100644 --- a/go/prime-factors/run-tests-go.txt +++ b/go/prime-factors/run-tests-go.txt @@ -5,15 +5,582 @@ Go packages: prime =============================================================================== -golint prime +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.009s +sys 0m0.013s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +prime_factors_test.go:11:22: Using the variable on range scope `tc` in function literal (scopelint) + actual := Factors(tc.input) + ^ +prime_factors_test.go:13:15: Using the variable on range scope `tc` in function literal (scopelint) + sort.Slice(tc.expected, ascending(tc.expected)) + ^ +prime_factors_test.go:14:28: Using the variable on range scope `tc` in function literal (scopelint) + if !slicesEqual(actual, tc.expected) { + ^ +prime_factors.go:7:2: declarations should never be cuddled (wsl) + var factor int64 + ^ +prime_factors.go:18:2: only cuddled expressions if assigning variable or using from line above (wsl) + _getFactors() + ^ +prime_factors.go:24:3: assignments should only be cuddled with other assignments (wsl) + factor += 2 + ^ +prime_factors_test.go:25:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +prime_factors.go:9:2: _getFactors contains underscore. You should use mixedCap or MixedCap. (nosnakecase) + _getFactors := func() { + ^ +prime_factors.go:23:3: _getFactors contains underscore. You should use mixedCap or MixedCap. (nosnakecase) + _getFactors() + ^ +prime_factors_test.go:8:1: Function TestPrimeFactors missing the call to method parallel (paralleltest) +func TestPrimeFactors(t *testing.T) { +^ +prime_factors_test.go:9:2: Range statement for test TestPrimeFactors missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +cases_test.go:1:9: package should be `prime_test` instead of `prime` (testpackage) +package prime + ^ +prime_factors_examples_test.go:1:9: package should be `prime_test` instead of `prime` (testpackage) +package prime + ^ +prime_factors_test.go:1:9: package should be `prime_test` instead of `prime` (testpackage) +package prime + ^ +prime_factors_test.go:32:18: parameter name 'a' is too short for the scope of its usage (varnamelen) +func slicesEqual(a, b []int64) bool { + ^ + +real 0m0.485s +user 0m0.733s +sys 0m0.428s + + + ============================================================================== + +Exit code: -1 + +real 0m0.519s +user 0m0.752s +sys 0m0.453s + +real 0m0.522s +user 0m0.754s +sys 0m0.454s -real 0m0.211s -user 0m0.077s -sys 0m0.130s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.012s +sys 0m0.012s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.044s +user 0m0.025s +sys 0m0.030s + + + ============================================================================== + +Exit code: 0 + +real 0m0.077s +user 0m0.043s +sys 0m0.054s + +real 0m0.080s +user 0m0.045s +sys 0m0.054s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.000s +user 0m0.000s +sys 0m0.000s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out prime +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.008s +sys 0m0.009s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "prime [prime.test]" + +real 0m0.078s +user 0m0.093s +sys 0m0.096s + + + ============================================================================== + +Exit code: -1 + +real 0m0.101s +user 0m0.109s +sys 0m0.110s + +real 0m0.103s +user 0m0.110s +sys 0m0.111s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.004s +sys 0m0.014s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.173s +user 0m0.211s +sys 0m0.131s + + + ============================================================================== + +Exit code: 0 + +real 0m0.201s +user 0m0.219s +sys 0m0.159s + +real 0m0.203s +user 0m0.220s +sys 0m0.161s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.006s +sys 0m0.020s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.807s +user 0m2.063s +sys 0m0.315s + + + ============================================================================== + +Exit code: 0 + +real 0m0.845s +user 0m2.080s +sys 0m0.350s + +real 0m0.848s +user 0m2.082s +sys 0m0.351s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.009s +sys 0m0.005s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.071s +user 0m0.095s +sys 0m0.102s + + + ============================================================================== + +Exit code: 0 + +real 0m0.095s +user 0m0.109s +sys 0m0.117s + +real 0m0.096s +user 0m0.111s +sys 0m0.117s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.005s +sys 0m0.013s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.023s +user 0m0.010s +sys 0m0.017s + + + ============================================================================== + +Exit code: 0 + +real 0m0.048s +user 0m0.020s +sys 0m0.039s + +real 0m0.050s +user 0m0.020s +sys 0m0.040s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.012s +sys 0m0.014s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.505s +user 0m1.474s +sys 0m0.299s + + + ============================================================================== + +Exit code: 0 + +real 0m0.545s +user 0m1.494s +sys 0m0.331s + +real 0m0.548s +user 0m1.494s +sys 0m0.334s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.003s +sys 0m0.011s + + + ============================================================================== + +Running: gocyclo . + +4 prime slicesEqual prime_factors_test.go:32:1 +4 prime BenchmarkPrimeFactors prime_factors_test.go:21:1 +4 prime Factors prime_factors.go:5:1 +3 prime TestPrimeFactors prime_factors_test.go:8:1 +1 prime ascending prime_factors_test.go:46:1 +1 prime ExampleFactors prime_factors_examples_test.go:7:1 + +real 0m0.003s +user 0m0.000s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.026s +user 0m0.010s +sys 0m0.024s + +real 0m0.028s +user 0m0.010s +sys 0m0.026s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.024s +user 0m0.028s +sys 0m0.010s + + + ============================================================================== + +Exit code: 0 + +real 0m0.036s +user 0m0.033s +sys 0m0.021s + +real 0m0.039s +user 0m0.035s +sys 0m0.023s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.007s +sys 0m0.007s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:26:35 Including rules: default +[gosec] 2023/09/07 00:26:35 Excluding rules: default +[gosec] 2023/09/07 00:26:35 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/prime-factors +[gosec] 2023/09/07 00:26:35 Checking package: prime +[gosec] 2023/09/07 00:26:35 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/prime-factors/prime_factors.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 28 + Nosec : 0 + Issues : 0 + + +real 0m0.105s +user 0m0.086s +sys 0m0.071s + + + ============================================================================== + +Exit code: 0 + +real 0m0.126s +user 0m0.099s +sys 0m0.086s + +real 0m0.128s +user 0m0.100s +sys 0m0.087s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.005s +sys 0m0.014s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestPrimeFactors === RUN TestPrimeFactors/no_factors === RUN TestPrimeFactors/prime_number @@ -27,7 +594,7 @@ go test -v -covermode=count -coverprofile coverage.out prime === RUN TestPrimeFactors/product_of_primes_and_non-primes === RUN TestPrimeFactors/product_of_primes === RUN TestPrimeFactors/factors_include_a_large_prime ---- PASS: TestPrimeFactors (0.03s) +--- PASS: TestPrimeFactors (0.00s) --- PASS: TestPrimeFactors/no_factors (0.00s) --- PASS: TestPrimeFactors/prime_number (0.00s) --- PASS: TestPrimeFactors/another_prime_number (0.00s) @@ -39,38 +606,59 @@ go test -v -covermode=count -coverprofile coverage.out prime --- PASS: TestPrimeFactors/product_of_first_and_second_prime (0.00s) --- PASS: TestPrimeFactors/product_of_primes_and_non-primes (0.00s) --- PASS: TestPrimeFactors/product_of_primes (0.00s) - --- PASS: TestPrimeFactors/factors_include_a_large_prime (0.03s) + --- PASS: TestPrimeFactors/factors_include_a_large_prime (0.00s) === RUN ExampleFactors --- PASS: ExampleFactors (0.00s) PASS coverage: 100.0% of statements -ok prime 0.053s coverage: 100.0% of statements +ok prime 0.003s coverage: 100.0% of statements -real 0m1.876s -user 0m1.591s -sys 0m0.749s +real 0m0.168s +user 0m0.226s +sys 0m0.132s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + prime/prime_factors.go:5: Factors 100.0% total: (statements) 100.0% -real 0m0.142s -user 0m0.029s -sys 0m0.106s +real 0m0.025s +user 0m0.010s +sys 0m0.021s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.185s -user 0m0.054s -sys 0m0.121s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic prime +real 0m0.037s +user 0m0.022s +sys 0m0.026s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.017s +user 0m0.007s +sys 0m0.018s + +real 0m0.017s +user 0m0.007s +sys 0m0.018s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestPrimeFactors === RUN TestPrimeFactors/no_factors === RUN TestPrimeFactors/prime_number @@ -84,7 +672,7 @@ go test -v -race -covermode=atomic prime === RUN TestPrimeFactors/product_of_primes_and_non-primes === RUN TestPrimeFactors/product_of_primes === RUN TestPrimeFactors/factors_include_a_large_prime ---- PASS: TestPrimeFactors (0.56s) +--- PASS: TestPrimeFactors (0.06s) --- PASS: TestPrimeFactors/no_factors (0.00s) --- PASS: TestPrimeFactors/prime_number (0.00s) --- PASS: TestPrimeFactors/another_prime_number (0.00s) @@ -95,92 +683,138 @@ go test -v -race -covermode=atomic prime --- PASS: TestPrimeFactors/product_of_third_prime (0.00s) --- PASS: TestPrimeFactors/product_of_first_and_second_prime (0.00s) --- PASS: TestPrimeFactors/product_of_primes_and_non-primes (0.00s) - --- PASS: TestPrimeFactors/product_of_primes (0.01s) - --- PASS: TestPrimeFactors/factors_include_a_large_prime (0.53s) + --- PASS: TestPrimeFactors/product_of_primes (0.00s) + --- PASS: TestPrimeFactors/factors_include_a_large_prime (0.06s) === RUN ExampleFactors --- PASS: ExampleFactors (0.00s) PASS coverage: 100.0% of statements -ok prime 0.628s coverage: 100.0% of statements - -real 0m7.729s -user 0m8.594s -sys 0m3.246s +ok prime 1.073s coverage: 100.0% of statements -=============================================================================== +real 0m1.326s +user 0m0.390s +sys 0m0.182s -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -goos: linux -goarch: amd64 -pkg: prime -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkPrimeFactors-4 43 27929700 ns/op 424 B/op 26 allocs/op -PASS -ok prime 2.281s -real 0m3.932s -user 0m3.514s -sys 0m0.650s + ============================================================================== -=============================================================================== +Exit code: 0 -go test -tags bonus -PASS -ok prime 0.040s +real 0m1.601s +user 0m0.664s +sys 0m0.407s -real 0m1.470s -user 0m1.360s -sys 0m0.670s +real 0m1.603s +user 0m0.666s +sys 0m0.407s =============================================================================== -No old benchmarks to run benchstat against. - -=============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go vet prime +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +goos: linux +goarch: amd64 +pkg: prime +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkPrimeFactors +BenchmarkPrimeFactors-8 1116 1040714 ns/op 424 B/op 26 allocs/op +PASS +ok prime 1.274s -real 0m4.088s -user 0m7.410s -sys 0m2.354s +real 0m1.430s +user 0m1.476s +sys 0m0.152s =============================================================================== -go fix prime +gotest -v -tags bonus +=== RUN TestPrimeFactors +=== RUN TestPrimeFactors/no_factors +=== RUN TestPrimeFactors/prime_number +=== RUN TestPrimeFactors/another_prime_number +=== RUN TestPrimeFactors/square_of_a_prime +=== RUN TestPrimeFactors/product_of_first_prime +=== RUN TestPrimeFactors/cube_of_a_prime +=== RUN TestPrimeFactors/product_of_second_prime +=== RUN TestPrimeFactors/product_of_third_prime +=== RUN TestPrimeFactors/product_of_first_and_second_prime +=== RUN TestPrimeFactors/product_of_primes_and_non-primes +=== RUN TestPrimeFactors/product_of_primes +=== RUN TestPrimeFactors/factors_include_a_large_prime +--- PASS: TestPrimeFactors (0.00s) + --- PASS: TestPrimeFactors/no_factors (0.00s) + --- PASS: TestPrimeFactors/prime_number (0.00s) + --- PASS: TestPrimeFactors/another_prime_number (0.00s) + --- PASS: TestPrimeFactors/square_of_a_prime (0.00s) + --- PASS: TestPrimeFactors/product_of_first_prime (0.00s) + --- PASS: TestPrimeFactors/cube_of_a_prime (0.00s) + --- PASS: TestPrimeFactors/product_of_second_prime (0.00s) + --- PASS: TestPrimeFactors/product_of_third_prime (0.00s) + --- PASS: TestPrimeFactors/product_of_first_and_second_prime (0.00s) + --- PASS: TestPrimeFactors/product_of_primes_and_non-primes (0.00s) + --- PASS: TestPrimeFactors/product_of_primes (0.00s) + --- PASS: TestPrimeFactors/factors_include_a_large_prime (0.00s) +=== RUN ExampleFactors +--- PASS: ExampleFactors (0.00s) +PASS +ok prime 0.005s -real 0m0.134s -user 0m0.049s -sys 0m0.091s +real 0m0.130s +user 0m0.172s +sys 0m0.122s =============================================================================== -gosec ./prime-factors -[gosec] 2022/07/17 23:49:09 Including rules: default -[gosec] 2022/07/17 23:49:09 Excluding rules: default -[gosec] 2022/07/17 23:49:09 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/prime-factors -[gosec] 2022/07/17 23:49:09 Checking package: prime -[gosec] 2022/07/17 23:49:09 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/prime-factors/prime_factors.go -Results: +benchstat benchstat-old.txt benchstat-new.txt +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: prime +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +PrimeFactors-8 1.041m ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +PrimeFactors-8 424.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +PrimeFactors-8 26.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +PrimeFactors-4 27.93m ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -Summary: - Files: 1 - Lines: 28 - Nosec: 0 - Issues: 0 + │ benchstat-old.txt │ + │ B/op │ +PrimeFactors-4 424.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + │ benchstat-old.txt │ + │ allocs/op │ +PrimeFactors-4 26.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.346s -user 0m0.589s -sys 0m0.178s +real 0m0.007s +user 0m0.001s +sys 0m0.005s =============================================================================== gomarkdoc --output prime-doc.md -real 0m0.052s -user 0m0.034s -sys 0m0.036s +real 0m0.019s +user 0m0.009s +sys 0m0.011s =============================================================================== @@ -195,9 +829,9 @@ func Factors(number int64) []int64 Factors returns an in64 list of prime factors for the given natural number. -real 0m0.205s -user 0m0.099s -sys 0m0.140s +real 0m0.029s +user 0m0.011s +sys 0m0.024s =============================================================================== diff --git a/go/protein-translation/benchstat-new.txt b/go/protein-translation/benchstat-new.txt index d3e6ed86..c9156f8d 100644 --- a/go/protein-translation/benchstat-new.txt +++ b/go/protein-translation/benchstat-new.txt @@ -1,8 +1,10 @@ goos: linux goarch: amd64 pkg: protein -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkCodon-4 4767339 262.5 ns/op 0 B/op 0 allocs/op -BenchmarkProtein-4 36894 33786 ns/op 9913 B/op 124 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkCodon +BenchmarkCodon-8 73281381 14.08 ns/op 0 B/op 0 allocs/op +BenchmarkProtein +BenchmarkProtein-8 120669 10863 ns/op 9983 B/op 124 allocs/op PASS -ok protein 3.170s +ok protein 2.474s diff --git a/go/protein-translation/benchstat-old.txt b/go/protein-translation/benchstat-old.txt new file mode 100644 index 00000000..d3e6ed86 --- /dev/null +++ b/go/protein-translation/benchstat-old.txt @@ -0,0 +1,8 @@ +goos: linux +goarch: amd64 +pkg: protein +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkCodon-4 4767339 262.5 ns/op 0 B/op 0 allocs/op +BenchmarkProtein-4 36894 33786 ns/op 9913 B/op 124 allocs/op +PASS +ok protein 3.170s diff --git a/go/protein-translation/coverage-annotations.txt b/go/protein-translation/coverage-annotations.txt new file mode 100644 index 00000000..d917a403 --- /dev/null +++ b/go/protein-translation/coverage-annotations.txt @@ -0,0 +1,30 @@ + +16 func FromRNA(rna string) ([]string, error) { +17 var codons []string = []string{} +18 var proteins []string = []string{} +19 +20 reStr := `([[:upper:]]{3})` +21 +22 re, e := regexp.Compile(reStr) +23 +24 if e != nil { +25 MISS panic(e) +26 } +27 +28 codons = re.FindAllString(rna, -1) +29 +30 for _, codon := range codons { +31 protein, e := FromCodon(codon) +32 +33 if e == ErrStop { +34 break +35 } else if e != nil { +36 return []string{}, e +37 } +38 +39 proteins = append(proteins, protein) +40 } +41 +42 return proteins, nil +43 } + diff --git a/go/protein-translation/coverage.out b/go/protein-translation/coverage.out index 0bf8978b..370ee07b 100644 --- a/go/protein-translation/coverage.out +++ b/go/protein-translation/coverage.out @@ -1,13 +1,13 @@ mode: count protein/protein_translation.go:16.44,24.14 5 6 -protein/protein_translation.go:28.2,30.31 2 6 -protein/protein_translation.go:42.2,42.22 1 5 protein/protein_translation.go:24.14,25.11 1 0 +protein/protein_translation.go:28.2,30.31 2 6 protein/protein_translation.go:30.31,33.19 2 20 -protein/protein_translation.go:39.3,39.39 1 15 protein/protein_translation.go:33.19,34.9 1 4 protein/protein_translation.go:35.9,35.22 1 16 protein/protein_translation.go:35.22,37.4 1 1 +protein/protein_translation.go:39.3,39.39 1 15 +protein/protein_translation.go:42.2,42.22 1 5 protein/protein_translation.go:46.46,47.15 1 35 protein/protein_translation.go:48.13,49.27 1 5 protein/protein_translation.go:50.20,51.30 1 5 diff --git a/go/protein-translation/protein-doc.md b/go/protein-translation/protein-doc.md index f724ac6e..70adb604 100755 --- a/go/protein-translation/protein-doc.md +++ b/go/protein-translation/protein-doc.md @@ -6,7 +6,7 @@ import "protein" ``` -Package protein is used to translate RNA sequences into proteins\. +Package protein is used to translate RNA sequences into proteins. ## Index @@ -17,13 +17,13 @@ Package protein is used to translate RNA sequences into proteins\. ## Variables -ErrInvalidBase is used to signal FronCodon that an invalid codon has been encountered\. +ErrInvalidBase is used to signal FronCodon that an invalid codon has been encountered. ```go var ErrInvalidBase = errors.New("Invalid Base") ``` -ErrStop is used to signal FromCodon to stop processing codons\. +ErrStop is used to signal FromCodon to stop processing codons. ```go var ErrStop = errors.New("STOP") @@ -35,7 +35,7 @@ var ErrStop = errors.New("STOP") func FromCodon(codon string) (string, error) ``` -FromCodon returns a single protein from a codon\. +FromCodon returns a single protein from a codon.

Example

@@ -62,7 +62,7 @@ Methionine func FromRNA(rna string) ([]string, error) ``` -FromRNA returns a protein sequence from an RNA sequence\. +FromRNA returns a protein sequence from an RNA sequence.

Example

diff --git a/go/protein-translation/run-tests-go.txt b/go/protein-translation/run-tests-go.txt index 2cd829af..3b09a3e4 100644 --- a/go/protein-translation/run-tests-go.txt +++ b/go/protein-translation/run-tests-go.txt @@ -5,15 +5,623 @@ Go packages: protein =============================================================================== -golint protein +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.018s +sys 0m0.024s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +protein_translation_test.go:192:13: Error return value is not checked (errcheck) + FromCodon(test.input) + ^ +protein_translation_test.go:203:11: Error return value is not checked (errcheck) + FromRNA(test.input) + ^ +protein_translation.go:18:2: Consider pre-allocating `proteins` (prealloc) + var proteins []string = []string{} + ^ +protein_translation.go:17:13: var-declaration: should omit type []string from declaration of var codons; it will be inferred from the right-hand side (revive) + var codons []string = []string{} + ^ +protein_translation_test.go:11:2: if statements should only be cuddled with assignments (wsl) + if ErrInvalidBase == nil { + ^ +protein_translation_test.go:107:3: if statements should only be cuddled with assignments (wsl) + if actual != test.expected { + ^ +protein_translation_test.go:111:3: expressions should not be cuddled with blocks (wsl) + t.Logf("PASS: Protein translation test: %s", test.input) + ^ +protein_translation_test.go:161:3: if statements should only be cuddled with assignments (wsl) + if !slicesEqual(actual, test.expected) { + ^ +protein_translation_test.go:164:3: expressions should not be cuddled with blocks (wsl) + t.Logf("PASS: RNA translation test: %s", test.input) + ^ +protein_translation_test.go:190:2: ranges should only be cuddled with assignments used in the iteration (wsl) + for _, test := range codonTestCases { + ^ +protein_translation_test.go:201:2: ranges should only be cuddled with assignments used in the iteration (wsl) + for _, test := range proteinTestCases { + ^ +protein_translation.go:33:6: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if e == ErrStop { + ^ +protein_translation_test.go:99:7: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if test.errorExpected != err { + ^ +protein_translation_test.go:153:7: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if test.errorExpected != err { + ^ +protein_translation_test.go:22:5: codonTestCases is a global variable (gochecknoglobals) +var codonTestCases = []codonCase{ + ^ +protein_translation_test.go:121:5: proteinTestCases is a global variable (gochecknoglobals) +var proteinTestCases = []rnaCase{ + ^ +protein_translation_test.go:7:1: Function TestErrorsNotNil missing the call to method parallel (paralleltest) +func TestErrorsNotNil(t *testing.T) { +^ +protein_translation_test.go:95:1: Function TestCodon missing the call to method parallel (paralleltest) +func TestCodon(t *testing.T) { +^ +protein_translation_test.go:149:1: Function TestProtein missing the call to method parallel (paralleltest) +func TestProtein(t *testing.T) { +^ +protein_translation.go:13:22: ST1005: error strings should not be capitalized (stylecheck) +var ErrInvalidBase = errors.New("Invalid Base") + ^ +protein_translation_examples_test.go:1:9: package should be `protein_test` instead of `protein` (testpackage) +package protein + ^ +protein_translation_test.go:1:9: package should be `protein_test` instead of `protein` (testpackage) +package protein + ^ +protein_translation.go:22:2: variable name 're' is too short for the scope of its usage (varnamelen) + re, e := regexp.Compile(reStr) + ^ +protein_translation_test.go:168:18: parameter name 'b' is too short for the scope of its usage (varnamelen) +func slicesEqual(a, b []string) bool { + ^ + +real 0m0.527s +user 0m0.779s +sys 0m0.536s + + + ============================================================================== + +Exit code: -1 + +real 0m0.570s +user 0m0.802s +sys 0m0.573s + +real 0m0.572s +user 0m0.803s +sys 0m0.574s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.017s +sys 0m0.011s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +protein_translation.go + (17, 13) https://revive.run/r#var-declaration should omit type []string from declaration of var codons; it will be inferred from the right-hand side + (18, 15) https://revive.run/r#var-declaration should omit type []string from declaration of var proteins; it will be inferred from the right-hand side + + + ✖ 2 problems (0 errors) (2 warnings) + +real 0m0.060s +user 0m0.030s +sys 0m0.045s + + + ============================================================================== + +Exit code: 0 + +real 0m0.089s +user 0m0.054s +sys 0m0.065s + +real 0m0.091s +user 0m0.054s +sys 0m0.067s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.017s +sys 0m0.021s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "errors" without types was imported from "protein" + +real 0m0.082s +user 0m0.116s +sys 0m0.102s + + + ============================================================================== + +Exit code: -1 + +real 0m0.120s +user 0m0.137s +sys 0m0.137s + +real 0m0.122s +user 0m0.139s +sys 0m0.139s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.011s +sys 0m0.020s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +protein_translation.go:13:22: error strings should not be capitalized (ST1005) +protein_translation.go:17:13: should omit type []string from declaration; it will be inferred from the right-hand side (ST1023) +protein_translation.go:18:15: should omit type []string from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.161s +user 0m0.228s +sys 0m0.108s + + + ============================================================================== + +Exit code: -1 + +real 0m0.190s +user 0m0.245s +sys 0m0.137s + +real 0m0.192s +user 0m0.245s +sys 0m0.139s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.020s +sys 0m0.021s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.803s +user 0m1.781s +sys 0m0.261s + + + ============================================================================== + +Exit code: 0 + +real 0m0.839s +user 0m1.809s +sys 0m0.291s + +real 0m0.840s +user 0m1.809s +sys 0m0.292s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.019s +sys 0m0.023s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.077s +user 0m0.091s +sys 0m0.108s + + + ============================================================================== + +Exit code: 0 + +real 0m0.126s +user 0m0.123s +sys 0m0.151s + +real 0m0.128s +user 0m0.124s +sys 0m0.152s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.011s +sys 0m0.022s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.024s +user 0m0.021s +sys 0m0.018s + + + ============================================================================== + +Exit code: 0 + +real 0m0.058s +user 0m0.040s +sys 0m0.047s + +real 0m0.060s +user 0m0.040s +sys 0m0.049s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.015s +sys 0m0.019s + -real 0m0.173s -user 0m0.144s -sys 0m0.173s + ============================================================================== + +Running: errcheck ./... + +protein_translation_test.go:192:13: FromCodon(test.input) +protein_translation_test.go:203:11: FromRNA(test.input) + +real 0m0.430s +user 0m1.191s +sys 0m0.248s + + + ============================================================================== + +Exit code: -1 + +real 0m0.467s +user 0m1.213s +sys 0m0.283s + +real 0m0.469s +user 0m1.213s +sys 0m0.285s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.016s +sys 0m0.029s + + + ============================================================================== + +Running: gocyclo . + +9 protein FromCodon protein_translation.go:46:1 +6 protein TestProtein protein_translation_test.go:149:1 +6 protein TestCodon protein_translation_test.go:95:1 +5 protein slicesEqual protein_translation_test.go:168:1 +5 protein FromRNA protein_translation.go:16:1 +4 protein BenchmarkProtein protein_translation_test.go:197:1 +4 protein BenchmarkCodon protein_translation_test.go:186:1 +4 protein BenchmarkProteinDetailed protein_translation_detailed_test.go:24:1 +4 protein BenchmarkCodonDetailed protein_translation_detailed_test.go:11:1 +3 protein TestErrorsNotNil protein_translation_test.go:7:1 +1 protein ExampleFromCodon protein_translation_examples_test.go:13:1 +1 protein ExampleFromRNA protein_translation_examples_test.go:7:1 + +real 0m0.006s +user 0m0.001s +sys 0m0.004s + + + ============================================================================== + +Exit code: 0 + +real 0m0.044s +user 0m0.026s +sys 0m0.039s + +real 0m0.046s +user 0m0.026s +sys 0m0.041s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.029s +user 0m0.035s +sys 0m0.011s + + + ============================================================================== + +Exit code: 0 + +real 0m0.048s +user 0m0.043s +sys 0m0.029s + +real 0m0.051s +user 0m0.043s +sys 0m0.032s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.018s +sys 0m0.028s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:26:41 Including rules: default +[gosec] 2023/09/07 00:26:41 Excluding rules: default +[gosec] 2023/09/07 00:26:41 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/protein-translation +[gosec] 2023/09/07 00:26:41 Checking package: protein +[gosec] 2023/09/07 00:26:41 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/protein-translation/protein_translation.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 67 + Nosec : 0 + Issues : 0 + + +real 0m0.145s +user 0m0.148s +sys 0m0.149s + + + ============================================================================== + +Exit code: 0 + +real 0m0.185s +user 0m0.170s +sys 0m0.191s + +real 0m0.187s +user 0m0.171s +sys 0m0.193s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out protein +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.019s +sys 0m0.026s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestErrorsNotNil --- PASS: TestErrorsNotNil (0.00s) === RUN TestCodon @@ -45,34 +653,85 @@ go test -v -covermode=count -coverprofile coverage.out protein --- PASS: ExampleFromCodon (0.00s) PASS coverage: 96.0% of statements -ok protein 0.043s coverage: 96.0% of statements +ok protein 0.002s coverage: 96.0% of statements -real 0m1.053s -user 0m1.561s -sys 0m0.634s +real 0m0.183s +user 0m0.222s +sys 0m0.134s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + protein/protein_translation.go:16: FromRNA 93.3% protein/protein_translation.go:46: FromCodon 100.0% total: (statements) 96.0% -real 0m0.317s -user 0m0.216s -sys 0m0.294s +real 0m0.052s +user 0m0.062s +sys 0m0.091s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.231s -user 0m0.229s -sys 0m0.203s +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.044s +user 0m0.046s +sys 0m0.069s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +16 func FromRNA(rna string) ([]string, error) { +17 var codons []string = []string{} +18 var proteins []string = []string{} +19 +20 reStr := `([[:upper:]]{3})` +21 +22 re, e := regexp.Compile(reStr) +23 +24 if e != nil { +25 MISS panic(e) +26 } +27 +28 codons = re.FindAllString(rna, -1) +29 +30 for _, codon := range codons { +31 protein, e := FromCodon(codon) +32 +33 if e == ErrStop { +34 break +35 } else if e != nil { +36 return []string{}, e +37 } +38 +39 proteins = append(proteins, protein) +40 } +41 +42 return proteins, nil +43 } -=============================================================================== -go test -v -race -covermode=atomic protein +real 0m0.016s +user 0m0.010s +sys 0m0.020s + +real 0m0.016s +user 0m0.010s +sys 0m0.020s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestErrorsNotNil --- PASS: TestErrorsNotNil (0.00s) === RUN TestCodon @@ -97,84 +756,159 @@ go test -v -race -covermode=atomic protein protein_translation_test.go:164: PASS: RNA translation test: AUGUUUUAA protein_translation_test.go:164: PASS: RNA translation test: UGGUGUUAUUAAUGGUUU protein_translation_test.go:164: PASS: RNA translation test: UGGAGAAUUAAUGGUUU ---- PASS: TestProtein (0.01s) +--- PASS: TestProtein (0.00s) === RUN ExampleFromRNA --- PASS: ExampleFromRNA (0.00s) === RUN ExampleFromCodon --- PASS: ExampleFromCodon (0.00s) PASS coverage: 96.0% of statements -ok protein 0.051s coverage: 96.0% of statements +ok protein 1.011s coverage: 96.0% of statements -real 0m0.817s -user 0m0.930s -sys 0m0.600s +real 0m1.266s +user 0m0.356s +sys 0m0.264s -=============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -goos: linux -goarch: amd64 -pkg: protein -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkCodon-4 4767339 262.5 ns/op 0 B/op 0 allocs/op -BenchmarkProtein-4 36894 33786 ns/op 9913 B/op 124 allocs/op -PASS -ok protein 3.170s + ============================================================================== -real 0m3.927s -user 0m4.865s -sys 0m0.844s +Exit code: 0 -=============================================================================== - -go test -tags bonus -PASS -ok protein 0.007s +real 0m1.603s +user 0m0.721s +sys 0m0.614s -real 0m0.497s -user 0m0.609s -sys 0m0.391s +real 0m1.605s +user 0m0.722s +sys 0m0.616s =============================================================================== -No old benchmarks to run benchstat against. +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -=============================================================================== - -go vet protein +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +goos: linux +goarch: amd64 +pkg: protein +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkCodon +BenchmarkCodon-8 73281381 14.08 ns/op 0 B/op 0 allocs/op +BenchmarkProtein +BenchmarkProtein-8 120669 10863 ns/op 9983 B/op 124 allocs/op +PASS +ok protein 2.474s -real 0m0.420s -user 0m0.467s -sys 0m0.410s +real 0m2.601s +user 0m2.691s +sys 0m0.179s =============================================================================== -go fix protein +gotest -v -tags bonus +=== RUN TestErrorsNotNil +--- PASS: TestErrorsNotNil (0.00s) +=== RUN TestCodon + protein_translation_test.go:111: PASS: Protein translation test: AUG + protein_translation_test.go:111: PASS: Protein translation test: UUU + protein_translation_test.go:111: PASS: Protein translation test: UUC + protein_translation_test.go:111: PASS: Protein translation test: UUA + protein_translation_test.go:111: PASS: Protein translation test: UUG + protein_translation_test.go:111: PASS: Protein translation test: UCG + protein_translation_test.go:111: PASS: Protein translation test: UAU + protein_translation_test.go:111: PASS: Protein translation test: UAC + protein_translation_test.go:111: PASS: Protein translation test: UGU + protein_translation_test.go:111: PASS: Protein translation test: UGG + protein_translation_test.go:111: PASS: Protein translation test: UAA + protein_translation_test.go:111: PASS: Protein translation test: UAG + protein_translation_test.go:111: PASS: Protein translation test: UGA + protein_translation_test.go:111: PASS: Protein translation test: ABC +--- PASS: TestCodon (0.00s) +=== RUN TestProtein + protein_translation_test.go:164: PASS: RNA translation test: AUGUUUUCUUAAAUG + protein_translation_test.go:164: PASS: RNA translation test: AUGUUUUGG + protein_translation_test.go:164: PASS: RNA translation test: AUGUUUUAA + protein_translation_test.go:164: PASS: RNA translation test: UGGUGUUAUUAAUGGUUU + protein_translation_test.go:164: PASS: RNA translation test: UGGAGAAUUAAUGGUUU +--- PASS: TestProtein (0.00s) +=== RUN ExampleFromRNA +--- PASS: ExampleFromRNA (0.00s) +=== RUN ExampleFromCodon +--- PASS: ExampleFromCodon (0.00s) +PASS +ok protein 0.002s -real 0m0.159s -user 0m0.138s -sys 0m0.180s +real 0m0.129s +user 0m0.196s +sys 0m0.132s =============================================================================== -gosec ./protein-translation -[gosec] 2022/07/02 23:03:47 Including rules: default -[gosec] 2022/07/02 23:03:47 Excluding rules: default -[gosec] 2022/07/02 23:03:47 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/protein-translation -2022/07/02 23:03:48 internal error: package "errors" without types was imported from "command-line-arguments" +benchstat benchstat-old.txt benchstat-new.txt +benchstat-new.txt:5: missing iteration count +benchstat-new.txt:7: missing iteration count +goos: linux +goarch: amd64 +pkg: protein +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Codon-8 14.08n ± ∞ ¹ +Protein-8 10.86µ ± ∞ ¹ +geomean 391.1n +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Codon-8 0.000 ± ∞ ¹ +Protein-8 9.749Ki ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean + + │ benchstat-new.txt │ + │ allocs/op │ +Codon-8 0.000 ± ∞ ¹ +Protein-8 124.0 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean -real 0m0.495s -user 0m0.510s -sys 0m0.426s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Codon-4 262.5n ± ∞ ¹ +Protein-4 33.79µ ± ∞ ¹ +geomean 2.978µ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ B/op │ +Codon-4 0.000 ± ∞ ¹ +Protein-4 9.681Ki ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean + + │ benchstat-old.txt │ + │ allocs/op │ +Codon-4 0.000 ± ∞ ¹ +Protein-4 124.0 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean + +real 0m0.002s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output protein-doc.md -real 0m0.034s -user 0m0.026s -sys 0m0.014s +real 0m0.010s +user 0m0.007s +sys 0m0.003s =============================================================================== @@ -202,9 +936,9 @@ func FromRNA(rna string) ([]string, error) FromRNA returns a protein sequence from an RNA sequence. -real 0m0.199s -user 0m0.162s -sys 0m0.161s +real 0m0.031s +user 0m0.017s +sys 0m0.030s =============================================================================== diff --git a/go/proverb/benchstat-new.txt b/go/proverb/benchstat-new.txt index 36d36e1f..33c1275e 100644 --- a/go/proverb/benchstat-new.txt +++ b/go/proverb/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: proverb -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkProverb-4 170331 8278 ns/op 1728 B/op 59 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkProverb +BenchmarkProverb-8 405014 2912 ns/op 1728 B/op 59 allocs/op PASS -ok proverb 1.519s +ok proverb 2.123s diff --git a/go/proverb/benchstat-old.txt b/go/proverb/benchstat-old.txt index 584ce651..36d36e1f 100644 --- a/go/proverb/benchstat-old.txt +++ b/go/proverb/benchstat-old.txt @@ -2,6 +2,6 @@ goos: linux goarch: amd64 pkg: proverb cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkProverb-4 123992 9259 ns/op 1728 B/op 59 allocs/op +BenchmarkProverb-4 170331 8278 ns/op 1728 B/op 59 allocs/op PASS -ok proverb 1.288s +ok proverb 1.519s diff --git a/go/proverb/coverage-annotations.txt b/go/proverb/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/proverb/coverage.out b/go/proverb/coverage.out index cd0413ea..7963376d 100644 --- a/go/proverb/coverage.out +++ b/go/proverb/coverage.out @@ -1,6 +1,6 @@ mode: count proverb/proverb.go:7.39,8.21 1 7 -proverb/proverb.go:12.2,14.52 2 6 -proverb/proverb.go:22.2,26.14 4 6 proverb/proverb.go:8.21,10.3 1 1 +proverb/proverb.go:12.2,14.52 2 6 proverb/proverb.go:14.52,20.3 4 18 +proverb/proverb.go:22.2,26.14 4 6 diff --git a/go/proverb/proverb-doc.md b/go/proverb/proverb-doc.md index 702f4d3c..df11ae8b 100755 --- a/go/proverb/proverb-doc.md +++ b/go/proverb/proverb-doc.md @@ -6,7 +6,7 @@ import "proverb" ``` -Package proverb generates proverbial rhymes\. +Package proverb generates proverbial rhymes. ## Index @@ -19,7 +19,7 @@ Package proverb generates proverbial rhymes\. func Proverb(words []string) []string ``` -Proverb returns a proverbial rhyme given a slice of words\. +Proverb returns a proverbial rhyme given a slice of words.

Example

diff --git a/go/proverb/run-tests-go.txt b/go/proverb/run-tests-go.txt index 0d0faafa..f05fba39 100644 --- a/go/proverb/run-tests-go.txt +++ b/go/proverb/run-tests-go.txt @@ -5,15 +5,568 @@ Go packages: proverb =============================================================================== -golint proverb +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.016s +sys 0m0.028s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +cases_test.go:33: line is 142 characters (lll) + expected: []string{"For want of a nail the shoe was lost.", "For want of a shoe the horse was lost.", "And all for the want of a nail."}, +cases_test.go:38: line is 322 characters (lll) + expected: []string{"For want of a nail the shoe was lost.", "For want of a shoe the horse was lost.", "For want of a horse the rider was lost.", "For want of a rider the message was lost.", "For want of a message the battle was lost.", "For want of a battle the kingdom was lost.", "And all for the want of a nail."}, +cases_test.go:43: line is 186 characters (lll) + expected: []string{"For want of a pin the gun was lost.", "For want of a gun the soldier was lost.", "For want of a soldier the battle was lost.", "And all for the want of a pin."}, +proverb_test.go:11:22: Using the variable on range scope `tc` in function literal (scopelint) + actual := Proverb(tc.input) + ^ +proverb_test.go:12:54: Using the variable on range scope `tc` in function literal (scopelint) + if fmt.Sprintf("%q", actual) != fmt.Sprintf("%q", tc.expected) { + ^ +proverb_test.go:13:50: Using the variable on range scope `tc` in function literal (scopelint) + t.Errorf("Proverb(%#v)\n got:%#v\nwant:%#v", tc.input, actual, tc.expected) + ^ +proverb_test.go:23:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:14:5: testCases is a global variable (gochecknoglobals) +var testCases = []proverbTest{ + ^ +proverb_test.go:8:1: Function TestProverb missing the call to method parallel (paralleltest) +func TestProverb(t *testing.T) { +^ +proverb_test.go:9:2: Range statement for test TestProverb missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +cases_test.go:1:9: package should be `proverb_test` instead of `proverb` (testpackage) +package proverb + ^ +proverb_examples_test.go:1:9: package should be `proverb_test` instead of `proverb` (testpackage) +package proverb + ^ +proverb_test.go:1:9: package should be `proverb_test` instead of `proverb` (testpackage) +package proverb + ^ + +real 0m0.509s +user 0m0.771s +sys 0m0.458s + + + ============================================================================== + +Exit code: -1 + +real 0m0.538s +user 0m0.790s +sys 0m0.496s + +real 0m0.540s +user 0m0.791s +sys 0m0.497s -real 0m0.181s -user 0m0.101s -sys 0m0.149s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.015s +sys 0m0.024s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.026s +user 0m0.013s +sys 0m0.018s + + + ============================================================================== + +Exit code: 0 + +real 0m0.058s +user 0m0.034s +sys 0m0.050s + +real 0m0.060s +user 0m0.035s +sys 0m0.051s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out proverb +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.019s +sys 0m0.024s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "proverb" + +real 0m0.083s +user 0m0.108s +sys 0m0.102s + + + ============================================================================== + +Exit code: -1 + +real 0m0.115s +user 0m0.131s +sys 0m0.134s + +real 0m0.117s +user 0m0.132s +sys 0m0.135s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.019s +sys 0m0.023s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.153s +user 0m0.178s +sys 0m0.109s + + + ============================================================================== + +Exit code: 0 + +real 0m0.186s +user 0m0.204s +sys 0m0.138s + +real 0m0.188s +user 0m0.204s +sys 0m0.140s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.018s +sys 0m0.033s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.866s +user 0m2.065s +sys 0m0.300s + + + ============================================================================== + +Exit code: 0 + +real 0m0.908s +user 0m2.090s +sys 0m0.345s + +real 0m0.910s +user 0m2.092s +sys 0m0.345s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.034s +user 0m0.026s +sys 0m0.035s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.085s +user 0m0.112s +sys 0m0.117s + + + ============================================================================== + +Exit code: 0 + +real 0m0.136s +user 0m0.148s +sys 0m0.165s + +real 0m0.138s +user 0m0.149s +sys 0m0.165s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.014s +sys 0m0.019s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.024s +user 0m0.020s +sys 0m0.023s + + + ============================================================================== + +Exit code: 0 + +real 0m0.061s +user 0m0.039s +sys 0m0.060s + +real 0m0.063s +user 0m0.039s +sys 0m0.062s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.016s +sys 0m0.020s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.436s +user 0m1.350s +sys 0m0.286s + + + ============================================================================== + +Exit code: 0 + +real 0m0.472s +user 0m1.373s +sys 0m0.316s + +real 0m0.474s +user 0m1.374s +sys 0m0.318s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.022s +sys 0m0.019s + + + ============================================================================== + +Running: gocyclo . + +4 proverb BenchmarkProverb proverb_test.go:19:1 +3 proverb TestProverb proverb_test.go:8:1 +3 proverb Proverb proverb.go:7:1 +2 proverb ExampleProverb proverb_examples_test.go:7:1 + +real 0m0.003s +user 0m0.001s +sys 0m0.001s + + + ============================================================================== + +Exit code: 0 + +real 0m0.038s +user 0m0.031s +sys 0m0.028s + +real 0m0.040s +user 0m0.033s +sys 0m0.028s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.028s +user 0m0.030s +sys 0m0.009s + + + ============================================================================== + +Exit code: 0 + +real 0m0.041s +user 0m0.037s +sys 0m0.020s + +real 0m0.043s +user 0m0.039s +sys 0m0.020s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.009s +sys 0m0.023s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:26:48 Including rules: default +[gosec] 2023/09/07 00:26:48 Excluding rules: default +[gosec] 2023/09/07 00:26:48 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/proverb +[gosec] 2023/09/07 00:26:49 Checking package: proverb +[gosec] 2023/09/07 00:26:49 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/proverb/proverb.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 27 + Nosec : 0 + Issues : 0 + + +real 0m0.110s +user 0m0.124s +sys 0m0.097s + + + ============================================================================== + +Exit code: 0 + +real 0m0.141s +user 0m0.137s +sys 0m0.128s + +real 0m0.143s +user 0m0.138s +sys 0m0.129s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.019s +sys 0m0.022s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestProverb === RUN TestProverb/zero_pieces === RUN TestProverb/one_piece @@ -32,33 +585,54 @@ go test -v -covermode=count -coverprofile coverage.out proverb --- PASS: ExampleProverb (0.00s) PASS coverage: 100.0% of statements -ok proverb 0.007s coverage: 100.0% of statements +ok proverb 0.003s coverage: 100.0% of statements -real 0m0.646s -user 0m0.572s -sys 0m0.507s +real 0m0.162s +user 0m0.212s +sys 0m0.141s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + proverb/proverb.go:7: Proverb 100.0% total: (statements) 100.0% -real 0m0.166s -user 0m0.157s -sys 0m0.166s +real 0m0.052s +user 0m0.082s +sys 0m0.069s + -=============================================================================== + ============================================================================== -go tool cover -html coverage.out -o coverage.html +Running: go tool cover -html coverage.out -o coverage.html -real 0m0.153s -user 0m0.134s -sys 0m0.186s -=============================================================================== +real 0m0.053s +user 0m0.062s +sys 0m0.072s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.019s +user 0m0.020s +sys 0m0.016s + +real 0m0.019s +user 0m0.020s +sys 0m0.016s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -go test -v -race -covermode=atomic proverb === RUN TestProverb === RUN TestProverb/zero_pieces === RUN TestProverb/one_piece @@ -77,125 +651,120 @@ go test -v -race -covermode=atomic proverb --- PASS: ExampleProverb (0.00s) PASS coverage: 100.0% of statements -ok proverb 0.034s coverage: 100.0% of statements +ok proverb 1.016s coverage: 100.0% of statements + +real 0m1.228s +user 0m0.284s +sys 0m0.177s + -real 0m0.989s -user 0m0.844s -sys 0m0.589s + ============================================================================== + +Exit code: 0 + +real 0m1.554s +user 0m0.689s +sys 0m0.506s + +real 0m1.557s +user 0m0.691s +sys 0m0.507s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: proverb -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkProverb-4 170331 8278 ns/op 1728 B/op 59 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkProverb +BenchmarkProverb-8 405014 2912 ns/op 1728 B/op 59 allocs/op PASS -ok proverb 1.519s +ok proverb 2.123s -real 0m2.097s -user 0m2.724s -sys 0m0.620s +real 0m2.269s +user 0m2.360s +sys 0m0.157s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestProverb +=== RUN TestProverb/zero_pieces +=== RUN TestProverb/one_piece +=== RUN TestProverb/two_pieces +=== RUN TestProverb/three_pieces +=== RUN TestProverb/full_proverb +=== RUN TestProverb/four_pieces_modernized +--- PASS: TestProverb (0.00s) + --- PASS: TestProverb/zero_pieces (0.00s) + --- PASS: TestProverb/one_piece (0.00s) + --- PASS: TestProverb/two_pieces (0.00s) + --- PASS: TestProverb/three_pieces (0.00s) + --- PASS: TestProverb/full_proverb (0.00s) + --- PASS: TestProverb/four_pieces_modernized (0.00s) +=== RUN ExampleProverb +--- PASS: ExampleProverb (0.00s) PASS -ok proverb 0.004s +ok proverb 0.002s -real 0m0.563s -user 0m0.593s -sys 0m0.427s +real 0m0.124s +user 0m0.165s +sys 0m0.108s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m4.425s -user 0m2.051s -sys 0m0.840s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -Proverb-4 9.26µs ± 0% 8.28µs ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -Proverb-4 1.73kB ± 0% 1.73kB ± 0% ~ (all equal) - -name old allocs/op new allocs/op delta -Proverb-4 59.0 ± 0% 59.0 ± 0% ~ (all equal) - -real 0m0.037s -user 0m0.028s -sys 0m0.026s - -=============================================================================== - -go vet proverb - -real 0m0.414s -user 0m0.347s -sys 0m0.408s - -=============================================================================== - -go fix proverb - -real 0m0.134s -user 0m0.057s -sys 0m0.119s - -=============================================================================== - -ineffassign ./... - -real 0m0.369s -user 0m0.341s -sys 0m0.411s - -=============================================================================== - -gocyclo . -4 proverb BenchmarkProverb proverb_test.go:19:1 -3 proverb TestProverb proverb_test.go:8:1 -3 proverb Proverb proverb.go:7:1 -2 proverb ExampleProverb proverb_examples_test.go:7:1 - -real 0m0.024s -user 0m0.002s -sys 0m0.009s - -=============================================================================== - -misspell . +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: proverb +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Proverb-8 2.912µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Proverb-8 1.688Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Proverb-8 59.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.151s -user 0m0.120s -sys 0m0.070s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Proverb-4 8.278µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +Proverb-4 1.688Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./proverb -[gosec] 2022/08/16 21:50:23 Including rules: default -[gosec] 2022/08/16 21:50:23 Excluding rules: default -[gosec] 2022/08/16 21:50:23 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/proverb -2022/08/16 21:50:23 internal error: package "fmt" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +Proverb-4 59.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.481s -user 0m0.468s -sys 0m0.385s +real 0m0.007s +user 0m0.001s +sys 0m0.003s =============================================================================== gomarkdoc --output proverb-doc.md -real 0m0.052s -user 0m0.024s -sys 0m0.023s +real 0m0.008s +user 0m0.006s +sys 0m0.003s =============================================================================== @@ -210,9 +779,9 @@ func Proverb(words []string) []string Proverb returns a proverbial rhyme given a slice of words. -real 0m0.158s -user 0m0.110s -sys 0m0.150s +real 0m0.042s +user 0m0.025s +sys 0m0.042s =============================================================================== diff --git a/go/pythagorean-triplet/coverage.out b/go/pythagorean-triplet/coverage.out index 23e559d0..c0da6e27 100644 --- a/go/pythagorean-triplet/coverage.out +++ b/go/pythagorean-triplet/coverage.out @@ -1,24 +1,24 @@ mode: count pythagorean/pythagorean_triplet.go:9.36,12.37 2 9 -pythagorean/pythagorean_triplet.go:16.2,16.30 1 8 -pythagorean/pythagorean_triplet.go:26.2,26.17 1 8 pythagorean/pythagorean_triplet.go:12.37,14.3 1 1 +pythagorean/pythagorean_triplet.go:16.2,16.30 1 8 pythagorean/pythagorean_triplet.go:16.30,17.29 1 2400 pythagorean/pythagorean_triplet.go:17.29,18.30 1 1033800 pythagorean/pythagorean_triplet.go:18.30,19.42 1 336311400 pythagorean/pythagorean_triplet.go:19.42,21.6 1 1986 +pythagorean/pythagorean_triplet.go:26.2,26.17 1 8 pythagorean/pythagorean_triplet.go:30.24,32.2 1 1008934212 pythagorean/pythagorean_triplet.go:35.49,37.20 1 336311405 -pythagorean/pythagorean_triplet.go:42.2,42.38 1 336311404 -pythagorean/pythagorean_triplet.go:46.2,46.13 1 1988 pythagorean/pythagorean_triplet.go:37.20,39.3 1 1 +pythagorean/pythagorean_triplet.go:42.2,42.38 1 336311404 pythagorean/pythagorean_triplet.go:42.38,44.3 1 336309416 +pythagorean/pythagorean_triplet.go:46.2,46.13 1 1988 pythagorean/pythagorean_triplet.go:50.32,53.22 2 1983 -pythagorean/pythagorean_triplet.go:57.2,57.12 1 1983 pythagorean/pythagorean_triplet.go:53.22,55.3 1 5949 +pythagorean/pythagorean_triplet.go:57.2,57.12 1 1983 pythagorean/pythagorean_triplet.go:62.35,63.19 1 5 -pythagorean/pythagorean_triplet.go:67.2,69.46 2 4 -pythagorean/pythagorean_triplet.go:75.2,75.17 1 4 pythagorean/pythagorean_triplet.go:63.19,65.3 1 1 +pythagorean/pythagorean_triplet.go:67.2,69.46 2 4 pythagorean/pythagorean_triplet.go:69.46,70.39 1 1980 pythagorean/pythagorean_triplet.go:70.39,72.4 1 8 +pythagorean/pythagorean_triplet.go:75.2,75.17 1 4 diff --git a/go/pythagorean-triplet/run-tests-go.txt b/go/pythagorean-triplet/run-tests-go.txt index f632a730..ee0cb348 100644 --- a/go/pythagorean-triplet/run-tests-go.txt +++ b/go/pythagorean-triplet/run-tests-go.txt @@ -5,80 +5,431 @@ Go packages: pythagorean =============================================================================== -golangci-lint run ./... - -real 0m10.178s -user 0m19.502s -sys 0m3.677s +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.016s +user 0m0.008s +sys 0m0.011s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +pythagorean_triplet.go:5:40: Comment should end in a period (godot) +// for a^2 + b^2 = c^2 -> a + b + c = N + ^ +pythagorean-triplet_examples_test.go:39: File is not `gofmt`-ed with `-s` (gofmt) + Triplet{0, 0, 0}, + Triplet{1, 2, 3}, + Triplet{3, 4, 5}, +pythagorean_triplet_test.go:48:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +pythagorean_triplet_test.go:57:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +pythagorean-triplet_examples_test.go:33:2: Duplicate words (false) found (dupword) + // false + ^ +pythagorean_triplet_test.go:8:5: rangeTests is a global variable (gochecknoglobals) +var rangeTests = []struct { + ^ +pythagorean_triplet_test.go:26:5: sumTests is a global variable (gochecknoglobals) +var sumTests = []struct { + ^ +pythagorean_triplet_test.go:16:1: Function TestRange missing the call to method parallel (paralleltest) +func TestRange(t *testing.T) { +^ +pythagorean_triplet_test.go:34:1: Function TestSum missing the call to method parallel (paralleltest) +func TestSum(t *testing.T) { +^ +pythagorean-triplet_examples_test.go:1:9: package should be `pythagorean_test` instead of `pythagorean` (testpackage) +package pythagorean + ^ +pythagorean_triplet_test.go:1:9: package should be `pythagorean_test` instead of `pythagorean` (testpackage) +package pythagorean + ^ +pythagorean_triplet.go:35:31: parameter name 'a' is too short for the scope of its usage (varnamelen) +func CheckPythagoreanTriplets(a, b, c int) bool { + ^ + +real 0m0.481s +user 0m0.795s +sys 0m0.431s + + + ============================================================================== + +Exit code: -1 + +real 0m0.507s +user 0m0.809s +sys 0m0.451s + +real 0m0.509s +user 0m0.810s +sys 0m0.452s =============================================================================== -golint ./... +Running: ../../.github/citools/go/go-lint-revive -real 0m0.111s -user 0m0.103s -sys 0m0.065s +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 -=============================================================================== -revive -formatter=stylish ./... + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.002s +sys 0m0.015s -real 0m0.079s + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.072s user 0m0.038s -sys 0m0.024s +sys 0m0.054s + + + ============================================================================== + +Exit code: 0 + +real 0m0.099s +user 0m0.051s +sys 0m0.075s + +real 0m0.101s +user 0m0.052s +sys 0m0.077s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.516s -user 0m0.465s -sys 0m0.504s +real 0m0.001s +user 0m0.000s +sys 0m0.001s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.011s +sys 0m0.017s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." +internal error: package "fmt" without types was imported from "pythagorean [pythagorean.test]" -real 0m0.534s -user 0m0.515s -sys 0m0.525s +real 0m0.102s +user 0m0.131s +sys 0m0.140s + + + ============================================================================== + +Exit code: -1 + +real 0m0.142s +user 0m0.156s +sys 0m0.170s + +real 0m0.145s +user 0m0.157s +sys 0m0.173s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.010s +sys 0m0.014s + + + ============================================================================== -real 0m0.593s -user 0m0.675s -sys 0m0.591s +Running: staticcheck -checks=all ./... + + +real 0m0.188s +user 0m0.225s +sys 0m0.131s + + + ============================================================================== + +Exit code: 0 + +real 0m0.222s +user 0m0.246s +sys 0m0.155s + +real 0m0.225s +user 0m0.246s +sys 0m0.157s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + -real 0m3.538s -user 0m6.024s -sys 0m1.526s +real 0m0.023s +user 0m0.014s +sys 0m0.016s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.822s +user 0m2.077s +sys 0m0.250s + + + ============================================================================== + +Exit code: 0 + +real 0m0.862s +user 0m2.101s +sys 0m0.277s + +real 0m0.865s +user 0m2.103s +sys 0m0.278s =============================================================================== -go vet ./... +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== -real 0m0.315s -user 0m0.307s -sys 0m0.395s +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.009s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.068s +user 0m0.105s +sys 0m0.088s + + + ============================================================================== + +Exit code: 0 + +real 0m0.091s +user 0m0.116s +sys 0m0.104s + +real 0m0.093s +user 0m0.116s +sys 0m0.106s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix -real 0m0.085s -user 0m0.021s -sys 0m0.082s +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.004s +sys 0m0.011s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.014s +user 0m0.007s +sys 0m0.011s + + + ============================================================================== + +Exit code: 0 + +real 0m0.036s +user 0m0.019s +sys 0m0.027s + +real 0m0.038s +user 0m0.020s +sys 0m0.028s =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.010s +user 0m0.005s +sys 0m0.008s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.413s +user 0m1.275s +sys 0m0.245s + + + ============================================================================== + +Exit code: 0 + +real 0m0.434s +user 0m1.285s +sys 0m0.261s + +real 0m0.436s +user 0m1.286s +sys 0m0.262s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.010s +user 0m0.006s +sys 0m0.007s + + + ============================================================================== + +Running: gocyclo . + 8 pythagorean Range pythagorean_triplet.go:9:1 4 pythagorean Sum pythagorean_triplet.go:62:1 4 pythagorean CheckPythagoreanTriplets pythagorean_triplet.go:35:1 @@ -94,148 +445,143 @@ gocyclo . 1 pythagorean ExampleCheckPythagoreanTriplets pythagorean-triplet_examples_test.go:23:1 1 pythagorean ExampleSquare pythagorean-triplet_examples_test.go:12:1 -real 0m0.020s +real 0m0.002s user 0m0.002s -sys 0m0.009s +sys 0m0.000s -=============================================================================== -misspell . + ============================================================================== + +Exit code: 0 + +real 0m0.022s +user 0m0.013s +sys 0m0.015s -real 0m0.129s -user 0m0.087s -sys 0m0.107s +real 0m0.024s +user 0m0.013s +sys 0m0.016s =============================================================================== -gosec ./... -[gosec] 2022/09/12 20:08:28 Including rules: default -[gosec] 2022/09/12 20:08:28 Excluding rules: default -[gosec] 2022/09/12 20:08:28 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/pythagorean-triplet -[gosec] 2022/09/12 20:08:28 Checking package: pythagorean -[gosec] 2022/09/12 20:08:28 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/pythagorean-triplet/pythagorean_triplet.go -Results: +Running: ../../.github/citools/go/go-lint-misspell +Running Go misspell -Summary: - Files: 1 - Lines: 76 - Nosec: 0 - Issues: 0 +Go version: + go version go1.21.0 linux/amd64 -real 0m0.327s -user 0m0.312s -sys 0m0.260s -=============================================================================== + ============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... -=== RUN TestRange ---- PASS: TestRange (0.00s) -=== RUN TestSum ---- PASS: TestSum (1.07s) -=== RUN ExampleSquare ---- PASS: ExampleSquare (0.00s) -=== RUN ExampleCheckPythagoreanTriplets ---- PASS: ExampleCheckPythagoreanTriplets (0.00s) -=== RUN ExampleTripletSum ---- PASS: ExampleTripletSum (0.00s) -=== RUN ExampleRange ---- PASS: ExampleRange (0.00s) -=== RUN ExampleSum ---- PASS: ExampleSum (1.17s) -PASS -coverage: 100.0% of statements -ok pythagorean 2.251s coverage: 100.0% of statements +Running: misspell . -real 0m3.048s -user 0m3.147s -sys 0m0.661s -=============================================================================== +real 0m0.029s +user 0m0.030s +sys 0m0.013s -go tool cover -func=coverage.out -pythagorean/pythagorean_triplet.go:9: Range 100.0% -pythagorean/pythagorean_triplet.go:30: Square 100.0% -pythagorean/pythagorean_triplet.go:35: CheckPythagoreanTriplets 100.0% -pythagorean/pythagorean_triplet.go:50: TripletSum 100.0% -pythagorean/pythagorean_triplet.go:62: Sum 100.0% -total: (statements) 100.0% -real 0m0.113s -user 0m0.060s -sys 0m0.129s + ============================================================================== -=============================================================================== +Exit code: 0 -go tool cover -html coverage.out -o coverage.html +real 0m0.041s +user 0m0.041s +sys 0m0.018s -real 0m0.096s -user 0m0.049s -sys 0m0.113s +real 0m0.043s +user 0m0.043s +sys 0m0.018s =============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +Running: ../../.github/citools/go/go-lint-gosec -real 0m0.044s -user 0m0.023s -sys 0m0.042s +Running Go GoSec -=============================================================================== +Go version: -gotest -v -race -covermode=atomic ./... -=== RUN TestRange ---- PASS: TestRange (0.00s) -=== RUN TestSum ---- PASS: TestSum (273.20s) -=== RUN ExampleSquare ---- PASS: ExampleSquare (0.00s) -=== RUN ExampleCheckPythagoreanTriplets ---- PASS: ExampleCheckPythagoreanTriplets (0.00s) -=== RUN ExampleTripletSum ---- PASS: ExampleTripletSum (0.00s) -=== RUN ExampleRange ---- PASS: ExampleRange (0.00s) -=== RUN ExampleSum ---- PASS: ExampleSum (192.92s) -PASS -coverage: 100.0% of statements -ok pythagorean 466.173s coverage: 100.0% of statements + go version go1.21.0 linux/amd64 -real 7m47.257s -user 7m1.347s -sys 0m15.339s -=============================================================================== + ============================================================================== -mv -v benchstat-new.txt benchstat-old.txt -renamed 'benchstat-new.txt' -> 'benchstat-old.txt' - -gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt -goos: linux -goarch: amd64 -pkg: pythagorean -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkRange -BenchmarkRange-4 3255 352880 ns/op 3048 B/op 7 allocs/op -BenchmarkSum -BenchmarkSum-4 4 309411584 ns/op 77824 B/op 13 allocs/op -PASS -ok pythagorean 4.563s +Running: go clean ./... + + +real 0m0.015s +user 0m0.009s +sys 0m0.010s -real 0m6.022s -user 0m5.380s -sys 0m1.064s + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:26:55 Including rules: default +[gosec] 2023/09/07 00:26:55 Excluding rules: default +[gosec] 2023/09/07 00:26:55 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/pythagorean-triplet +[gosec] 2023/09/07 00:26:55 Checking package: pythagorean +[gosec] 2023/09/07 00:26:55 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/pythagorean-triplet/pythagorean_triplet.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 76 + Nosec : 0 + Issues : 0 + + +real 0m0.072s +user 0m0.070s +sys 0m0.039s + + + ============================================================================== + +Exit code: 0 + +real 0m0.104s +user 0m0.083s +sys 0m0.067s + +real 0m0.106s +user 0m0.085s +sys 0m0.067s =============================================================================== -gotest -v -tags bonus +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.007s +sys 0m0.018s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestRange --- PASS: TestRange (0.00s) === RUN TestSum ---- PASS: TestSum (0.38s) +--- PASS: TestSum (0.51s) === RUN ExampleSquare --- PASS: ExampleSquare (0.00s) === RUN ExampleCheckPythagoreanTriplets @@ -245,79 +591,61 @@ gotest -v -tags bonus === RUN ExampleRange --- PASS: ExampleRange (0.00s) === RUN ExampleSum ---- PASS: ExampleSum (0.30s) +--- PASS: ExampleSum (0.48s) PASS -ok pythagorean 0.697s - -real 0m1.265s -user 0m1.224s -sys 0m0.643s - -=============================================================================== - -benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -Range-4 362µs ± 0% 353µs ± 0% ~ (p=1.000 n=1+1) -Sum-4 335ms ± 0% 309ms ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -Range-4 3.05kB ± 0% 3.05kB ± 0% ~ (all equal) -Sum-4 77.8kB ± 0% 77.8kB ± 0% ~ (all equal) - -name old allocs/op new allocs/op delta -Range-4 7.00 ± 0% 7.00 ± 0% ~ (all equal) -Sum-4 13.0 ± 0% 13.0 ± 0% ~ (all equal) +coverage: 100.0% of statements +ok pythagorean 0.993s coverage: 100.0% of statements -real 0m0.057s -user 0m0.027s -sys 0m0.025s +real 0m1.169s +user 0m1.217s +sys 0m0.157s -=============================================================================== -gomarkdoc --output pythagorean-doc.md + ============================================================================== -real 0m0.087s -user 0m0.015s -sys 0m0.026s +Running: go tool cover -func=coverage.out -=============================================================================== +pythagorean/pythagorean_triplet.go:9: Range 100.0% +pythagorean/pythagorean_triplet.go:30: Square 100.0% +pythagorean/pythagorean_triplet.go:35: CheckPythagoreanTriplets 100.0% +pythagorean/pythagorean_triplet.go:50: TripletSum 100.0% +pythagorean/pythagorean_triplet.go:62: Sum 100.0% +total: (statements) 100.0% -go doc -all pythagorean -package pythagorean // import "pythagorean" +real 0m0.022s +user 0m0.010s +sys 0m0.017s -Package pythagorean is used to find the triplets that sum to N. -FUNCTIONS + ============================================================================== -func CheckPythagoreanTriplets(a, b, c int) bool - CheckPythagoreanTriplets returns true when the triplets pass the checks. +Running: go tool cover -html coverage.out -o coverage.html -func Square(n int) int - Square returns the passed number to the power of 2. -func TripletSum(t Triplet) int - TripletSum returns the sum of the Pythagorean Triplets. +real 0m0.031s +user 0m0.019s +sys 0m0.022s -TYPES + ============================================================================== -type Triplet [3]int - Triplet represents the Pythagorean Triplet. for a^2 + b^2 = c^2 -> a + b + c - = N +Running: cover_annotate -func Range(min, max int) []Triplet - Range returns a list of all Pythagorean triplets with side lengths in the - provided range. +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt -func Sum(perimeter int) []Triplet - Sum returns a list of all Pythagorean triplets with a certain perimeter. - The instructions are really vague, I'm guessing min=1 and max=perimeter. +real 0m0.010s +user 0m0.005s +sys 0m0.010s +real 0m0.010s +user 0m0.005s +sys 0m0.010s -real 0m0.135s -user 0m0.065s -sys 0m0.103s + ============================================================================== -=============================================================================== +Running: gotest -v -race -covermode=atomic ./... +=== RUN TestRange +--- PASS: TestRange (0.00s) +=== RUN TestSum diff --git a/go/raindrops/benchstat-new.txt b/go/raindrops/benchstat-new.txt new file mode 100644 index 00000000..3da21c9e --- /dev/null +++ b/go/raindrops/benchstat-new.txt @@ -0,0 +1,8 @@ +goos: linux +goarch: amd64 +pkg: raindrops +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkConvert +BenchmarkConvert-8 1866162 644.3 ns/op 290 B/op 19 allocs/op +PASS +ok raindrops 1.861s diff --git a/go/raindrops/coverage-annotations.txt b/go/raindrops/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/raindrops/coverage.html b/go/raindrops/coverage.html new file mode 100644 index 00000000..b891575f --- /dev/null +++ b/go/raindrops/coverage.html @@ -0,0 +1,151 @@ + + + + + + raindrops: Go Coverage Report + + + +

+ +
+ not tracked + + no coverage + low coverage + * + * + * + * + * + * + * + * + high coverage + +
+
+
+ + + +
+ + + diff --git a/go/raindrops/coverage.out b/go/raindrops/coverage.out index b6ca1c1f..3912c16c 100644 --- a/go/raindrops/coverage.out +++ b/go/raindrops/coverage.out @@ -1,10 +1,10 @@ mode: count raindrops/raindrops.go:10.33,16.19 3 27 -raindrops/raindrops.go:21.2,21.19 1 27 -raindrops/raindrops.go:26.2,26.19 1 27 -raindrops/raindrops.go:32.2,32.23 1 27 -raindrops/raindrops.go:38.2,38.24 1 27 raindrops/raindrops.go:16.19,19.3 1 11 +raindrops/raindrops.go:21.2,21.19 1 27 raindrops/raindrops.go:21.19,24.3 1 11 +raindrops/raindrops.go:26.2,26.19 1 27 raindrops/raindrops.go:26.19,29.3 1 9 +raindrops/raindrops.go:32.2,32.23 1 27 raindrops/raindrops.go:32.23,35.3 1 5 +raindrops/raindrops.go:38.2,38.24 1 27 diff --git a/go/raindrops/raindrops-doc.md b/go/raindrops/raindrops-doc.md index 78bb5891..ae2dffad 100755 --- a/go/raindrops/raindrops-doc.md +++ b/go/raindrops/raindrops-doc.md @@ -6,7 +6,7 @@ import "raindrops" ``` -Package raindrops converts a number into a string that contains raindrop sounds corresponding to certain potential factors\. +Package raindrops converts a number into a string that contains raindrop sounds corresponding to certain potential factors. ## Index @@ -19,7 +19,7 @@ Package raindrops converts a number into a string that contains raindrop sounds func Convert(number int) string ``` -Convert returns a string containing raindrop sounds corresponding to factors of the number\, \`int\`\, given\. +Convert returns a string containing raindrop sounds corresponding to factors of the number, \`int\`, given.
Example

diff --git a/go/raindrops/raindrops-doc.txt b/go/raindrops/raindrops-doc.txt index 1b41eeb2..6364e178 100644 --- a/go/raindrops/raindrops-doc.txt +++ b/go/raindrops/raindrops-doc.txt @@ -1,7 +1,7 @@ package raindrops // import "raindrops" -Package raindrops converts a number into a string that contains raindrop -sounds corresponding to certain potential factors. +Package raindrops converts a number into a string that contains raindrop sounds +corresponding to certain potential factors. FUNCTIONS diff --git a/go/raindrops/run-tests-go.txt b/go/raindrops/run-tests-go.txt index 7006ab14..c04a1c63 100644 --- a/go/raindrops/run-tests-go.txt +++ b/go/raindrops/run-tests-go.txt @@ -5,120 +5,800 @@ Go packages: raindrops =============================================================================== -golint raindrops +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.019s +sys 0m0.031s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +raindrops.go:1: line is 126 characters (lll) +// Package raindrops converts a number into a string that contains raindrop sounds corresponding to certain potential factors. +raindrops_test.go:8:25: Using the variable on range scope `tc` in function literal (scopelint) + if actual := Convert(tc.input); actual != tc.expected { + ^ +raindrops_test.go:9:44: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("Convert(%d) = %q, want: %q", tc.input, actual, tc.expected) + ^ +raindrops_test.go:19:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +raindrops.go:14:14: mnd: Magic number: 15, in detected (gomnd) + sounds.Grow(15) + ^ +raindrops_test.go:5:1: Function TestConvert missing the call to method parallel (paralleltest) +func TestConvert(t *testing.T) { +^ +raindrops_test.go:6:2: Range statement for test TestConvert missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +cases_test.go:1:9: package should be `raindrops_test` instead of `raindrops` (testpackage) +package raindrops + ^ +raindrops_examples_test.go:1:9: package should be `raindrops_test` instead of `raindrops` (testpackage) +package raindrops + ^ +raindrops_test.go:1:9: package should be `raindrops_test` instead of `raindrops` (testpackage) +package raindrops + ^ + +real 0m0.471s +user 0m0.721s +sys 0m0.531s + + + ============================================================================== + +Exit code: -1 + +real 0m0.505s +user 0m0.744s +sys 0m0.570s + +real 0m0.506s +user 0m0.745s +sys 0m0.572s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.021s +sys 0m0.022s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.043s +user 0m0.019s +sys 0m0.034s + + + ============================================================================== + +Exit code: 0 + +real 0m0.077s +user 0m0.045s +sys 0m0.065s + +real 0m0.079s +user 0m0.046s +sys 0m0.067s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.034s +user 0m0.027s +sys 0m0.036s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "raindrops" + +real 0m0.095s +user 0m0.145s +sys 0m0.122s + + + ============================================================================== + +Exit code: -1 + +real 0m0.148s +user 0m0.179s +sys 0m0.176s + +real 0m0.151s +user 0m0.181s +sys 0m0.177s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.017s +sys 0m0.022s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.170s +user 0m0.212s +sys 0m0.120s + + + ============================================================================== + +Exit code: 0 + +real 0m0.204s +user 0m0.235s +sys 0m0.152s + +real 0m0.207s +user 0m0.238s +sys 0m0.152s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.022s +sys 0m0.018s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.879s +user 0m2.046s +sys 0m0.346s + + + ============================================================================== + +Exit code: 0 + +real 0m0.918s +user 0m2.079s +sys 0m0.376s + +real 0m0.920s +user 0m2.080s +sys 0m0.377s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.021s +sys 0m0.030s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.091s +user 0m0.161s +sys 0m0.133s + + + ============================================================================== + +Exit code: 0 + +real 0m0.125s +user 0m0.190s +sys 0m0.172s + +real 0m0.127s +user 0m0.191s +sys 0m0.173s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.035s +sys 0m0.017s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.023s +user 0m0.019s +sys 0m0.024s + + + ============================================================================== + +Exit code: 0 + +real 0m0.063s +user 0m0.064s +sys 0m0.047s + +real 0m0.065s +user 0m0.065s +sys 0m0.047s -real 0m0.177s -user 0m0.193s -sys 0m0.185s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.020s +sys 0m0.029s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.472s +user 0m1.310s +sys 0m0.292s + + + ============================================================================== + +Exit code: 0 + +real 0m0.510s +user 0m1.336s +sys 0m0.331s + +real 0m0.512s +user 0m1.338s +sys 0m0.331s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.016s +sys 0m0.028s + + + ============================================================================== + +Running: gocyclo . + +5 raindrops Convert raindrops.go:10:1 +4 raindrops BenchmarkConvert raindrops_test.go:15:1 +3 raindrops TestConvert raindrops_test.go:5:1 +2 raindrops ExampleConvert raindrops_examples_test.go:7:1 + +real 0m0.003s +user 0m0.000s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.043s +user 0m0.020s +sys 0m0.043s + +real 0m0.045s +user 0m0.020s +sys 0m0.044s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.031s +user 0m0.030s +sys 0m0.017s + + + ============================================================================== + +Exit code: 0 + +real 0m0.049s +user 0m0.040s +sys 0m0.034s + +real 0m0.054s +user 0m0.042s +sys 0m0.036s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.015s +sys 0m0.035s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:29:23 Including rules: default +[gosec] 2023/09/07 00:29:23 Excluding rules: default +[gosec] 2023/09/07 00:29:23 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/raindrops +[gosec] 2023/09/07 00:29:23 Checking package: raindrops +[gosec] 2023/09/07 00:29:23 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/raindrops/raindrops.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 39 + Nosec : 0 + Issues : 0 + + +real 0m0.127s +user 0m0.132s +sys 0m0.111s + + + ============================================================================== + +Exit code: 0 + +real 0m0.173s +user 0m0.154s +sys 0m0.162s + +real 0m0.176s +user 0m0.155s +sys 0m0.163s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out raindrops +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.027s +sys 0m0.028s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestConvert +=== RUN TestConvert/the_sound_for_1_is_1 +=== RUN TestConvert/the_sound_for_3_is_Pling +=== RUN TestConvert/the_sound_for_5_is_Plang +=== RUN TestConvert/the_sound_for_7_is_Plong +=== RUN TestConvert/the_sound_for_6_is_Pling_as_it_has_a_factor_3 +=== RUN TestConvert/2_to_the_power_3_does_not_make_a_raindrop_sound_as_3_is_the_exponent_not_the_base +=== RUN TestConvert/the_sound_for_9_is_Pling_as_it_has_a_factor_3 +=== RUN TestConvert/the_sound_for_10_is_Plang_as_it_has_a_factor_5 +=== RUN TestConvert/the_sound_for_14_is_Plong_as_it_has_a_factor_of_7 +=== RUN TestConvert/the_sound_for_15_is_PlingPlang_as_it_has_factors_3_and_5 +=== RUN TestConvert/the_sound_for_21_is_PlingPlong_as_it_has_factors_3_and_7 +=== RUN TestConvert/the_sound_for_25_is_Plang_as_it_has_a_factor_5 +=== RUN TestConvert/the_sound_for_27_is_Pling_as_it_has_a_factor_3 +=== RUN TestConvert/the_sound_for_35_is_PlangPlong_as_it_has_factors_5_and_7 +=== RUN TestConvert/the_sound_for_49_is_Plong_as_it_has_a_factor_7 +=== RUN TestConvert/the_sound_for_52_is_52 +=== RUN TestConvert/the_sound_for_105_is_PlingPlangPlong_as_it_has_factors_3,_5_and_7 +=== RUN TestConvert/the_sound_for_3125_is_Plang_as_it_has_a_factor_5 --- PASS: TestConvert (0.00s) + --- PASS: TestConvert/the_sound_for_1_is_1 (0.00s) + --- PASS: TestConvert/the_sound_for_3_is_Pling (0.00s) + --- PASS: TestConvert/the_sound_for_5_is_Plang (0.00s) + --- PASS: TestConvert/the_sound_for_7_is_Plong (0.00s) + --- PASS: TestConvert/the_sound_for_6_is_Pling_as_it_has_a_factor_3 (0.00s) + --- PASS: TestConvert/2_to_the_power_3_does_not_make_a_raindrop_sound_as_3_is_the_exponent_not_the_base (0.00s) + --- PASS: TestConvert/the_sound_for_9_is_Pling_as_it_has_a_factor_3 (0.00s) + --- PASS: TestConvert/the_sound_for_10_is_Plang_as_it_has_a_factor_5 (0.00s) + --- PASS: TestConvert/the_sound_for_14_is_Plong_as_it_has_a_factor_of_7 (0.00s) + --- PASS: TestConvert/the_sound_for_15_is_PlingPlang_as_it_has_factors_3_and_5 (0.00s) + --- PASS: TestConvert/the_sound_for_21_is_PlingPlong_as_it_has_factors_3_and_7 (0.00s) + --- PASS: TestConvert/the_sound_for_25_is_Plang_as_it_has_a_factor_5 (0.00s) + --- PASS: TestConvert/the_sound_for_27_is_Pling_as_it_has_a_factor_3 (0.00s) + --- PASS: TestConvert/the_sound_for_35_is_PlangPlong_as_it_has_factors_5_and_7 (0.00s) + --- PASS: TestConvert/the_sound_for_49_is_Plong_as_it_has_a_factor_7 (0.00s) + --- PASS: TestConvert/the_sound_for_52_is_52 (0.00s) + --- PASS: TestConvert/the_sound_for_105_is_PlingPlangPlong_as_it_has_factors_3,_5_and_7 (0.00s) + --- PASS: TestConvert/the_sound_for_3125_is_Plang_as_it_has_a_factor_5 (0.00s) === RUN ExampleConvert --- PASS: ExampleConvert (0.00s) PASS coverage: 100.0% of statements -ok raindrops 0.009s coverage: 100.0% of statements +ok raindrops 0.002s coverage: 100.0% of statements -real 0m0.625s -user 0m0.631s -sys 0m0.541s +real 0m0.226s +user 0m0.286s +sys 0m0.195s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + raindrops/raindrops.go:10: Convert 100.0% total: (statements) 100.0% -real 0m0.215s -user 0m0.231s -sys 0m0.194s +real 0m0.066s +user 0m0.081s +sys 0m0.096s -=============================================================================== -go test -v -race -covermode=atomic raindrops + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.052s +user 0m0.069s +sys 0m0.069s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.023s +user 0m0.025s +sys 0m0.027s + +real 0m0.023s +user 0m0.025s +sys 0m0.027s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestConvert +=== RUN TestConvert/the_sound_for_1_is_1 +=== RUN TestConvert/the_sound_for_3_is_Pling +=== RUN TestConvert/the_sound_for_5_is_Plang +=== RUN TestConvert/the_sound_for_7_is_Plong +=== RUN TestConvert/the_sound_for_6_is_Pling_as_it_has_a_factor_3 +=== RUN TestConvert/2_to_the_power_3_does_not_make_a_raindrop_sound_as_3_is_the_exponent_not_the_base +=== RUN TestConvert/the_sound_for_9_is_Pling_as_it_has_a_factor_3 +=== RUN TestConvert/the_sound_for_10_is_Plang_as_it_has_a_factor_5 +=== RUN TestConvert/the_sound_for_14_is_Plong_as_it_has_a_factor_of_7 +=== RUN TestConvert/the_sound_for_15_is_PlingPlang_as_it_has_factors_3_and_5 +=== RUN TestConvert/the_sound_for_21_is_PlingPlong_as_it_has_factors_3_and_7 +=== RUN TestConvert/the_sound_for_25_is_Plang_as_it_has_a_factor_5 +=== RUN TestConvert/the_sound_for_27_is_Pling_as_it_has_a_factor_3 +=== RUN TestConvert/the_sound_for_35_is_PlangPlong_as_it_has_factors_5_and_7 +=== RUN TestConvert/the_sound_for_49_is_Plong_as_it_has_a_factor_7 +=== RUN TestConvert/the_sound_for_52_is_52 +=== RUN TestConvert/the_sound_for_105_is_PlingPlangPlong_as_it_has_factors_3,_5_and_7 +=== RUN TestConvert/the_sound_for_3125_is_Plang_as_it_has_a_factor_5 --- PASS: TestConvert (0.00s) + --- PASS: TestConvert/the_sound_for_1_is_1 (0.00s) + --- PASS: TestConvert/the_sound_for_3_is_Pling (0.00s) + --- PASS: TestConvert/the_sound_for_5_is_Plang (0.00s) + --- PASS: TestConvert/the_sound_for_7_is_Plong (0.00s) + --- PASS: TestConvert/the_sound_for_6_is_Pling_as_it_has_a_factor_3 (0.00s) + --- PASS: TestConvert/2_to_the_power_3_does_not_make_a_raindrop_sound_as_3_is_the_exponent_not_the_base (0.00s) + --- PASS: TestConvert/the_sound_for_9_is_Pling_as_it_has_a_factor_3 (0.00s) + --- PASS: TestConvert/the_sound_for_10_is_Plang_as_it_has_a_factor_5 (0.00s) + --- PASS: TestConvert/the_sound_for_14_is_Plong_as_it_has_a_factor_of_7 (0.00s) + --- PASS: TestConvert/the_sound_for_15_is_PlingPlang_as_it_has_factors_3_and_5 (0.00s) + --- PASS: TestConvert/the_sound_for_21_is_PlingPlong_as_it_has_factors_3_and_7 (0.00s) + --- PASS: TestConvert/the_sound_for_25_is_Plang_as_it_has_a_factor_5 (0.00s) + --- PASS: TestConvert/the_sound_for_27_is_Pling_as_it_has_a_factor_3 (0.00s) + --- PASS: TestConvert/the_sound_for_35_is_PlangPlong_as_it_has_factors_5_and_7 (0.00s) + --- PASS: TestConvert/the_sound_for_49_is_Plong_as_it_has_a_factor_7 (0.00s) + --- PASS: TestConvert/the_sound_for_52_is_52 (0.00s) + --- PASS: TestConvert/the_sound_for_105_is_PlingPlangPlong_as_it_has_factors_3,_5_and_7 (0.00s) + --- PASS: TestConvert/the_sound_for_3125_is_Plang_as_it_has_a_factor_5 (0.00s) === RUN ExampleConvert --- PASS: ExampleConvert (0.00s) PASS coverage: 100.0% of statements -ok raindrops (cached) coverage: 100.0% of statements +ok raindrops 1.012s coverage: 100.0% of statements -real 0m0.281s -user 0m0.292s -sys 0m0.255s +real 0m1.225s +user 0m0.244s +sys 0m0.153s -=============================================================================== -go test --bench . --benchmem -goos: linux -goarch: amd64 -pkg: raindrops -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkConvert-4 835659 1322 ns/op 290 B/op 19 allocs/op -PASS -ok raindrops 1.173s - -real 0m1.645s -user 0m2.197s -sys 0m0.402s + ============================================================================== -=============================================================================== +Exit code: 0 -go test -tags bonus -PASS -ok raindrops 0.006s +real 0m1.637s +user 0m0.739s +sys 0m0.582s -real 0m0.611s -user 0m0.744s -sys 0m0.422s +real 0m1.640s +user 0m0.741s +sys 0m0.582s =============================================================================== -go vet raindrops +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +goos: linux +goarch: amd64 +pkg: raindrops +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkConvert +BenchmarkConvert-8 1866162 644.3 ns/op 290 B/op 19 allocs/op +PASS +ok raindrops 1.861s -real 0m0.345s -user 0m0.453s -sys 0m0.334s +real 0m2.024s +user 0m2.112s +sys 0m0.161s =============================================================================== -go fix raindrops +gotest -v -tags bonus +=== RUN TestConvert +=== RUN TestConvert/the_sound_for_1_is_1 +=== RUN TestConvert/the_sound_for_3_is_Pling +=== RUN TestConvert/the_sound_for_5_is_Plang +=== RUN TestConvert/the_sound_for_7_is_Plong +=== RUN TestConvert/the_sound_for_6_is_Pling_as_it_has_a_factor_3 +=== RUN TestConvert/2_to_the_power_3_does_not_make_a_raindrop_sound_as_3_is_the_exponent_not_the_base +=== RUN TestConvert/the_sound_for_9_is_Pling_as_it_has_a_factor_3 +=== RUN TestConvert/the_sound_for_10_is_Plang_as_it_has_a_factor_5 +=== RUN TestConvert/the_sound_for_14_is_Plong_as_it_has_a_factor_of_7 +=== RUN TestConvert/the_sound_for_15_is_PlingPlang_as_it_has_factors_3_and_5 +=== RUN TestConvert/the_sound_for_21_is_PlingPlong_as_it_has_factors_3_and_7 +=== RUN TestConvert/the_sound_for_25_is_Plang_as_it_has_a_factor_5 +=== RUN TestConvert/the_sound_for_27_is_Pling_as_it_has_a_factor_3 +=== RUN TestConvert/the_sound_for_35_is_PlangPlong_as_it_has_factors_5_and_7 +=== RUN TestConvert/the_sound_for_49_is_Plong_as_it_has_a_factor_7 +=== RUN TestConvert/the_sound_for_52_is_52 +=== RUN TestConvert/the_sound_for_105_is_PlingPlangPlong_as_it_has_factors_3,_5_and_7 +=== RUN TestConvert/the_sound_for_3125_is_Plang_as_it_has_a_factor_5 +--- PASS: TestConvert (0.00s) + --- PASS: TestConvert/the_sound_for_1_is_1 (0.00s) + --- PASS: TestConvert/the_sound_for_3_is_Pling (0.00s) + --- PASS: TestConvert/the_sound_for_5_is_Plang (0.00s) + --- PASS: TestConvert/the_sound_for_7_is_Plong (0.00s) + --- PASS: TestConvert/the_sound_for_6_is_Pling_as_it_has_a_factor_3 (0.00s) + --- PASS: TestConvert/2_to_the_power_3_does_not_make_a_raindrop_sound_as_3_is_the_exponent_not_the_base (0.00s) + --- PASS: TestConvert/the_sound_for_9_is_Pling_as_it_has_a_factor_3 (0.00s) + --- PASS: TestConvert/the_sound_for_10_is_Plang_as_it_has_a_factor_5 (0.00s) + --- PASS: TestConvert/the_sound_for_14_is_Plong_as_it_has_a_factor_of_7 (0.00s) + --- PASS: TestConvert/the_sound_for_15_is_PlingPlang_as_it_has_factors_3_and_5 (0.00s) + --- PASS: TestConvert/the_sound_for_21_is_PlingPlong_as_it_has_factors_3_and_7 (0.00s) + --- PASS: TestConvert/the_sound_for_25_is_Plang_as_it_has_a_factor_5 (0.00s) + --- PASS: TestConvert/the_sound_for_27_is_Pling_as_it_has_a_factor_3 (0.00s) + --- PASS: TestConvert/the_sound_for_35_is_PlangPlong_as_it_has_factors_5_and_7 (0.00s) + --- PASS: TestConvert/the_sound_for_49_is_Plong_as_it_has_a_factor_7 (0.00s) + --- PASS: TestConvert/the_sound_for_52_is_52 (0.00s) + --- PASS: TestConvert/the_sound_for_105_is_PlingPlangPlong_as_it_has_factors_3,_5_and_7 (0.00s) + --- PASS: TestConvert/the_sound_for_3125_is_Plang_as_it_has_a_factor_5 (0.00s) +=== RUN ExampleConvert +--- PASS: ExampleConvert (0.00s) +PASS +ok raindrops 0.002s -real 0m0.160s -user 0m0.153s -sys 0m0.155s +real 0m0.144s +user 0m0.188s +sys 0m0.153s =============================================================================== -gosec ./raindrops -[gosec] 2022/06/22 08:57:18 Including rules: default -[gosec] 2022/06/22 08:57:18 Excluding rules: default -[gosec] 2022/06/22 08:57:18 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/raindrops -2022/06/22 08:57:18 internal error: package "fmt" without types was imported from "command-line-arguments" - -real 0m0.491s -user 0m0.545s -sys 0m0.369s +No old benchmarks to run benchstat against. =============================================================================== gomarkdoc --output raindrops-doc.md -real 0m0.029s -user 0m0.024s -sys 0m0.020s +real 0m0.011s +user 0m0.007s +sys 0m0.004s =============================================================================== go doc -all raindrops package raindrops // import "raindrops" -Package raindrops converts a number into a string that contains raindrop -sounds corresponding to certain potential factors. +Package raindrops converts a number into a string that contains raindrop sounds +corresponding to certain potential factors. FUNCTIONS @@ -127,9 +807,9 @@ func Convert(number int) string of the number, `int`, given. -real 0m0.269s -user 0m0.227s -sys 0m0.246s +real 0m0.049s +user 0m0.026s +sys 0m0.047s =============================================================================== diff --git a/go/resistor-color-duo/benchstat-new.txt b/go/resistor-color-duo/benchstat-new.txt index 8f889dc3..709c0f72 100644 --- a/go/resistor-color-duo/benchstat-new.txt +++ b/go/resistor-color-duo/benchstat-new.txt @@ -3,6 +3,6 @@ goarch: amd64 pkg: resistorcolorduo cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkValue -BenchmarkValue-16 276778 4326 ns/op 6944 B/op 70 allocs/op +BenchmarkValue-8 249406 4595 ns/op 6944 B/op 70 allocs/op PASS -ok resistorcolorduo 2.176s +ok resistorcolorduo 2.166s diff --git a/go/resistor-color-duo/benchstat-old.txt b/go/resistor-color-duo/benchstat-old.txt new file mode 100644 index 00000000..8f889dc3 --- /dev/null +++ b/go/resistor-color-duo/benchstat-old.txt @@ -0,0 +1,8 @@ +goos: linux +goarch: amd64 +pkg: resistorcolorduo +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkValue +BenchmarkValue-16 276778 4326 ns/op 6944 B/op 70 allocs/op +PASS +ok resistorcolorduo 2.176s diff --git a/go/resistor-color-duo/run-tests-go.txt b/go/resistor-color-duo/run-tests-go.txt index eb31ae8a..e5230283 100644 --- a/go/resistor-color-duo/run-tests-go.txt +++ b/go/resistor-color-duo/run-tests-go.txt @@ -5,89 +5,452 @@ Go packages: resistorcolorduo =============================================================================== -golangci-lint run ./... +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.004s +sys 0m0.009s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[linters_context] rowserrcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649." +level=warning msg="[linters_context] structcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649." +level=warning msg="[linters_context] wastedassign is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649." +cases_test.go:15: File is not `gofumpt`-ed (gofumpt) + +resistor_color_duo_test.go:8:20: Using the variable on range scope `tc` in function literal (scopelint) + actual := Value(tc.input) + ^ +resistor_color_duo_test.go:10:17: Using the variable on range scope `tc` in function literal (scopelint) + if actual != tc.expected { + ^ +resistor_color_duo_test.go:11:52: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("Value(%+q): expected %d, actual %d", tc.input, tc.expected, actual) + ^ +resistor_color_duo.go:32:5: ColorNames is a global variable (gochecknoglobals) +var ColorNames = map[Color]string{ + ^ +cases_test.go:14:5: valueTestCases is a global variable (gochecknoglobals) +var valueTestCases = []valueTestCase{ + ^ +resistor_color_duo_test.go:18:5: valueBench is a global variable (gochecknoglobals) +var valueBench int + ^ +resistor_color_duo.go:115:19: mnd: Magic number: 2, in detected (gomnd) + if len(colors) < 2 { + ^ +resistor_color_duo.go:122:34: mnd: Magic number: 10, in detected (gomnd) + value += ColorCode(colors[0]) * 10 + ^ +resistor_color_duo_example_test.go:8:6: ExampleColor_String contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleColor_String() { + ^ +resistor_color_duo_example_test.go:39:6: ExampleColor_Int contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleColor_Int() { + ^ +resistor_color_duo_test.go:5:1: Function TestValue missing the call to method parallel (paralleltest) +func TestValue(t *testing.T) { +^ +resistor_color_duo_test.go:6:2: Range statement for test TestValue missing the call to method parallel in test Run (paralleltest) + for _, tc := range valueTestCases { + ^ resistor_color_duo_example_test.go:14:11: SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck) name := strings.Title(color.String()) ^ resistor_color_duo_example_test.go:45:11: SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck) name := strings.Title(color.String()) ^ +cases_test.go:1:9: package should be `resistorcolorduo_test` instead of `resistorcolorduo` (testpackage) +package resistorcolorduo + ^ +resistor_color_duo_example_test.go:1:9: package should be `resistorcolorduo_test` instead of `resistorcolorduo` (testpackage) +package resistorcolorduo + ^ +resistor_color_duo_test.go:1:9: package should be `resistorcolorduo_test` instead of `resistorcolorduo` (testpackage) +package resistorcolorduo + ^ -real 0m0.237s -user 0m0.368s -sys 0m0.205s +real 0m0.490s +user 0m0.704s +sys 0m0.472s -=============================================================================== -golint ./... + ============================================================================== -real 0m0.005s -user 0m0.002s -sys 0m0.004s +Exit code: -1 + +real 0m0.513s +user 0m0.715s +sys 0m0.494s + +real 0m0.515s +user 0m0.716s +sys 0m0.495s =============================================================================== -revive -formatter=stylish ./... +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.006s +sys 0m0.008s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.043s +user 0m0.027s +sys 0m0.029s + -real 0m0.190s -user 0m0.303s -sys 0m0.291s + ============================================================================== + +Exit code: 0 + +real 0m0.065s +user 0m0.040s +sys 0m0.045s + +real 0m0.067s +user 0m0.041s +sys 0m0.045s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.099s -user 0m0.237s -sys 0m0.179s +real 0m0.001s +user 0m0.000s +sys 0m0.000s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.007s +sys 0m0.009s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." internal error: package "fmt" without types was imported from "resistorcolorduo [resistorcolorduo.test]" -real 0m0.111s -user 0m0.245s -sys 0m0.196s +real 0m0.092s +user 0m0.097s +sys 0m0.109s + + + ============================================================================== + +Exit code: -1 + +real 0m0.116s +user 0m0.109s +sys 0m0.130s + +real 0m0.118s +user 0m0.109s +sys 0m0.131s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.009s +sys 0m0.021s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + resistor_color_duo_example_test.go:14:11: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (SA1019) resistor_color_duo_example_test.go:45:11: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (SA1019) -real 0m0.147s -user 0m0.223s -sys 0m0.151s +real 0m0.169s +user 0m0.211s +sys 0m0.116s + + + ============================================================================== + +Exit code: -1 + +real 0m0.207s +user 0m0.229s +sys 0m0.148s + +real 0m0.209s +user 0m0.230s +sys 0m0.148s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.012s +sys 0m0.020s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.861s +user 0m2.060s +sys 0m0.299s -real 0m0.745s -user 0m2.301s -sys 0m0.460s + + ============================================================================== + +Exit code: 0 + +real 0m0.902s +user 0m2.082s +sys 0m0.334s + +real 0m0.904s +user 0m2.083s +sys 0m0.335s =============================================================================== -go vet ./... +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + -real 0m0.090s -user 0m0.185s -sys 0m0.149s + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.007s +sys 0m0.008s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.083s +user 0m0.122s +sys 0m0.091s + + + ============================================================================== + +Exit code: 0 + +real 0m0.108s +user 0m0.132s +sys 0m0.111s + +real 0m0.109s +user 0m0.132s +sys 0m0.113s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-fixer-go_fix -real 0m0.014s -user 0m0.008s +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.006s sys 0m0.009s + + ============================================================================== + +Running: go fix ./... + + +real 0m0.015s +user 0m0.009s +sys 0m0.010s + + + ============================================================================== + +Exit code: 0 + +real 0m0.038s +user 0m0.023s +sys 0m0.026s + +real 0m0.040s +user 0m0.024s +sys 0m0.028s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.011s +sys 0m0.014s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.494s +user 0m1.370s +sys 0m0.293s + + + ============================================================================== + +Exit code: 0 + +real 0m0.530s +user 0m1.391s +sys 0m0.320s + +real 0m0.532s +user 0m1.392s +sys 0m0.321s + =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.011s +sys 0m0.005s + + + ============================================================================== + +Running: gocyclo . + 3 resistorcolorduo BenchmarkValue resistor_color_duo_test.go:20:1 3 resistorcolorduo TestValue resistor_color_duo_test.go:5:1 3 resistorcolorduo ColorCode resistor_color_duo.go:97:1 @@ -102,25 +465,85 @@ gocyclo . 1 resistorcolorduo ExampleColors resistor_color_duo_example_test.go:70:1 real 0m0.002s -user 0m0.001s -sys 0m0.001s +user 0m0.000s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.025s +user 0m0.018s +sys 0m0.014s + +real 0m0.027s +user 0m0.020s +sys 0m0.014s =============================================================================== -misspell . +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . -real 0m0.024s -user 0m0.030s -sys 0m0.017s + +real 0m0.023s +user 0m0.026s +sys 0m0.012s + + + ============================================================================== + +Exit code: 0 + +real 0m0.034s +user 0m0.032s +sys 0m0.022s + +real 0m0.036s +user 0m0.033s +sys 0m0.023s =============================================================================== -gosec ./... -[gosec] 2023/03/05 17:40:10 Including rules: default -[gosec] 2023/03/05 17:40:10 Excluding rules: default -[gosec] 2023/03/05 17:40:10 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/resistor-color-duo -[gosec] 2023/03/05 17:40:10 Checking package: resistorcolorduo -[gosec] 2023/03/05 17:40:10 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/resistor-color-duo/resistor_color_duo.go +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.005s +sys 0m0.009s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:29:37 Including rules: default +[gosec] 2023/09/07 00:29:37 Excluding rules: default +[gosec] 2023/09/07 00:29:37 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/resistor-color-duo +[gosec] 2023/09/07 00:29:37 Checking package: resistorcolorduo +[gosec] 2023/09/07 00:29:37 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/resistor-color-duo/resistor_color_duo.go Results: @@ -132,13 +555,48 @@ Results: Issues : 0 -real 0m0.079s -user 0m0.081s -sys 0m0.048s +real 0m0.107s +user 0m0.100s +sys 0m0.053s + + + ============================================================================== + +Exit code: 0 + +real 0m0.128s +user 0m0.109s +sys 0m0.072s + +real 0m0.130s +user 0m0.110s +sys 0m0.074s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.006s +sys 0m0.011s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestValue === RUN TestValue/Brown_and_black === RUN TestValue/Blue_and_grey @@ -166,16 +624,18 @@ gotest -v -covermode=count -coverprofile coverage.out ./... === RUN ExampleValue --- PASS: ExampleValue (0.00s) PASS - resistorcolorduo coverage: 100.0% of statements -ok resistorcolorduo 0.003s coverage: 100.0% of statements +coverage: 100.0% of statements +ok resistorcolorduo 0.002s coverage: 100.0% of statements -real 0m0.207s -user 0m0.349s -sys 0m0.204s +real 0m0.188s +user 0m0.215s +sys 0m0.134s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + resistorcolorduo/resistor_color_duo.go:54: String 100.0% resistorcolorduo/resistor_color_duo.go:64: Int 100.0% resistorcolorduo/resistor_color_duo.go:78: Colors 100.0% @@ -183,29 +643,40 @@ resistorcolorduo/resistor_color_duo.go:97: ColorCode 100.0% resistorcolorduo/resistor_color_duo.go:108: Value 100.0% total: (statements) 100.0% -real 0m0.021s -user 0m0.010s -sys 0m0.021s +real 0m0.030s +user 0m0.015s +sys 0m0.022s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.020s -user 0m0.008s -sys 0m0.021s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +real 0m0.033s +user 0m0.016s +sys 0m0.027s -real 0m0.010s -user 0m0.004s -sys 0m0.010s -=============================================================================== + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.014s +user 0m0.002s +sys 0m0.018s + +real 0m0.014s +user 0m0.002s +sys 0m0.018s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestValue === RUN TestValue/Brown_and_black === RUN TestValue/Blue_and_grey @@ -233,28 +704,44 @@ gotest -v -race -covermode=atomic ./... === RUN ExampleValue --- PASS: ExampleValue (0.00s) PASS - resistorcolorduo coverage: 100.0% of statements -ok resistorcolorduo 0.022s coverage: 100.0% of statements +coverage: 100.0% of statements +ok resistorcolorduo 1.016s coverage: 100.0% of statements + +real 0m1.269s +user 0m0.305s +sys 0m0.186s + + + ============================================================================== -real 0m0.277s -user 0m0.404s -sys 0m0.240s +Exit code: 0 + +real 0m1.560s +user 0m0.565s +sys 0m0.408s + +real 0m1.562s +user 0m0.566s +sys 0m0.410s =============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: resistorcolorduo cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkValue -BenchmarkValue-16 276778 4326 ns/op 6944 B/op 70 allocs/op +BenchmarkValue-8 249406 4595 ns/op 6944 B/op 70 allocs/op PASS -ok resistorcolorduo 2.176s +ok resistorcolorduo 2.166s -real 0m2.343s -user 0m2.955s -sys 0m0.394s +real 0m2.352s +user 0m2.580s +sys 0m0.276s =============================================================================== @@ -288,21 +775,57 @@ gotest -v -tags bonus PASS ok resistorcolorduo 0.002s -real 0m0.144s -user 0m0.299s -sys 0m0.175s +real 0m0.135s +user 0m0.177s +sys 0m0.132s =============================================================================== -No old benchmarks to run benchstat against. +benchstat benchstat-old.txt benchstat-new.txt +benchstat-old.txt:5: missing iteration count +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: resistorcolorduo +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-old.txt │ benchstat-new.txt │ + │ sec/op │ sec/op vs base │ +Value-16 4.326µ ± ∞ ¹ +Value-8 4.595µ ± ∞ ¹ +geomean 4.326µ 4.595µ ? ² ³ +¹ need >= 6 samples for confidence interval at level 0.95 +² benchmark set differs from baseline; geomeans may not be comparable +³ ratios must be >0 to compute geomean + + │ benchstat-old.txt │ benchstat-new.txt │ + │ B/op │ B/op vs base │ +Value-16 6.781Ki ± ∞ ¹ +Value-8 6.781Ki ± ∞ ¹ +geomean 6.781Ki 6.781Ki ? ² ³ +¹ need >= 6 samples for confidence interval at level 0.95 +² benchmark set differs from baseline; geomeans may not be comparable +³ ratios must be >0 to compute geomean + + │ benchstat-old.txt │ benchstat-new.txt │ + │ allocs/op │ allocs/op vs base │ +Value-16 70.00 ± ∞ ¹ +Value-8 70.00 ± ∞ ¹ +geomean 70.00 70.00 ? ² ³ +¹ need >= 6 samples for confidence interval at level 0.95 +² benchmark set differs from baseline; geomeans may not be comparable +³ ratios must be >0 to compute geomean + +real 0m0.006s +user 0m0.002s +sys 0m0.001s =============================================================================== gomarkdoc --output resistorcolorduo-doc.md -real 0m0.012s -user 0m0.006s -sys 0m0.006s +real 0m0.014s +user 0m0.007s +sys 0m0.007s =============================================================================== @@ -391,9 +914,9 @@ func (c Color) String() string since this exercise lacks error returns on the functions being tested. -real 0m0.030s -user 0m0.012s -sys 0m0.027s +real 0m0.031s +user 0m0.016s +sys 0m0.022s =============================================================================== diff --git a/go/resistor-color-trio/benchstat-new.txt b/go/resistor-color-trio/benchstat-new.txt index a65cf93a..2ea6e159 100644 --- a/go/resistor-color-trio/benchstat-new.txt +++ b/go/resistor-color-trio/benchstat-new.txt @@ -3,6 +3,6 @@ goarch: amd64 pkg: resistorcolortrio cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkLabel -BenchmarkLabel-16 109490 11654 ns/op 15192 B/op 182 allocs/op +BenchmarkLabel-8 99762 11779 ns/op 15188 B/op 182 allocs/op PASS -ok resistorcolortrio 1.394s +ok resistorcolortrio 2.268s diff --git a/go/resistor-color-trio/benchstat-old.txt b/go/resistor-color-trio/benchstat-old.txt index 2e2b6b8d..a65cf93a 100644 --- a/go/resistor-color-trio/benchstat-old.txt +++ b/go/resistor-color-trio/benchstat-old.txt @@ -3,6 +3,6 @@ goarch: amd64 pkg: resistorcolortrio cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkLabel -BenchmarkLabel-16 91982 11599 ns/op 15192 B/op 182 allocs/op +BenchmarkLabel-16 109490 11654 ns/op 15192 B/op 182 allocs/op PASS -ok resistorcolortrio 1.205s +ok resistorcolortrio 1.394s diff --git a/go/resistor-color-trio/run-tests-go.txt b/go/resistor-color-trio/run-tests-go.txt index 054eb5a7..a53be63d 100644 --- a/go/resistor-color-trio/run-tests-go.txt +++ b/go/resistor-color-trio/run-tests-go.txt @@ -5,91 +5,487 @@ Go packages: resistorcolortrio =============================================================================== -golangci-lint run ./... +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.023s +sys 0m0.026s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[linters_context] rowserrcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649." +level=warning msg="[linters_context] structcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649." +level=warning msg="[linters_context] wastedassign is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649." +resistor_color_trio.go:211:10: string `-1 ohms` has 3 occurrences, make it a constant (goconst) + return "-1 ohms" + ^ +resistor_color_trio.go:81:26: Comment should end in a period (godot) +// Enum of MetricPrefixes + ^ +resistor_color_trio_test.go:8:20: Using the variable on range scope `tc` in function literal (scopelint) + actual := Label(tc.input) + ^ +resistor_color_trio_test.go:10:17: Using the variable on range scope `tc` in function literal (scopelint) + if actual != tc.expected { + ^ +resistor_color_trio_test.go:11:52: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("Label(%+q): expected %q, actual %q", tc.input, tc.expected, actual) + ^ +resistor_color_trio.go:38:5: ColorNames is a global variable (gochecknoglobals) +var ColorNames = map[Color]string{ + ^ +resistor_color_trio.go:98:5: MetricPrefixNames is a global variable (gochecknoglobals) +var MetricPrefixNames = map[MetricPrefix]string{ + ^ +cases_test.go:14:5: labelTestCases is a global variable (gochecknoglobals) +var labelTestCases = []labelTestCase{ + ^ +resistor_color_trio_test.go:18:5: labelBench is a global variable (gochecknoglobals) +var labelBench string + ^ +resistor_color_trio.go:124:30: mnd: Magic number: 10, in detected (gomnd) + return int(math.Pow(float64(10), float64(m.Int()))) + ^ +resistor_color_trio.go:223:32: mnd: Magic number: 10, in detected (gomnd) + value *= int(math.Pow(float64(10), float64(ColorCode(colors[2])))) + ^ +resistor_color_trio.go:170:19: mnd: Magic number: 2, in detected (gomnd) + if len(colors) < 2 { + ^ +resistor_color_trio.go:210:19: mnd: Magic number: 3, in detected (gomnd) + if len(colors) < 3 { + ^ +resistor_color_trio.go:177:34: mnd: Magic number: 10, in detected (gomnd) + value += ColorCode(colors[0]) * 10 + ^ +resistor_color_trio.go:217:34: mnd: Magic number: 10, in detected (gomnd) + value += ColorCode(colors[0]) * 10 + ^ +resistor_color_trio_example_test.go:20:6: ExampleColor_String contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleColor_String() { + ^ +resistor_color_trio_example_test.go:45:6: ExampleColor_Int contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleColor_Int() { + ^ +resistor_color_trio_example_test.go:70:6: ExampleMetricPrefix_String contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleMetricPrefix_String() { + ^ +resistor_color_trio_example_test.go:89:6: ExampleMetricPrefix_Int contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleMetricPrefix_Int() { + ^ +resistor_color_trio_example_test.go:108:6: ExampleMetricPrefix_Magnitude contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleMetricPrefix_Magnitude() { + ^ +resistor_color_trio_test.go:5:1: Function TestLabel missing the call to method parallel (paralleltest) +func TestLabel(t *testing.T) { +^ +resistor_color_trio_test.go:6:2: Range statement for test TestLabel missing the call to method parallel in test Run (paralleltest) + for _, tc := range labelTestCases { + ^ resistor_color_trio_example_test.go:11:12: SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck) result := strings.Title(text) ^ - -real 0m0.238s -user 0m0.401s -sys 0m0.264s +cases_test.go:1:9: package should be `resistorcolortrio_test` instead of `resistorcolortrio` (testpackage) +package resistorcolortrio + ^ +resistor_color_trio_example_test.go:1:9: package should be `resistorcolortrio_test` instead of `resistorcolortrio` (testpackage) +package resistorcolortrio + ^ +resistor_color_trio_test.go:1:9: package should be `resistorcolortrio_test` instead of `resistorcolortrio` (testpackage) +package resistorcolortrio + ^ +resistor_color_trio.go:233:6: variable name 'sb' is too short for the scope of its usage (varnamelen) + var sb strings.Builder + ^ +resistor_color_trio.go:235:2: variable name 'e' is too short for the scope of its usage (varnamelen) + _, e := sb.WriteString(fmt.Sprintf("%d", value)) + ^ + +real 0m0.536s +user 0m0.840s +sys 0m0.534s + + + ============================================================================== + +Exit code: -1 + +real 0m0.577s +user 0m0.873s +sys 0m0.572s + +real 0m0.580s +user 0m0.874s +sys 0m0.573s =============================================================================== -golint ./... -resistor_color_trio.go:123:1: exported method MetricPrefix.Magnitude should have comment or be unexported +Running: ../../.github/citools/go/go-lint-revive -real 0m0.005s -user 0m0.003s -sys 0m0.002s +Running Go Lint Revive -=============================================================================== +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.029s +sys 0m0.025s + + + ============================================================================== + +Running: revive -formatter=stylish ./... -revive -formatter=stylish ./... resistor_color_trio.go (123, 1) https://revive.run/r#exported exported method MetricPrefix.Magnitude should have comment or be unexported ✖ 1 problem (0 errors) (1 warnings) -real 0m0.204s -user 0m0.386s -sys 0m0.348s +real 0m0.055s +user 0m0.032s +sys 0m0.037s + + + ============================================================================== + +Exit code: 0 + +real 0m0.099s +user 0m0.069s +sys 0m0.071s + +real 0m0.101s +user 0m0.071s +sys 0m0.071s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.094s -user 0m0.135s -sys 0m0.106s +real 0m0.001s +user 0m0.000s +sys 0m0.001s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.021s +sys 0m0.034s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." internal error: package "fmt" without types was imported from "resistorcolortrio" -real 0m0.103s -user 0m0.186s -sys 0m0.142s +real 0m0.113s +user 0m0.142s +sys 0m0.154s + + + ============================================================================== + +Exit code: -1 + +real 0m0.159s +user 0m0.169s +sys 0m0.205s + +real 0m0.161s +user 0m0.171s +sys 0m0.206s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.022s +sys 0m0.020s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + resistor_color_trio_example_test.go:11:12: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (SA1019) -real 0m0.157s -user 0m0.245s -sys 0m0.273s +real 0m0.174s +user 0m0.241s +sys 0m0.116s + + + ============================================================================== + +Exit code: -1 + +real 0m0.207s +user 0m0.269s +sys 0m0.145s + +real 0m0.209s +user 0m0.271s +sys 0m0.145s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.015s +sys 0m0.032s -real 0m0.752s -user 0m2.435s -sys 0m0.441s + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.905s +user 0m2.213s +sys 0m0.322s + + + ============================================================================== + +Exit code: 0 + +real 0m0.941s +user 0m2.234s +sys 0m0.366s + +real 0m0.944s +user 0m2.235s +sys 0m0.367s =============================================================================== -go vet ./... +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== -real 0m0.114s -user 0m0.230s -sys 0m0.227s +Running: go clean ./... + + +real 0m0.023s +user 0m0.011s +sys 0m0.025s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.078s +user 0m0.123s +sys 0m0.110s + + + ============================================================================== + +Exit code: 0 + +real 0m0.111s +user 0m0.144s +sys 0m0.140s + +real 0m0.112s +user 0m0.144s +sys 0m0.141s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.016s +sys 0m0.023s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.027s +user 0m0.024s +sys 0m0.031s -real 0m0.026s -user 0m0.023s -sys 0m0.030s + + ============================================================================== + +Exit code: 0 + +real 0m0.057s +user 0m0.046s +sys 0m0.062s + +real 0m0.059s +user 0m0.047s +sys 0m0.062s =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.034s +user 0m0.031s +sys 0m0.032s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.513s +user 0m1.515s +sys 0m0.335s + + + ============================================================================== + +Exit code: 0 + +real 0m0.565s +user 0m1.555s +sys 0m0.382s + +real 0m0.567s +user 0m1.556s +sys 0m0.384s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.017s +sys 0m0.030s + + + ============================================================================== + +Running: gocyclo . + 6 resistorcolortrio Label resistor_color_trio.go:209:1 4 resistorcolortrio Unit resistor_color_trio.go:186:1 3 resistorcolortrio BenchmarkLabel resistor_color_trio_test.go:20:1 @@ -114,25 +510,85 @@ gocyclo . 1 resistorcolortrio (MetricPrefix).Magnitude resistor_color_trio.go:123:1 real 0m0.002s -user 0m0.001s -sys 0m0.001s +user 0m0.002s +sys 0m0.000s + + + ============================================================================== + +Exit code: 0 + +real 0m0.048s +user 0m0.026s +sys 0m0.048s + +real 0m0.051s +user 0m0.028s +sys 0m0.049s =============================================================================== -misspell . +Running: ../../.github/citools/go/go-lint-misspell -real 0m0.026s -user 0m0.035s -sys 0m0.010s +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.028s +user 0m0.033s +sys 0m0.009s + + + ============================================================================== + +Exit code: 0 + +real 0m0.045s +user 0m0.040s +sys 0m0.025s + +real 0m0.048s +user 0m0.041s +sys 0m0.026s =============================================================================== -gosec ./... -[gosec] 2023/03/05 20:42:22 Including rules: default -[gosec] 2023/03/05 20:42:22 Excluding rules: default -[gosec] 2023/03/05 20:42:22 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/resistor-color-trio -[gosec] 2023/03/05 20:42:22 Checking package: resistorcolortrio -[gosec] 2023/03/05 20:42:22 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/resistor-color-trio/resistor_color_trio.go +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.024s +sys 0m0.031s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:29:44 Including rules: default +[gosec] 2023/09/07 00:29:44 Excluding rules: default +[gosec] 2023/09/07 00:29:44 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/resistor-color-trio +[gosec] 2023/09/07 00:29:45 Checking package: resistorcolortrio +[gosec] 2023/09/07 00:29:45 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/resistor-color-trio/resistor_color_trio.go Results: @@ -144,13 +600,48 @@ Results: Issues : 0 -real 0m0.138s -user 0m0.181s -sys 0m0.117s +real 0m0.127s +user 0m0.150s +sys 0m0.098s + + + ============================================================================== + +Exit code: 0 + +real 0m0.171s +user 0m0.178s +sys 0m0.140s + +real 0m0.172s +user 0m0.178s +sys 0m0.141s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.031s +sys 0m0.027s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestLabel === RUN TestLabel/Orange_and_orange_and_black === RUN TestLabel/Blue_and_grey_and_brown @@ -192,16 +683,18 @@ gotest -v -covermode=count -coverprofile coverage.out ./... === RUN ExampleLabel --- PASS: ExampleLabel (0.00s) PASS - resistorcolortrio coverage: 96.2% of statements -ok resistorcolortrio 0.004s coverage: 96.2% of statements +coverage: 96.2% of statements +ok resistorcolortrio 0.003s coverage: 96.2% of statements -real 0m0.226s -user 0m0.374s -sys 0m0.277s +real 0m0.194s +user 0m0.246s +sys 0m0.159s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + resistorcolortrio/resistor_color_trio.go:60: String 100.0% resistorcolortrio/resistor_color_trio.go:70: Int 100.0% resistorcolortrio/resistor_color_trio.go:106: String 100.0% @@ -214,21 +707,26 @@ resistorcolortrio/resistor_color_trio.go:186: Unit 100.0% resistorcolortrio/resistor_color_trio.go:209: Label 88.2% total: (statements) 96.2% -real 0m0.061s -user 0m0.100s -sys 0m0.098s +real 0m0.060s +user 0m0.080s +sys 0m0.084s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.061s -user 0m0.099s -sys 0m0.096s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +real 0m0.049s +user 0m0.060s +sys 0m0.075s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt 209 func Label(colors []string) string { 210 if len(colors) < 3 { @@ -274,13 +772,19 @@ gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annota 250 } -real 0m0.018s -user 0m0.022s -sys 0m0.023s +real 0m0.020s +user 0m0.023s +sys 0m0.021s -=============================================================================== +real 0m0.020s +user 0m0.023s +sys 0m0.021s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestLabel === RUN TestLabel/Orange_and_orange_and_black === RUN TestLabel/Blue_and_grey_and_brown @@ -322,12 +826,25 @@ gotest -v -race -covermode=atomic ./... === RUN ExampleLabel --- PASS: ExampleLabel (0.00s) PASS - resistorcolortrio coverage: 96.2% of statements -ok resistorcolortrio 0.033s coverage: 96.2% of statements +coverage: 96.2% of statements +ok resistorcolortrio 1.018s coverage: 96.2% of statements + +real 0m1.294s +user 0m0.345s +sys 0m0.209s + -real 0m0.317s -user 0m0.417s -sys 0m0.244s + ============================================================================== + +Exit code: 0 + +real 0m1.665s +user 0m0.788s +sys 0m0.591s + +real 0m1.667s +user 0m0.789s +sys 0m0.592s =============================================================================== @@ -340,13 +857,13 @@ goarch: amd64 pkg: resistorcolortrio cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkLabel -BenchmarkLabel-16 109490 11654 ns/op 15192 B/op 182 allocs/op +BenchmarkLabel-8 99762 11779 ns/op 15188 B/op 182 allocs/op PASS -ok resistorcolortrio 1.394s +ok resistorcolortrio 2.268s -real 0m1.563s -user 0m1.976s -sys 0m0.339s +real 0m2.435s +user 0m2.615s +sys 0m0.250s =============================================================================== @@ -394,9 +911,9 @@ gotest -v -tags bonus PASS ok resistorcolortrio 0.003s -real 0m0.152s -user 0m0.275s -sys 0m0.236s +real 0m0.131s +user 0m0.176s +sys 0m0.122s =============================================================================== @@ -407,35 +924,44 @@ goos: linux goarch: amd64 pkg: resistorcolortrio cpu: 12th Gen Intel(R) Core(TM) i5-1240P - │ benchstat-old.txt │ benchstat-new.txt │ - │ sec/op │ sec/op vs base │ -Label-16 11.60µ ± ∞ ¹ 11.65µ ± ∞ ¹ ~ (p=1.000 n=1) ² + │ benchstat-old.txt │ benchstat-new.txt │ + │ sec/op │ sec/op vs base │ +Label-16 11.65µ ± ∞ ¹ +Label-8 11.78µ ± ∞ ¹ +geomean 11.65µ 11.78µ ? ² ³ ¹ need >= 6 samples for confidence interval at level 0.95 -² need >= 4 samples to detect a difference at alpha level 0.05 - - │ benchstat-old.txt │ benchstat-new.txt │ - │ B/op │ B/op vs base │ -Label-16 14.84Ki ± ∞ ¹ 14.84Ki ± ∞ ¹ ~ (p=1.000 n=1) ² +² benchmark set differs from baseline; geomeans may not be comparable +³ ratios must be >0 to compute geomean + + │ benchstat-old.txt │ benchstat-new.txt │ + │ B/op │ B/op vs base │ +Label-16 14.84Ki ± ∞ ¹ +Label-8 14.83Ki ± ∞ ¹ +geomean 14.84Ki 14.83Ki ? ² ³ ¹ need >= 6 samples for confidence interval at level 0.95 -² all samples are equal - - │ benchstat-old.txt │ benchstat-new.txt │ - │ allocs/op │ allocs/op vs base │ -Label-16 182.0 ± ∞ ¹ 182.0 ± ∞ ¹ ~ (p=1.000 n=1) ² +² benchmark set differs from baseline; geomeans may not be comparable +³ ratios must be >0 to compute geomean + + │ benchstat-old.txt │ benchstat-new.txt │ + │ allocs/op │ allocs/op vs base │ +Label-16 182.0 ± ∞ ¹ +Label-8 182.0 ± ∞ ¹ +geomean 182.0 182.0 ? ² ³ ¹ need >= 6 samples for confidence interval at level 0.95 -² all samples are equal +² benchmark set differs from baseline; geomeans may not be comparable +³ ratios must be >0 to compute geomean -real 0m0.003s -user 0m0.003s -sys 0m0.000s +real 0m0.004s +user 0m0.000s +sys 0m0.004s =============================================================================== gomarkdoc --output resistorcolortrio-doc.md real 0m0.014s -user 0m0.009s -sys 0m0.005s +user 0m0.012s +sys 0m0.003s =============================================================================== @@ -569,8 +1095,8 @@ func (m MetricPrefix) String() string real 0m0.038s -user 0m0.035s -sys 0m0.034s +user 0m0.031s +sys 0m0.035s =============================================================================== diff --git a/go/resistor-color/benchstat-new.txt b/go/resistor-color/benchstat-new.txt index 6093a075..4917f7ea 100644 --- a/go/resistor-color/benchstat-new.txt +++ b/go/resistor-color/benchstat-new.txt @@ -3,8 +3,8 @@ goarch: amd64 pkg: resistorcolor cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkColorCode -BenchmarkColorCode-16 1000000 1016 ns/op 1488 B/op 15 allocs/op +BenchmarkColorCode-8 1219076 1038 ns/op 1488 B/op 15 allocs/op BenchmarkColors -BenchmarkColors-16 3770556 301.9 ns/op 496 B/op 5 allocs/op +BenchmarkColors-8 3477864 294.4 ns/op 496 B/op 5 allocs/op PASS -ok resistorcolor 2.496s +ok resistorcolor 3.511s diff --git a/go/resistor-color/benchstat-old.txt b/go/resistor-color/benchstat-old.txt new file mode 100644 index 00000000..6093a075 --- /dev/null +++ b/go/resistor-color/benchstat-old.txt @@ -0,0 +1,10 @@ +goos: linux +goarch: amd64 +pkg: resistorcolor +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkColorCode +BenchmarkColorCode-16 1000000 1016 ns/op 1488 B/op 15 allocs/op +BenchmarkColors +BenchmarkColors-16 3770556 301.9 ns/op 496 B/op 5 allocs/op +PASS +ok resistorcolor 2.496s diff --git a/go/resistor-color/run-tests-go.txt b/go/resistor-color/run-tests-go.txt index 910052cc..30e3c47a 100644 --- a/go/resistor-color/run-tests-go.txt +++ b/go/resistor-color/run-tests-go.txt @@ -5,93 +5,469 @@ Go packages: resistorcolor =============================================================================== -golangci-lint run ./... +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.012s +sys 0m0.011s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[linters_context] rowserrcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649." +level=warning msg="[linters_context] structcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649." +level=warning msg="[linters_context] wastedassign is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649." +resistor_color_test.go:8:24: Using the variable on range scope `tc` in function literal (scopelint) + actual := ColorCode(tc.input) + ^ +resistor_color_test.go:10:17: Using the variable on range scope `tc` in function literal (scopelint) + if actual != tc.expected { + ^ +resistor_color_test.go:11:55: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("ColorCode(%q): expected %d, actual %d", tc.input, tc.expected, actual) + ^ cases_test.go:16:2: field `input` is unused (unused) input string ^ +resistor_color_test.go:61:2: return statements should not be cuddled if block has more than two lines (wsl) + return m + ^ +resistor_color_test.go:68:2: ranges should only be cuddled with assignments used in the iteration (wsl) + for k := range a { + ^ +resistor_color_test.go:73:2: return statements should not be cuddled if block has more than two lines (wsl) + return true + ^ +resistor_color.go:32:5: ColorNames is a global variable (gochecknoglobals) +var ColorNames = map[Color]string{ + ^ +cases_test.go:20:5: colorCodeTestCases is a global variable (gochecknoglobals) +var colorCodeTestCases = []colorCodeTestCase{ + ^ +cases_test.go:38:5: colorsTestCases is a global variable (gochecknoglobals) +var colorsTestCases = []colorsTestCase{ + ^ +resistor_color_test.go:37:5: colorCodeBench is a global variable (gochecknoglobals) +var colorCodeBench int + ^ +resistor_color_test.go:48:5: colorsBench is a global variable (gochecknoglobals) +var colorsBench []string + ^ +resistor_color_example_test.go:8:6: ExampleColor_String contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleColor_String() { + ^ +resistor_color_example_test.go:39:6: ExampleColor_Int contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleColor_Int() { + ^ +resistor_color_test.go:5:1: Function TestColorCode missing the call to method parallel (paralleltest) +func TestColorCode(t *testing.T) { +^ +resistor_color_test.go:6:2: Range statement for test TestColorCode missing the call to method parallel in test Run (paralleltest) + for _, tc := range colorCodeTestCases { + ^ +resistor_color_test.go:17:1: Function TestColors missing the call to method parallel (paralleltest) +func TestColors(t *testing.T) { +^ +resistor_color_test.go:18:2: Range statement for test TestColors missing the call to method parallel in test Run (paralleltest) + for _, tc := range colorsTestCases { + ^ resistor_color_example_test.go:14:11: SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck) name := strings.Title(color.String()) ^ resistor_color_example_test.go:45:11: SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck) name := strings.Title(color.String()) ^ +cases_test.go:1:9: package should be `resistorcolor_test` instead of `resistorcolor` (testpackage) +package resistorcolor + ^ +resistor_color_example_test.go:1:9: package should be `resistorcolor_test` instead of `resistorcolor` (testpackage) +package resistorcolor + ^ +resistor_color_test.go:1:9: package should be `resistorcolor_test` instead of `resistorcolor` (testpackage) +package resistorcolor + ^ -real 0m0.216s -user 0m0.339s -sys 0m0.238s +real 0m0.508s +user 0m0.856s +sys 0m0.456s -=============================================================================== -golint ./... + ============================================================================== -real 0m0.006s -user 0m0.005s -sys 0m0.001s +Exit code: -1 + +real 0m0.542s +user 0m0.873s +sys 0m0.486s + +real 0m0.544s +user 0m0.874s +sys 0m0.487s =============================================================================== -revive -formatter=stylish ./... +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.006s +sys 0m0.013s -real 0m0.190s -user 0m0.318s -sys 0m0.282s + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.054s +user 0m0.027s +sys 0m0.043s + + + ============================================================================== + +Exit code: 0 + +real 0m0.084s +user 0m0.040s +sys 0m0.063s + +real 0m0.086s +user 0m0.042s +sys 0m0.063s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.092s -user 0m0.210s -sys 0m0.206s +real 0m0.001s +user 0m0.001s +sys 0m0.000s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.008s +sys 0m0.012s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." internal error: package "fmt" without types was imported from "resistorcolor [resistorcolor.test]" -real 0m0.104s -user 0m0.167s -sys 0m0.136s +real 0m0.091s +user 0m0.118s +sys 0m0.110s + + + ============================================================================== + +Exit code: -1 + +real 0m0.122s +user 0m0.131s +sys 0m0.141s + +real 0m0.125s +user 0m0.132s +sys 0m0.142s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.008s +sys 0m0.008s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + cases_test.go:16:2: field input is unused (U1000) resistor_color_example_test.go:14:11: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (SA1019) resistor_color_example_test.go:45:11: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (SA1019) -real 0m0.157s -user 0m0.238s -sys 0m0.150s +real 0m0.176s +user 0m0.241s +sys 0m0.149s + + + ============================================================================== + +Exit code: -1 + +real 0m0.199s +user 0m0.255s +sys 0m0.166s + +real 0m0.201s +user 0m0.256s +sys 0m0.167s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.004s +sys 0m0.011s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.819s +user 0m1.813s +sys 0m0.270s + + + ============================================================================== + +Exit code: 0 + +real 0m0.843s +user 0m1.821s +sys 0m0.294s -real 0m0.767s -user 0m2.586s -sys 0m0.444s +real 0m0.845s +user 0m1.822s +sys 0m0.295s =============================================================================== -go vet ./... +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.005s +sys 0m0.010s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.079s +user 0m0.122s +sys 0m0.117s + + + ============================================================================== + +Exit code: 0 real 0m0.105s -user 0m0.224s -sys 0m0.191s +user 0m0.132s +sys 0m0.139s + +real 0m0.107s +user 0m0.134s +sys 0m0.140s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-fixer-go_fix -real 0m0.014s -user 0m0.008s +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.006s +sys 0m0.007s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.013s +user 0m0.009s +sys 0m0.007s + + + ============================================================================== + +Exit code: 0 + +real 0m0.032s +user 0m0.018s +sys 0m0.024s + +real 0m0.034s +user 0m0.019s +sys 0m0.025s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.007s sys 0m0.010s + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.516s +user 0m1.662s +sys 0m0.306s + + + ============================================================================== + +Exit code: 0 + +real 0m0.543s +user 0m1.676s +sys 0m0.326s + +real 0m0.546s +user 0m1.677s +sys 0m0.328s + =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.012s +sys 0m0.011s + + + ============================================================================== + +Running: gocyclo . + 4 resistorcolor mapsEqual resistor_color_test.go:64:1 4 resistorcolor TestColors resistor_color_test.go:17:1 3 resistorcolor BenchmarkColorCode resistor_color_test.go:39:1 @@ -108,25 +484,85 @@ gocyclo . 1 resistorcolor ExampleColors resistor_color_example_test.go:70:1 real 0m0.003s -user 0m0.000s -sys 0m0.003s +user 0m0.002s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.033s +user 0m0.019s +sys 0m0.024s + +real 0m0.035s +user 0m0.020s +sys 0m0.025s =============================================================================== -misspell . +Running: ../../.github/citools/go/go-lint-misspell -real 0m0.022s -user 0m0.027s -sys 0m0.014s +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.041s +user 0m0.041s +sys 0m0.026s + + + ============================================================================== + +Exit code: 0 + +real 0m0.058s +user 0m0.049s +sys 0m0.042s + +real 0m0.060s +user 0m0.050s +sys 0m0.043s =============================================================================== -gosec ./... -[gosec] 2023/03/05 20:47:49 Including rules: default -[gosec] 2023/03/05 20:47:49 Excluding rules: default -[gosec] 2023/03/05 20:47:49 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/resistor-color -[gosec] 2023/03/05 20:47:49 Checking package: resistorcolor -[gosec] 2023/03/05 20:47:49 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/resistor-color/resistor_color.go +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.008s +sys 0m0.017s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:29:29 Including rules: default +[gosec] 2023/09/07 00:29:29 Excluding rules: default +[gosec] 2023/09/07 00:29:29 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/resistor-color +[gosec] 2023/09/07 00:29:29 Checking package: resistorcolor +[gosec] 2023/09/07 00:29:29 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/resistor-color/resistor_color.go Results: @@ -138,13 +574,48 @@ Results: Issues : 0 -real 0m0.068s -user 0m0.061s -sys 0m0.049s +real 0m0.088s +user 0m0.078s +sys 0m0.061s + + + ============================================================================== + +Exit code: 0 + +real 0m0.122s +user 0m0.091s +sys 0m0.096s + +real 0m0.124s +user 0m0.092s +sys 0m0.097s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.009s +sys 0m0.012s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestColorCode === RUN TestColorCode/Black === RUN TestColorCode/White @@ -166,45 +637,58 @@ gotest -v -covermode=count -coverprofile coverage.out ./... === RUN ExampleColorCode --- PASS: ExampleColorCode (0.00s) PASS - resistorcolor coverage: 100.0% of statements +coverage: 100.0% of statements ok resistorcolor 0.003s coverage: 100.0% of statements -real 0m0.172s -user 0m0.326s -sys 0m0.271s +real 0m0.190s +user 0m0.263s +sys 0m0.151s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + resistorcolor/resistor_color.go:54: String 100.0% resistorcolor/resistor_color.go:64: Int 100.0% resistorcolor/resistor_color.go:78: Colors 100.0% resistorcolor/resistor_color.go:97: ColorCode 100.0% total: (statements) 100.0% -real 0m0.021s -user 0m0.008s +real 0m0.033s +user 0m0.011s +sys 0m0.032s + + + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.026s +user 0m0.009s sys 0m0.023s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.021s -user 0m0.013s -sys 0m0.015s +Running: cover_annotate -=============================================================================== +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.011s +user 0m0.004s +sys 0m0.010s -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +real 0m0.011s +user 0m0.004s +sys 0m0.010s -real 0m0.009s -user 0m0.006s -sys 0m0.006s -=============================================================================== + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestColorCode === RUN TestColorCode/Black === RUN TestColorCode/White @@ -226,30 +710,46 @@ gotest -v -race -covermode=atomic ./... === RUN ExampleColorCode --- PASS: ExampleColorCode (0.00s) PASS - resistorcolor coverage: 100.0% of statements -ok resistorcolor (cached) coverage: 100.0% of statements +coverage: 100.0% of statements +ok resistorcolor 1.012s coverage: 100.0% of statements + +real 0m1.250s +user 0m0.298s +sys 0m0.182s -real 0m0.201s -user 0m0.357s -sys 0m0.256s + + ============================================================================== + +Exit code: 0 + +real 0m1.545s +user 0m0.607s +sys 0m0.423s + +real 0m1.548s +user 0m0.607s +sys 0m0.426s =============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: resistorcolor cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkColorCode -BenchmarkColorCode-16 1000000 1016 ns/op 1488 B/op 15 allocs/op +BenchmarkColorCode-8 1219076 1038 ns/op 1488 B/op 15 allocs/op BenchmarkColors -BenchmarkColors-16 3770556 301.9 ns/op 496 B/op 5 allocs/op +BenchmarkColors-8 3477864 294.4 ns/op 496 B/op 5 allocs/op PASS -ok resistorcolor 2.496s +ok resistorcolor 3.511s -real 0m2.662s -user 0m3.301s -sys 0m0.390s +real 0m3.671s +user 0m4.000s +sys 0m0.328s =============================================================================== @@ -277,21 +777,65 @@ gotest -v -tags bonus PASS ok resistorcolor 0.002s -real 0m0.152s -user 0m0.238s -sys 0m0.178s +real 0m0.129s +user 0m0.159s +sys 0m0.132s =============================================================================== -No old benchmarks to run benchstat against. +benchstat benchstat-old.txt benchstat-new.txt +benchstat-old.txt:5: missing iteration count +benchstat-old.txt:7: missing iteration count +benchstat-new.txt:5: missing iteration count +benchstat-new.txt:7: missing iteration count +goos: linux +goarch: amd64 +pkg: resistorcolor +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-old.txt │ benchstat-new.txt │ + │ sec/op │ sec/op vs base │ +ColorCode-16 1.016µ ± ∞ ¹ +Colors-16 301.9n ± ∞ ¹ +ColorCode-8 1.038µ ± ∞ ¹ +Colors-8 294.4n ± ∞ ¹ +geomean 553.8n 552.8n ? ² ³ +¹ need >= 6 samples for confidence interval at level 0.95 +² benchmark set differs from baseline; geomeans may not be comparable +³ ratios must be >0 to compute geomean + + │ benchstat-old.txt │ benchstat-new.txt │ + │ B/op │ B/op vs base │ +ColorCode-16 1.453Ki ± ∞ ¹ +Colors-16 496.0 ± ∞ ¹ +ColorCode-8 1.453Ki ± ∞ ¹ +Colors-8 496.0 ± ∞ ¹ +geomean 859.1 859.1 ? ² ³ +¹ need >= 6 samples for confidence interval at level 0.95 +² benchmark set differs from baseline; geomeans may not be comparable +³ ratios must be >0 to compute geomean + + │ benchstat-old.txt │ benchstat-new.txt │ + │ allocs/op │ allocs/op vs base │ +ColorCode-16 15.00 ± ∞ ¹ +Colors-16 5.000 ± ∞ ¹ +ColorCode-8 15.00 ± ∞ ¹ +Colors-8 5.000 ± ∞ ¹ +geomean 8.660 8.660 ? ² ³ +¹ need >= 6 samples for confidence interval at level 0.95 +² benchmark set differs from baseline; geomeans may not be comparable +³ ratios must be >0 to compute geomean + +real 0m0.003s +user 0m0.002s +sys 0m0.001s =============================================================================== gomarkdoc --output resistorcolor-doc.md -real 0m0.011s -user 0m0.007s -sys 0m0.005s +real 0m0.013s +user 0m0.011s +sys 0m0.002s =============================================================================== @@ -378,9 +922,9 @@ func (c Color) String() string since this exercise lacks error returns on the functions being tested. -real 0m0.032s -user 0m0.014s -sys 0m0.028s +real 0m0.028s +user 0m0.008s +sys 0m0.026s =============================================================================== diff --git a/go/reverse-string/benchstat-new.txt b/go/reverse-string/benchstat-new.txt index 73cdc949..63f2e493 100644 --- a/go/reverse-string/benchstat-new.txt +++ b/go/reverse-string/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: reverse -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkReverse-4 461682 2337 ns/op 176 B/op 34 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkReverse +BenchmarkReverse-8 1559706 768.0 ns/op 176 B/op 34 allocs/op PASS -ok reverse 1.173s +ok reverse 1.946s diff --git a/go/reverse-string/benchstat-old.txt b/go/reverse-string/benchstat-old.txt new file mode 100644 index 00000000..73cdc949 --- /dev/null +++ b/go/reverse-string/benchstat-old.txt @@ -0,0 +1,7 @@ +goos: linux +goarch: amd64 +pkg: reverse +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkReverse-4 461682 2337 ns/op 176 B/op 34 allocs/op +PASS +ok reverse 1.173s diff --git a/go/reverse-string/coverage-annotations.txt b/go/reverse-string/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/reverse-string/coverage.html b/go/reverse-string/coverage.html index 5bcfcf88..9c9baf59 100644 --- a/go/reverse-string/coverage.html +++ b/go/reverse-string/coverage.html @@ -85,7 +85,7 @@ func Reverse(input string) string { var output string - for _, r := range input { + for _, r := range input { output = string(r) + output } diff --git a/go/reverse-string/coverage.out b/go/reverse-string/coverage.out index 4fcd94a9..80f82191 100644 --- a/go/reverse-string/coverage.out +++ b/go/reverse-string/coverage.out @@ -1,4 +1,4 @@ mode: count reverse/reverse_string.go:5.35,8.26 2 208 +reverse/reverse_string.go:8.26,10.3 1 5160 reverse/reverse_string.go:12.2,12.15 1 208 -reverse/reverse_string.go:8.26,10.3 1 4430 diff --git a/go/reverse-string/reverse-doc.md b/go/reverse-string/reverse-doc.md index 65a29a36..3bab1769 100755 --- a/go/reverse-string/reverse-doc.md +++ b/go/reverse-string/reverse-doc.md @@ -6,7 +6,7 @@ import "reverse" ``` -Package reverse has one public method for reversing a string\. +Package reverse has one public method for reversing a string. ## Index @@ -19,7 +19,7 @@ Package reverse has one public method for reversing a string\. func Reverse(input string) string ``` -Reverse returns a reversed string\. +Reverse returns a reversed string.

Example

diff --git a/go/reverse-string/run-tests-go.txt b/go/reverse-string/run-tests-go.txt index 9f66b4d8..60cd0920 100644 --- a/go/reverse-string/run-tests-go.txt +++ b/go/reverse-string/run-tests-go.txt @@ -5,152 +5,781 @@ Go packages: reverse =============================================================================== -golint reverse +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.006s +sys 0m0.011s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +reverse_string.go:13: File is not `gofumpt`-ed (gofumpt) + +reverse_string_test.go:11:25: Using the variable on range scope `tc` in function literal (scopelint) + if actual := Reverse(tc.input); actual != tc.expected { + ^ +reverse_string_test.go:12:44: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("Reverse(%q) = %q, want: %q", tc.input, actual, tc.expected) + ^ +reverse_string.go:14:1: block should not end with a whitespace (or comment) (wsl) +} +^ +reverse_string_test.go:31:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:12:5: testCases is a global variable (gochecknoglobals) +var testCases = []reverseTestCase{ + ^ +reverse_string_test.go:41:5: multiByteCases is a global variable (gochecknoglobals) +var multiByteCases = []reverseTestCase{ + ^ +reverse_string_test.go:8:1: Function TestReverse missing the call to method parallel (paralleltest) +func TestReverse(t *testing.T) { +^ +reverse_string_test.go:9:2: Range statement for test TestReverse missing the call to method parallel in test Run (paralleltest) + for _, tc := range append(testCases, multiByteCases...) { + ^ +reverse_string_test.go:18:1: Function TestReverseOfReverse missing the call to method parallel (paralleltest) +func TestReverseOfReverse(t *testing.T) { +^ +cases_test.go:1:9: package should be `reverse_test` instead of `reverse` (testpackage) +package reverse + ^ +reverse_string_examples_test.go:1:9: package should be `reverse_test` instead of `reverse` (testpackage) +package reverse + ^ +reverse_string_test.go:1:9: package should be `reverse_test` instead of `reverse` (testpackage) +package reverse + ^ + +real 0m0.511s +user 0m0.774s +sys 0m0.484s + + + ============================================================================== + +Exit code: -1 + +real 0m0.536s +user 0m0.784s +sys 0m0.508s + +real 0m0.538s +user 0m0.785s +sys 0m0.510s -real 0m0.089s -user 0m0.054s -sys 0m0.082s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.006s +sys 0m0.012s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.037s +user 0m0.021s +sys 0m0.026s + + + ============================================================================== + +Exit code: 0 + +real 0m0.063s +user 0m0.032s +sys 0m0.048s + +real 0m0.064s +user 0m0.033s +sys 0m0.050s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.010s +sys 0m0.007s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "reverse [reverse.test]" + +real 0m0.099s +user 0m0.115s +sys 0m0.102s + + + ============================================================================== + +Exit code: -1 + +real 0m0.126s +user 0m0.131s +sys 0m0.119s + +real 0m0.128s +user 0m0.133s +sys 0m0.120s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.007s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.189s +user 0m0.247s +sys 0m0.101s + + + ============================================================================== + +Exit code: 0 + +real 0m0.212s +user 0m0.259s +sys 0m0.119s + +real 0m0.214s +user 0m0.260s +sys 0m0.119s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.009s +sys 0m0.010s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.830s +user 0m2.106s +sys 0m0.321s + + + ============================================================================== + +Exit code: 0 + +real 0m0.858s +user 0m2.123s +sys 0m0.341s + +real 0m0.860s +user 0m2.124s +sys 0m0.342s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.010s +sys 0m0.012s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.092s +user 0m0.109s +sys 0m0.108s + + + ============================================================================== + +Exit code: 0 + +real 0m0.121s +user 0m0.122s +sys 0m0.130s + +real 0m0.122s +user 0m0.124s +sys 0m0.131s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.007s +sys 0m0.007s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.015s +user 0m0.010s +sys 0m0.008s + + + ============================================================================== + +Exit code: 0 + +real 0m0.037s +user 0m0.025s +sys 0m0.021s + +real 0m0.038s +user 0m0.026s +sys 0m0.022s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.009s +sys 0m0.008s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.468s +user 0m1.379s +sys 0m0.310s + + + ============================================================================== + +Exit code: 0 + +real 0m0.496s +user 0m1.394s +sys 0m0.331s + +real 0m0.498s +user 0m1.394s +sys 0m0.333s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.007s +sys 0m0.009s + + + ============================================================================== + +Running: gocyclo . + +4 reverse BenchmarkReverse reverse_string_test.go:27:1 +3 reverse TestReverse reverse_string_test.go:8:1 +2 reverse TestReverseOfReverse reverse_string_test.go:18:1 +2 reverse Reverse reverse_string.go:5:1 +1 reverse ExampleReverse reverse_string_examples_test.go:7:1 + +real 0m0.003s +user 0m0.003s +sys 0m0.000s + + + ============================================================================== + +Exit code: 0 + +real 0m0.028s +user 0m0.016s +sys 0m0.020s + +real 0m0.030s +user 0m0.018s +sys 0m0.020s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.023s +user 0m0.028s +sys 0m0.009s + + + ============================================================================== + +Exit code: 0 + +real 0m0.035s +user 0m0.033s +sys 0m0.019s + +real 0m0.038s +user 0m0.034s +sys 0m0.020s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.003s +sys 0m0.013s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:29:51 Including rules: default +[gosec] 2023/09/07 00:29:51 Excluding rules: default +[gosec] 2023/09/07 00:29:51 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/reverse-string +[gosec] 2023/09/07 00:29:52 Checking package: reverse +[gosec] 2023/09/07 00:29:52 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/reverse-string/reverse_string.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 14 + Nosec : 0 + Issues : 0 + + +real 0m0.074s +user 0m0.066s +sys 0m0.039s + + + ============================================================================== + +Exit code: 0 + +real 0m0.098s +user 0m0.073s +sys 0m0.062s + +real 0m0.100s +user 0m0.075s +sys 0m0.062s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out reverse +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.007s +sys 0m0.009s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestReverse - reverse_string_test.go:14: PASS: an empty string - reverse_string_test.go:14: PASS: a word - reverse_string_test.go:14: PASS: a capitalized word - reverse_string_test.go:14: PASS: a sentence with punctuation - reverse_string_test.go:14: PASS: a palindrome - reverse_string_test.go:14: PASS: an even-sized word - reverse_string_test.go:14: PASS: a multi-byte test case +=== RUN TestReverse/an_empty_string +=== RUN TestReverse/a_word +=== RUN TestReverse/a_capitalized_word +=== RUN TestReverse/a_sentence_with_punctuation +=== RUN TestReverse/a_palindrome +=== RUN TestReverse/an_even-sized_word +=== RUN TestReverse/a_multi-byte_test_case --- PASS: TestReverse (0.00s) + --- PASS: TestReverse/an_empty_string (0.00s) + --- PASS: TestReverse/a_word (0.00s) + --- PASS: TestReverse/a_capitalized_word (0.00s) + --- PASS: TestReverse/a_sentence_with_punctuation (0.00s) + --- PASS: TestReverse/a_palindrome (0.00s) + --- PASS: TestReverse/an_even-sized_word (0.00s) + --- PASS: TestReverse/a_multi-byte_test_case (0.00s) === RUN TestReverseOfReverse ---- PASS: TestReverseOfReverse (0.02s) +--- PASS: TestReverseOfReverse (0.00s) === RUN ExampleReverse --- PASS: ExampleReverse (0.00s) PASS coverage: 100.0% of statements -ok reverse 0.040s coverage: 100.0% of statements +ok reverse 0.003s coverage: 100.0% of statements -real 0m0.640s -user 0m0.750s -sys 0m0.558s +real 0m0.171s +user 0m0.214s +sys 0m0.138s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + reverse/reverse_string.go:5: Reverse 100.0% total: (statements) 100.0% -real 0m0.200s -user 0m0.103s -sys 0m0.163s +real 0m0.021s +user 0m0.007s +sys 0m0.021s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.156s -user 0m0.068s -sys 0m0.106s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic reverse +real 0m0.031s +user 0m0.016s +sys 0m0.025s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.012s +user 0m0.005s +sys 0m0.013s + +real 0m0.012s +user 0m0.005s +sys 0m0.013s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestReverse - reverse_string_test.go:14: PASS: an empty string - reverse_string_test.go:14: PASS: a word - reverse_string_test.go:14: PASS: a capitalized word - reverse_string_test.go:14: PASS: a sentence with punctuation - reverse_string_test.go:14: PASS: a palindrome - reverse_string_test.go:14: PASS: an even-sized word - reverse_string_test.go:14: PASS: a multi-byte test case ---- PASS: TestReverse (0.01s) +=== RUN TestReverse/an_empty_string +=== RUN TestReverse/a_word +=== RUN TestReverse/a_capitalized_word +=== RUN TestReverse/a_sentence_with_punctuation +=== RUN TestReverse/a_palindrome +=== RUN TestReverse/an_even-sized_word +=== RUN TestReverse/a_multi-byte_test_case +--- PASS: TestReverse (0.00s) + --- PASS: TestReverse/an_empty_string (0.00s) + --- PASS: TestReverse/a_word (0.00s) + --- PASS: TestReverse/a_capitalized_word (0.00s) + --- PASS: TestReverse/a_sentence_with_punctuation (0.00s) + --- PASS: TestReverse/a_palindrome (0.00s) + --- PASS: TestReverse/an_even-sized_word (0.00s) + --- PASS: TestReverse/a_multi-byte_test_case (0.00s) === RUN TestReverseOfReverse --- PASS: TestReverseOfReverse (0.00s) === RUN ExampleReverse --- PASS: ExampleReverse (0.00s) PASS coverage: 100.0% of statements -ok reverse 0.043s coverage: 100.0% of statements +ok reverse 1.020s coverage: 100.0% of statements -real 0m0.755s -user 0m0.836s -sys 0m0.616s +real 0m1.287s +user 0m0.320s +sys 0m0.210s -=============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -goos: linux -goarch: amd64 -pkg: reverse -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkReverse-4 461682 2337 ns/op 176 B/op 34 allocs/op -PASS -ok reverse 1.173s + ============================================================================== -real 0m1.634s -user 0m1.831s -sys 0m0.428s - -=============================================================================== +Exit code: 0 -go test -tags bonus -PASS -ok reverse 0.009s +real 0m1.547s +user 0m0.572s +sys 0m0.430s -real 0m0.625s -user 0m0.742s -sys 0m0.483s +real 0m1.549s +user 0m0.573s +sys 0m0.432s =============================================================================== -No old benchmarks to run benchstat against. - -=============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go vet reverse +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +goos: linux +goarch: amd64 +pkg: reverse +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkReverse +BenchmarkReverse-8 1559706 768.0 ns/op 176 B/op 34 allocs/op +PASS +ok reverse 1.946s -real 0m0.458s -user 0m0.579s -sys 0m0.453s +real 0m2.112s +user 0m2.186s +sys 0m0.153s =============================================================================== -go fix reverse +gotest -v -tags bonus +=== RUN TestReverse +=== RUN TestReverse/an_empty_string +=== RUN TestReverse/a_word +=== RUN TestReverse/a_capitalized_word +=== RUN TestReverse/a_sentence_with_punctuation +=== RUN TestReverse/a_palindrome +=== RUN TestReverse/an_even-sized_word +=== RUN TestReverse/a_multi-byte_test_case +--- PASS: TestReverse (0.00s) + --- PASS: TestReverse/an_empty_string (0.00s) + --- PASS: TestReverse/a_word (0.00s) + --- PASS: TestReverse/a_capitalized_word (0.00s) + --- PASS: TestReverse/a_sentence_with_punctuation (0.00s) + --- PASS: TestReverse/a_palindrome (0.00s) + --- PASS: TestReverse/an_even-sized_word (0.00s) + --- PASS: TestReverse/a_multi-byte_test_case (0.00s) +=== RUN TestReverseOfReverse +--- PASS: TestReverseOfReverse (0.00s) +=== RUN ExampleReverse +--- PASS: ExampleReverse (0.00s) +PASS +ok reverse 0.004s -real 0m0.071s -user 0m0.031s -sys 0m0.087s +real 0m0.141s +user 0m0.204s +sys 0m0.136s =============================================================================== -gosec ./reverse-string -[gosec] 2022/06/28 22:13:36 Including rules: default -[gosec] 2022/06/28 22:13:36 Excluding rules: default -[gosec] 2022/06/28 22:13:36 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/reverse-string -[gosec] 2022/06/28 22:13:37 Checking package: reverse -[gosec] 2022/06/28 22:13:37 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/reverse-string/reverse_string.go -Results: +benchstat benchstat-old.txt benchstat-new.txt +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: reverse +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Reverse-8 768.0n ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Reverse-8 176.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Reverse-8 34.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Reverse-4 2.337µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -Summary: - Files: 1 - Lines: 14 - Nosec: 0 - Issues: 0 + │ benchstat-old.txt │ + │ B/op │ +Reverse-4 176.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + │ benchstat-old.txt │ + │ allocs/op │ +Reverse-4 34.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.315s -user 0m0.314s -sys 0m0.223s +real 0m0.002s +user 0m0.000s +sys 0m0.003s =============================================================================== gomarkdoc --output reverse-doc.md -real 0m0.047s -user 0m0.028s -sys 0m0.024s +real 0m0.009s +user 0m0.004s +sys 0m0.005s =============================================================================== @@ -165,9 +794,9 @@ func Reverse(input string) string Reverse returns a reversed string. -real 0m0.189s -user 0m0.095s -sys 0m0.183s +real 0m0.030s +user 0m0.007s +sys 0m0.030s =============================================================================== diff --git a/go/rna-transcription/benchstat-new.txt b/go/rna-transcription/benchstat-new.txt index 5d8963b8..e7dbd16a 100644 --- a/go/rna-transcription/benchstat-new.txt +++ b/go/rna-transcription/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: strand -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkRNATranscription-4 31231 37861 ns/op 12940 B/op 223 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkRNATranscription +BenchmarkRNATranscription-8 97970 13015 ns/op 13023 B/op 223 allocs/op PASS -ok strand 1.561s +ok strand 2.379s diff --git a/go/rna-transcription/benchstat-old.txt b/go/rna-transcription/benchstat-old.txt new file mode 100644 index 00000000..5d8963b8 --- /dev/null +++ b/go/rna-transcription/benchstat-old.txt @@ -0,0 +1,7 @@ +goos: linux +goarch: amd64 +pkg: strand +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkRNATranscription-4 31231 37861 ns/op 12940 B/op 223 allocs/op +PASS +ok strand 1.561s diff --git a/go/rna-transcription/coverage-annotations.txt b/go/rna-transcription/coverage-annotations.txt new file mode 100644 index 00000000..815e5079 --- /dev/null +++ b/go/rna-transcription/coverage-annotations.txt @@ -0,0 +1,6 @@ + +25 func (d DNA) String() string { +26 // we need string(d) here to prevent recursion +27 MISS return fmt.Sprintf("%s", string(d)) +28 } + diff --git a/go/rna-transcription/coverage.html b/go/rna-transcription/coverage.html index 677ffc87..e6f529e2 100644 --- a/go/rna-transcription/coverage.html +++ b/go/rna-transcription/coverage.html @@ -55,7 +55,7 @@

@@ -102,7 +102,7 @@ } // String returns a pretty formated representation of a DNA type. -func (d DNA) String() string { +func (d DNA) String() string { // we need string(d) here to prevent recursion return fmt.Sprintf("%s", string(d)) } diff --git a/go/rna-transcription/coverage.out b/go/rna-transcription/coverage.out index 959f0ff6..d4b941f7 100644 --- a/go/rna-transcription/coverage.out +++ b/go/rna-transcription/coverage.out @@ -1,15 +1,15 @@ mode: count strand/rna_transcription.go:13.38,17.79 2 7 -strand/rna_transcription.go:21.2,21.18 1 6 strand/rna_transcription.go:17.79,19.3 1 1 -strand/rna_transcription.go:25.30,28.2 1 1 +strand/rna_transcription.go:21.2,21.18 1 6 +strand/rna_transcription.go:25.30,28.2 1 0 strand/rna_transcription.go:31.33,32.29 1 7 -strand/rna_transcription.go:36.2,45.22 3 6 -strand/rna_transcription.go:53.2,53.12 1 6 strand/rna_transcription.go:32.29,33.11 1 1 +strand/rna_transcription.go:36.2,45.22 3 6 strand/rna_transcription.go:45.22,48.12 2 20 strand/rna_transcription.go:48.12,50.4 1 20 +strand/rna_transcription.go:53.2,53.12 1 6 strand/rna_transcription.go:60.30,63.2 1 6 strand/rna_transcription.go:66.29,67.17 1 8 -strand/rna_transcription.go:71.2,76.21 4 7 strand/rna_transcription.go:67.17,69.3 1 1 +strand/rna_transcription.go:71.2,76.21 4 7 diff --git a/go/rna-transcription/run-tests-go.txt b/go/rna-transcription/run-tests-go.txt index fee41f9b..1d15bd3d 100644 --- a/go/rna-transcription/run-tests-go.txt +++ b/go/rna-transcription/run-tests-go.txt @@ -5,144 +5,820 @@ Go packages: strand =============================================================================== -golint strand +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.023s +sys 0m0.029s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +rna_transcription.go:71:10: var-declaration: should omit type DNA from declaration of var dna; it will be inferred from the right-hand side (revive) + var dna DNA = DNA(s) + ^ +rna_transcription_examples_test.go:9:15: var-declaration: should omit type string from declaration of var validDNA; it will be inferred from the right-hand side (revive) + var validDNA string = "GCTA" + ^ +rna_transcription_examples_test.go:17:17: var-declaration: should omit type string from declaration of var invalidDNA; it will be inferred from the right-hand side (revive) + var invalidDNA string = "GCXTA" + ^ +rna_transcription_test.go:8:23: Using the variable on range scope `tc` in function literal (scopelint) + if actual := ToRNA(tc.input); actual != tc.expected { + ^ +rna_transcription_test.go:9:42: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("ToRNA(%q) = %q, want: %q", tc.input, actual, tc.expected) + ^ +rna_transcription.go:72:2: declarations should never be cuddled (wsl) + var rna RNA + ^ +rna_transcription_test.go:19:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +rna_transcription.go:18:17: err113: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"DNA sequence, %q, contains invalid nucleotides\", string(d))" (goerr113) + return false, fmt.Errorf("DNA sequence, %q, contains invalid nucleotides", string(d)) + ^ +rna_transcription.go:27:9: S1025: the argument is already a string, there's no need to use fmt.Sprintf (gosimple) + return fmt.Sprintf("%s", string(d)) + ^ +rna_transcription.go:62:9: S1025: the argument is already a string, there's no need to use fmt.Sprintf (gosimple) + return fmt.Sprintf("%s", string(d)) + ^ +rna_transcription_examples_test.go:16:1: Function TestPanic missing the call to method parallel (paralleltest) +func TestPanic(t *testing.T) { +^ +rna_transcription_test.go:5:1: Function TestRNATranscription missing the call to method parallel (paralleltest) +func TestRNATranscription(t *testing.T) { +^ +rna_transcription_test.go:6:2: Range statement for test TestRNATranscription missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +cases_test.go:1:9: package should be `strand_test` instead of `strand` (testpackage) +package strand + ^ +rna_transcription_examples_test.go:1:9: package should be `strand_test` instead of `strand` (testpackage) +package strand + ^ +rna_transcription_test.go:1:9: package should be `strand_test` instead of `strand` (testpackage) +package strand + ^ + +real 0m0.492s +user 0m0.680s +sys 0m0.464s + + + ============================================================================== + +Exit code: -1 + +real 0m0.530s +user 0m0.713s +sys 0m0.503s + +real 0m0.532s +user 0m0.715s +sys 0m0.504s -real 0m0.212s -user 0m0.182s -sys 0m0.207s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.025s +sys 0m0.025s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +rna_transcription_examples_test.go + (9, 15) https://revive.run/r#var-declaration should omit type string from declaration of var validDNA; it will be inferred from the right-hand side + (17, 17) https://revive.run/r#var-declaration should omit type string from declaration of var invalidDNA; it will be inferred from the right-hand side + +rna_transcription.go + (71, 10) https://revive.run/r#var-declaration should omit type DNA from declaration of var dna; it will be inferred from the right-hand side + + + ✖ 3 problems (0 errors) (3 warnings) + +real 0m0.049s +user 0m0.026s +sys 0m0.037s + + + ============================================================================== + +Exit code: 0 + +real 0m0.083s +user 0m0.055s +sys 0m0.073s + +real 0m0.086s +user 0m0.056s +sys 0m0.074s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.036s +user 0m0.033s +sys 0m0.037s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "strand" + +real 0m0.094s +user 0m0.090s +sys 0m0.117s + + + ============================================================================== + +Exit code: -1 + +real 0m0.147s +user 0m0.129s +sys 0m0.169s + +real 0m0.149s +user 0m0.129s +sys 0m0.171s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.026s +sys 0m0.022s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +rna_transcription.go:27:9: the argument is already a string, there's no need to use fmt.Sprintf (S1025) +rna_transcription.go:62:9: the argument is already a string, there's no need to use fmt.Sprintf (S1025) +rna_transcription.go:71:10: should omit type DNA from declaration; it will be inferred from the right-hand side (ST1023) +rna_transcription.go:72:2: should merge variable declaration with assignment on next line (S1021) +rna_transcription_examples_test.go:9:15: should omit type string from declaration; it will be inferred from the right-hand side (ST1023) +rna_transcription_examples_test.go:17:17: should omit type string from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.155s +user 0m0.191s +sys 0m0.124s + + + ============================================================================== + +Exit code: -1 + +real 0m0.190s +user 0m0.221s +sys 0m0.158s + +real 0m0.192s +user 0m0.221s +sys 0m0.160s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.022s +sys 0m0.020s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./rna_transcription.go:67:5: emptyStringTest: replace `len(s) == 0` with `s == ""` +./rna_transcription.go:27:9: redundantSprint: string(d) is already string +./rna_transcription.go:62:9: redundantSprint: string(d) is already string + +real 0m0.862s +user 0m2.039s +sys 0m0.292s + + + ============================================================================== + +Exit code: -1 + +real 0m0.896s +user 0m2.071s +sys 0m0.320s + +real 0m0.899s +user 0m2.071s +sys 0m0.323s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.024s +sys 0m0.030s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.085s +user 0m0.145s +sys 0m0.105s + + + ============================================================================== + +Exit code: 0 + +real 0m0.124s +user 0m0.177s +sys 0m0.143s + +real 0m0.127s +user 0m0.178s +sys 0m0.144s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.022s +sys 0m0.024s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.026s +user 0m0.027s +sys 0m0.030s + + + ============================================================================== + +Exit code: 0 + +real 0m0.060s +user 0m0.054s +sys 0m0.063s + +real 0m0.062s +user 0m0.056s +sys 0m0.063s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.024s +sys 0m0.033s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.439s +user 0m1.259s +sys 0m0.276s + + + ============================================================================== + +Exit code: 0 + +real 0m0.485s +user 0m1.286s +sys 0m0.326s + +real 0m0.487s +user 0m1.286s +sys 0m0.327s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.020s +sys 0m0.021s + + + ============================================================================== + +Running: gocyclo . + +4 strand BenchmarkRNATranscription rna_transcription_test.go:15:1 +4 strand (DNA).ConvertToRNA rna_transcription.go:31:1 +3 strand TestRNATranscription rna_transcription_test.go:5:1 +2 strand TestPanic rna_transcription_examples_test.go:16:1 +2 strand ToRNA rna_transcription.go:66:1 +2 strand (DNA).IsValid rna_transcription.go:13:1 +1 strand ExampleToRNA rna_transcription_examples_test.go:8:1 +1 strand (RNA).String rna_transcription.go:60:1 +1 strand (DNA).String rna_transcription.go:25:1 + +real 0m0.003s +user 0m0.001s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.035s +user 0m0.024s +sys 0m0.035s + +real 0m0.038s +user 0m0.026s +sys 0m0.035s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.024s +user 0m0.023s +sys 0m0.013s + + + ============================================================================== + +Exit code: 0 + +real 0m0.035s +user 0m0.029s +sys 0m0.023s + +real 0m0.037s +user 0m0.029s +sys 0m0.025s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out strand +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.018s +sys 0m0.032s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:29:58 Including rules: default +[gosec] 2023/09/07 00:29:58 Excluding rules: default +[gosec] 2023/09/07 00:29:58 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/rna-transcription +[gosec] 2023/09/07 00:29:58 Checking package: strand +[gosec] 2023/09/07 00:29:58 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/rna-transcription/rna_transcription.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 77 + Nosec : 0 + Issues : 0 + + +real 0m0.126s +user 0m0.149s +sys 0m0.118s + + + ============================================================================== + +Exit code: 0 + +real 0m0.164s +user 0m0.171s +sys 0m0.160s + +real 0m0.166s +user 0m0.173s +sys 0m0.160s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.022s +sys 0m0.028s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestPanic --- PASS: TestPanic (0.00s) === RUN TestRNATranscription - rna_transcription_test.go:11: PASS: Empty RNA sequence - rna_transcription_test.go:11: PASS: RNA complement of cytosine is guanine - rna_transcription_test.go:11: PASS: RNA complement of guanine is cytosine - rna_transcription_test.go:11: PASS: RNA complement of thymine is adenine - rna_transcription_test.go:11: PASS: RNA complement of adenine is uracil - rna_transcription_test.go:11: PASS: RNA complement +=== RUN TestRNATranscription/Empty_RNA_sequence +=== RUN TestRNATranscription/RNA_complement_of_cytosine_is_guanine +=== RUN TestRNATranscription/RNA_complement_of_guanine_is_cytosine +=== RUN TestRNATranscription/RNA_complement_of_thymine_is_adenine +=== RUN TestRNATranscription/RNA_complement_of_adenine_is_uracil +=== RUN TestRNATranscription/RNA_complement --- PASS: TestRNATranscription (0.00s) + --- PASS: TestRNATranscription/Empty_RNA_sequence (0.00s) + --- PASS: TestRNATranscription/RNA_complement_of_cytosine_is_guanine (0.00s) + --- PASS: TestRNATranscription/RNA_complement_of_guanine_is_cytosine (0.00s) + --- PASS: TestRNATranscription/RNA_complement_of_thymine_is_adenine (0.00s) + --- PASS: TestRNATranscription/RNA_complement_of_adenine_is_uracil (0.00s) + --- PASS: TestRNATranscription/RNA_complement (0.00s) === RUN ExampleToRNA --- PASS: ExampleToRNA (0.00s) PASS -coverage: 100.0% of statements -ok strand 0.005s coverage: 100.0% of statements +coverage: 95.2% of statements +ok strand 0.004s coverage: 95.2% of statements -real 0m0.574s -user 0m0.676s -sys 0m0.463s +real 0m0.172s +user 0m0.199s +sys 0m0.137s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + strand/rna_transcription.go:13: IsValid 100.0% -strand/rna_transcription.go:25: String 100.0% +strand/rna_transcription.go:25: String 0.0% strand/rna_transcription.go:31: ConvertToRNA 100.0% strand/rna_transcription.go:60: String 100.0% strand/rna_transcription.go:66: ToRNA 100.0% -total: (statements) 100.0% +total: (statements) 95.2% -real 0m0.244s -user 0m0.240s -sys 0m0.281s +real 0m0.048s +user 0m0.065s +sys 0m0.062s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.288s -user 0m0.286s -sys 0m0.239s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic strand +real 0m0.053s +user 0m0.057s +sys 0m0.078s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +25 func (d DNA) String() string { +26 // we need string(d) here to prevent recursion +27 MISS return fmt.Sprintf("%s", string(d)) +28 } + + +real 0m0.018s +user 0m0.018s +sys 0m0.022s + +real 0m0.018s +user 0m0.018s +sys 0m0.022s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestPanic --- PASS: TestPanic (0.00s) === RUN TestRNATranscription - rna_transcription_test.go:11: PASS: Empty RNA sequence - rna_transcription_test.go:11: PASS: RNA complement of cytosine is guanine - rna_transcription_test.go:11: PASS: RNA complement of guanine is cytosine - rna_transcription_test.go:11: PASS: RNA complement of thymine is adenine - rna_transcription_test.go:11: PASS: RNA complement of adenine is uracil - rna_transcription_test.go:11: PASS: RNA complement +=== RUN TestRNATranscription/Empty_RNA_sequence +=== RUN TestRNATranscription/RNA_complement_of_cytosine_is_guanine +=== RUN TestRNATranscription/RNA_complement_of_guanine_is_cytosine +=== RUN TestRNATranscription/RNA_complement_of_thymine_is_adenine +=== RUN TestRNATranscription/RNA_complement_of_adenine_is_uracil +=== RUN TestRNATranscription/RNA_complement --- PASS: TestRNATranscription (0.00s) + --- PASS: TestRNATranscription/Empty_RNA_sequence (0.00s) + --- PASS: TestRNATranscription/RNA_complement_of_cytosine_is_guanine (0.00s) + --- PASS: TestRNATranscription/RNA_complement_of_guanine_is_cytosine (0.00s) + --- PASS: TestRNATranscription/RNA_complement_of_thymine_is_adenine (0.00s) + --- PASS: TestRNATranscription/RNA_complement_of_adenine_is_uracil (0.00s) + --- PASS: TestRNATranscription/RNA_complement (0.00s) === RUN ExampleToRNA --- PASS: ExampleToRNA (0.00s) PASS -coverage: 100.0% of statements -ok strand 0.030s coverage: 100.0% of statements +coverage: 95.2% of statements +ok strand 1.014s coverage: 95.2% of statements + +real 0m1.241s +user 0m0.281s +sys 0m0.166s + -real 0m0.607s -user 0m0.694s -sys 0m0.403s + ============================================================================== + +Exit code: 0 + +real 0m1.568s +user 0m0.652s +sys 0m0.500s + +real 0m1.571s +user 0m0.653s +sys 0m0.501s =============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: strand -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkRNATranscription-4 31231 37861 ns/op 12940 B/op 223 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkRNATranscription +BenchmarkRNATranscription-8 97970 13015 ns/op 13023 B/op 223 allocs/op PASS -ok strand 1.561s +ok strand 2.379s -real 0m2.051s -user 0m2.882s -sys 0m0.517s +real 0m2.529s +user 0m2.712s +sys 0m0.231s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestPanic +--- PASS: TestPanic (0.00s) +=== RUN TestRNATranscription +=== RUN TestRNATranscription/Empty_RNA_sequence +=== RUN TestRNATranscription/RNA_complement_of_cytosine_is_guanine +=== RUN TestRNATranscription/RNA_complement_of_guanine_is_cytosine +=== RUN TestRNATranscription/RNA_complement_of_thymine_is_adenine +=== RUN TestRNATranscription/RNA_complement_of_adenine_is_uracil +=== RUN TestRNATranscription/RNA_complement +--- PASS: TestRNATranscription (0.00s) + --- PASS: TestRNATranscription/Empty_RNA_sequence (0.00s) + --- PASS: TestRNATranscription/RNA_complement_of_cytosine_is_guanine (0.00s) + --- PASS: TestRNATranscription/RNA_complement_of_guanine_is_cytosine (0.00s) + --- PASS: TestRNATranscription/RNA_complement_of_thymine_is_adenine (0.00s) + --- PASS: TestRNATranscription/RNA_complement_of_adenine_is_uracil (0.00s) + --- PASS: TestRNATranscription/RNA_complement (0.00s) +=== RUN ExampleToRNA +--- PASS: ExampleToRNA (0.00s) PASS -ok strand 0.009s - -real 0m0.545s -user 0m0.581s -sys 0m0.453s - -=============================================================================== - -No old benchmarks to run benchstat against. - -=============================================================================== - -go vet strand +ok strand 0.002s -real 0m0.358s -user 0m0.426s -sys 0m0.352s +real 0m0.127s +user 0m0.169s +sys 0m0.137s =============================================================================== -go fix strand +benchstat benchstat-old.txt benchstat-new.txt +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: strand +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +RNATranscription-8 13.02µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +RNATranscription-8 12.72Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +RNATranscription-8 223.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.143s -user 0m0.147s -sys 0m0.116s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +RNATranscription-4 37.86µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +RNATranscription-4 12.64Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./rna-transcription -[gosec] 2022/06/27 21:56:14 Including rules: default -[gosec] 2022/06/27 21:56:14 Excluding rules: default -[gosec] 2022/06/27 21:56:14 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/rna-transcription -2022/06/27 21:56:15 internal error: package "fmt" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +RNATranscription-4 223.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.441s -user 0m0.458s -sys 0m0.329s +real 0m0.003s +user 0m0.001s +sys 0m0.002s =============================================================================== gomarkdoc --output strand-doc.md -real 0m0.030s -user 0m0.020s -sys 0m0.014s +real 0m0.010s +user 0m0.005s +sys 0m0.005s =============================================================================== @@ -178,9 +854,9 @@ func (d RNA) String() string String returns a pretty formated representation of a DNA type. -real 0m0.243s -user 0m0.222s -sys 0m0.240s +real 0m0.044s +user 0m0.026s +sys 0m0.040s =============================================================================== diff --git a/go/rna-transcription/strand-doc.md b/go/rna-transcription/strand-doc.md index a9eb1431..0064ce7a 100755 --- a/go/rna-transcription/strand-doc.md +++ b/go/rna-transcription/strand-doc.md @@ -6,7 +6,7 @@ import "strand" ``` -Package strand is used to convert DNA sequences into RNA sequences\. +Package strand is used to convert DNA sequences into RNA sequences. ## Index @@ -25,16 +25,16 @@ Package strand is used to convert DNA sequences into RNA sequences\. func ToRNA(s string) string ``` -ToRNA returns an RNA sequence from a DNA sequence\. +ToRNA returns an RNA sequence from a DNA sequence.
Example

```go { - var validDNA DNA = DNA("GCTA") + var validDNA string = "GCTA" - fmt.Println(ToRNA(validDNA.String())) + fmt.Println(ToRNA(validDNA)) } ``` @@ -50,7 +50,7 @@ CGAU ## type [DNA]() -DNA is a list of nucleotides\. +DNA is a list of nucleotides. ```go type DNA string @@ -62,7 +62,7 @@ type DNA string func (d DNA) ConvertToRNA() RNA ``` -ConvertToRNA returns a pretty formated representation of a DNA type\. +ConvertToRNA returns a pretty formated representation of a DNA type. ### func \(DNA\) [IsValid]() @@ -70,7 +70,7 @@ ConvertToRNA returns a pretty formated representation of a DNA type\. func (d DNA) IsValid() (bool, error) ``` -IsValid returns true if the DNA strand is valid\. +IsValid returns true if the DNA strand is valid. ### func \(DNA\) [String]() @@ -78,11 +78,11 @@ IsValid returns true if the DNA strand is valid\. func (d DNA) String() string ``` -String returns a pretty formated representation of a DNA type\. +String returns a pretty formated representation of a DNA type. ## type [RNA]() -RNA is a list of nucleotides\. +RNA is a list of nucleotides. ```go type RNA string @@ -94,7 +94,7 @@ type RNA string func (d RNA) String() string ``` -String returns a pretty formated representation of a DNA type\. +String returns a pretty formated representation of a DNA type. diff --git a/go/roman-numerals/benchstat-new.txt b/go/roman-numerals/benchstat-new.txt index 4533337c..0c309e3c 100644 --- a/go/roman-numerals/benchstat-new.txt +++ b/go/roman-numerals/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: romannumerals -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkRomanNumerals-4 63630 19132 ns/op 176 B/op 61 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkRomanNumerals +BenchmarkRomanNumerals-8 163629 7754 ns/op 256 B/op 63 allocs/op PASS -ok romannumerals 1.473s +ok romannumerals 1.349s diff --git a/go/roman-numerals/benchstat-old.txt b/go/roman-numerals/benchstat-old.txt index f704e6c7..4533337c 100644 --- a/go/roman-numerals/benchstat-old.txt +++ b/go/roman-numerals/benchstat-old.txt @@ -2,6 +2,6 @@ goos: linux goarch: amd64 pkg: romannumerals cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkRomanNumerals-4 85948 13769 ns/op 176 B/op 61 allocs/op +BenchmarkRomanNumerals-4 63630 19132 ns/op 176 B/op 61 allocs/op PASS -ok romannumerals 1.361s +ok romannumerals 1.473s diff --git a/go/roman-numerals/coverage-annotations.txt b/go/roman-numerals/coverage-annotations.txt new file mode 100644 index 00000000..95299429 --- /dev/null +++ b/go/roman-numerals/coverage-annotations.txt @@ -0,0 +1,120 @@ + + 10 func ToRomanNumeral(input int) (string, error) { + 11 if input <= 0 { + 12 return "", errors.New("Roman numerals can't be less than or equal to 0") + 13 } + 14 + 15 // Only process numbers <=3k. + 16 if input > 3_000 { + 17 return "", errors.New("Roman numerals were apparently rarely greater than 3k") + 18 } + 19 + 20 /* + 21 Steps + 22 1. set remainder to number + 23 2. divide remainder by 1000 + 24 3. if == 0 then look for special case for IV, IX, XL, XC, CD, CM + 25 a. if true then record it and substract it from the remainder + 26 b. if false continue with the next number + 27 4. if != 0 then + 28 a. output n, nn, nnn case + 29 b. update the remainder + 30 c. continue with the next number + 31 */ + 32 + 33 var d2r map[int]string = map[int]string{ + 34 1: "I", + 35 5: "V", + 36 10: "X", + 37 50: "L", + 38 100: "C", + 39 500: "D", + 40 1_000: "M", + 41 } + 42 + 43 var subLadder map[int]int = map[int]int{ + 44 10: 1, + 45 50: 10, + 46 100: 10, + 47 500: 100, + 48 1_000: 100, + 49 } + 50 + 51 var outLadder map[int]string = map[int]string{ + 52 10: "I", + 53 50: "X", + 54 100: "X", + 55 500: "C", + 56 1_000: "C", + 57 } + 58 + 59 var remainder int = input + 60 var output string + 61 var register int + 62 + 63 var numbers []int = []int{1_000, 500, 100, 50, 10, 5, 1} + 64 + 65 for _, next := range numbers { + 66 + 67 if remainder <= 0 { + 68 break + 69 } + 70 + 71 register = remainder / next + 72 + 73 if register == 0 { + 74 subNum, found := subLadder[next] + 75 + 76 if !found { + 77 subNum = 1 + 78 } + 79 + 80 if remainder >= next-subNum { + 81 + 82 // IV IX XL XC CD CM + 83 value, found := outLadder[next] + 84 + 85 if !found { + 86 value = "I" + 87 } + 88 + 89 output += value + 90 + 91 value, found = d2r[next] + 92 + 93 if !found { + 94 MISS value = "" + 95 } + 96 + 97 output += value + 98 + 99 register = remainder - (next - subNum) +100 +101 remainder = register +102 +103 } +104 +105 continue +106 +107 } else { +108 +109 value, found := d2r[next] +110 +111 if !found { +112 MISS value = "" +113 } +114 +115 // III xxx CCC +116 output += strings.Repeat(value, register) +117 +118 register = remainder % next +119 +120 remainder = register +121 +122 continue +123 } +124 } +125 +126 return output, nil +127 } + diff --git a/go/roman-numerals/coverage.html b/go/roman-numerals/coverage.html index fd446dd3..1455b949 100644 --- a/go/roman-numerals/coverage.html +++ b/go/roman-numerals/coverage.html @@ -87,13 +87,13 @@ ) // ToRomanNumeral returns a roman numeral string and and error code. -func ToRomanNumeral(input int) (string, error) { +func ToRomanNumeral(input int) (string, error) { if input <= 0 { return "", errors.New("Roman numerals can't be less than or equal to 0") } // Only process numbers <=3k. - if input > 3_000 { + if input > 3_000 { return "", errors.New("Roman numerals were apparently rarely greater than 3k") } @@ -110,7 +110,7 @@ c. continue with the next number */ - var d2r map[int]string = map[int]string{ + var d2r map[int]string = map[int]string{ 1: "I", 5: "V", 10: "X", @@ -142,22 +142,22 @@ var numbers []int = []int{1_000, 500, 100, 50, 10, 5, 1} - for _, next := range numbers { + for _, next := range numbers { if remainder <= 0 { break } - register = remainder / next + register = remainder / next - if register == 0 { + if register == 0 { subNum, found := subLadder[next] if !found { subNum = 1 } - if remainder >= next-subNum { + if remainder >= next-subNum { // IV IX XL XC CD CM value, found := outLadder[next] @@ -182,9 +182,9 @@ } - continue + continue - } else { + } else { value, found := d2r[next] @@ -193,7 +193,7 @@ } // III xxx CCC - output += strings.Repeat(value, register) + output += strings.Repeat(value, register) register = remainder % next @@ -203,7 +203,7 @@ } } - return output, nil + return output, nil } diff --git a/go/roman-numerals/coverage.out b/go/roman-numerals/coverage.out index a9e7d431..4f14697c 100644 --- a/go/roman-numerals/coverage.out +++ b/go/roman-numerals/coverage.out @@ -1,22 +1,22 @@ mode: count -romannumerals/roman_numerals.go:10.48,11.16 1 44 -romannumerals/roman_numerals.go:16.2,16.19 1 41 -romannumerals/roman_numerals.go:33.2,65.31 8 39 -romannumerals/roman_numerals.go:126.2,126.20 1 39 +romannumerals/roman_numerals.go:10.48,11.16 1 49 romannumerals/roman_numerals.go:11.16,13.3 1 3 +romannumerals/roman_numerals.go:16.2,16.19 1 46 romannumerals/roman_numerals.go:16.19,18.3 1 2 -romannumerals/roman_numerals.go:65.31,67.21 1 244 -romannumerals/roman_numerals.go:71.3,73.20 2 227 +romannumerals/roman_numerals.go:33.2,65.31 8 44 +romannumerals/roman_numerals.go:65.31,67.21 1 279 romannumerals/roman_numerals.go:67.21,68.9 1 17 -romannumerals/roman_numerals.go:73.20,76.14 2 172 -romannumerals/roman_numerals.go:80.4,80.32 1 172 -romannumerals/roman_numerals.go:105.4,105.12 1 172 +romannumerals/roman_numerals.go:71.3,73.20 2 262 +romannumerals/roman_numerals.go:73.20,76.14 2 182 romannumerals/roman_numerals.go:76.14,78.5 1 19 +romannumerals/roman_numerals.go:80.4,80.32 1 182 romannumerals/roman_numerals.go:80.32,85.15 2 13 -romannumerals/roman_numerals.go:89.5,93.15 3 13 -romannumerals/roman_numerals.go:97.5,101.25 3 13 romannumerals/roman_numerals.go:85.15,87.6 1 3 +romannumerals/roman_numerals.go:89.5,93.15 3 13 romannumerals/roman_numerals.go:93.15,95.6 1 0 -romannumerals/roman_numerals.go:107.9,111.14 2 55 -romannumerals/roman_numerals.go:116.4,122.12 4 55 +romannumerals/roman_numerals.go:97.5,101.25 3 13 +romannumerals/roman_numerals.go:105.4,105.12 1 182 +romannumerals/roman_numerals.go:107.9,111.14 2 80 romannumerals/roman_numerals.go:111.14,113.5 1 0 +romannumerals/roman_numerals.go:116.4,122.12 4 80 +romannumerals/roman_numerals.go:126.2,126.20 1 44 diff --git a/go/roman-numerals/romannumerals-doc.md b/go/roman-numerals/romannumerals-doc.md index 557ceb93..2eb5a6a3 100755 --- a/go/roman-numerals/romannumerals-doc.md +++ b/go/roman-numerals/romannumerals-doc.md @@ -6,7 +6,7 @@ import "romannumerals" ``` -Package romannumerals is used to convert numbers from decimals to roman numerals\. +Package romannumerals is used to convert numbers from decimals to roman numerals. ## Index @@ -19,7 +19,7 @@ Package romannumerals is used to convert numbers from decimals to roman numerals func ToRomanNumeral(input int) (string, error) ``` -ToRomanNumeral returns a roman numeral string and and error code\. +ToRomanNumeral returns a roman numeral string and and error code.

Example

diff --git a/go/roman-numerals/run-tests-go.txt b/go/roman-numerals/run-tests-go.txt index dfcebba4..dff7b984 100644 --- a/go/roman-numerals/run-tests-go.txt +++ b/go/roman-numerals/run-tests-go.txt @@ -5,145 +5,1119 @@ Go packages: romannumerals =============================================================================== -golint romannumerals +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.142s -user 0m0.118s -sys 0m0.124s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.010s +sys 0m0.019s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +roman_numerals_test.go:43:18: Error return value is not checked (errcheck) + ToRomanNumeral(tc.input) + ^ +roman_numerals.go:10: Function 'ToRomanNumeral' is too long (116 > 60) (funlen) +func ToRomanNumeral(input int) (string, error) { +roman_numerals_test.go:17: File is not `gofumpt`-ed (gofumpt) + +roman_numerals.go:25:38: `substract` is a misspelling of `subtract` (misspell) + a. if true then record it and substract it from the remainder + ^ +roman_numerals.go:73:3: `if register == 0` has complex nested blocks (complexity: 8) (nestif) + if register == 0 { + ^ +roman_numerals.go:33:10: var-declaration: should omit type map[int]string from declaration of var d2r; it will be inferred from the right-hand side (revive) + var d2r map[int]string = map[int]string{ + ^ +roman_numerals.go:43:16: var-declaration: should omit type map[int]int from declaration of var subLadder; it will be inferred from the right-hand side (revive) + var subLadder map[int]int = map[int]int{ + ^ +roman_numerals.go:51:16: var-declaration: should omit type map[int]string from declaration of var outLadder; it will be inferred from the right-hand side (revive) + var outLadder map[int]string = map[int]string{ + ^ +roman_numerals.go:59:16: var-declaration: should omit type int from declaration of var remainder; it will be inferred from the right-hand side (revive) + var remainder int = input + ^ +roman_numerals.go:63:14: var-declaration: should omit type []int from declaration of var numbers; it will be inferred from the right-hand side (revive) + var numbers []int = []int{1_000, 500, 100, 50, 10, 5, 1} + ^ +roman_numerals_test.go:8:34: Using the variable on range scope `tc` in function literal (scopelint) + actual, err := ToRomanNumeral(tc.input) + ^ +roman_numerals_test.go:11:65: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("ToRomanNumeral(%d) returned error: %v, want: %q", tc.input, err, tc.expected) + ^ +roman_numerals_test.go:13:17: Using the variable on range scope `tc` in function literal (scopelint) + if actual != tc.expected { + ^ +roman_numerals.go:65: unnecessary leading newline (whitespace) + for _, next := range numbers { + +roman_numerals.go:106: unnecessary trailing newline (whitespace) + + } else { +roman_numerals.go:80: unnecessary leading newline (whitespace) + if remainder >= next-subNum { + +roman_numerals.go:102: unnecessary trailing newline (whitespace) + + } +roman_numerals.go:107: unnecessary leading newline (whitespace) + } else { + +roman_numerals.go:60:2: declarations should never be cuddled (wsl) + var output string + ^ +roman_numerals.go:61:2: declarations should never be cuddled (wsl) + var register int + ^ +roman_numerals.go:103:4: block should not end with a whitespace (or comment) (wsl) + } + ^ +roman_numerals_test.go:18:2: block should not end with a whitespace (or comment) (wsl) + } + ^ +roman_numerals_test.go:41:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +roman_numerals.go:9:1: Duplicate words (and) found (dupword) +// ToRomanNumeral returns a roman numeral string and and error code. +^ +cases_test.go:12:5: validRomanNumeralTests is a global variable (gochecknoglobals) +var validRomanNumeralTests = []romanNumeralTest{ + ^ +roman_numerals.go:12:14: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"Roman numerals can't be less than or equal to 0\")" (goerr113) + return "", errors.New("Roman numerals can't be less than or equal to 0") + ^ +roman_numerals.go:17:14: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"Roman numerals were apparently rarely greater than 3k\")" (goerr113) + return "", errors.New("Roman numerals were apparently rarely greater than 3k") + ^ +roman_numerals.go:16:13: mnd: Magic number: 3_000, in detected (gomnd) + if input > 3_000 { + ^ +roman_numerals.go:45:10: mnd: Magic number: 10, in detected (gomnd) + 50: 10, + ^ +roman_numerals.go:46:10: mnd: Magic number: 10, in detected (gomnd) + 100: 10, + ^ +roman_numerals.go:47:10: mnd: Magic number: 100, in detected (gomnd) + 500: 100, + ^ +roman_numerals.go:48:10: mnd: Magic number: 100, in detected (gomnd) + 1_000: 100, + ^ +roman_numerals_test.go:5:1: Function TestRomanNumerals missing the call to method parallel (paralleltest) +func TestRomanNumerals(t *testing.T) { +^ +roman_numerals_test.go:6:2: Range statement for test TestRomanNumerals missing the call to method parallel in test Run (paralleltest) + for _, tc := range validRomanNumeralTests { + ^ +roman_numerals_test.go:21:1: Function TestRomanNumeralsInvalid missing the call to method parallel (paralleltest) +func TestRomanNumeralsInvalid(t *testing.T) { +^ +roman_numerals_test.go:27:2: Range statement for test TestRomanNumeralsInvalid missing the call to method parallel in test Run (paralleltest) + for _, tc := range invalidRomanNumeralTests { + ^ +cases_test.go:1:9: package should be `romannumerals_test` instead of `romannumerals` (testpackage) +package romannumerals + ^ +roman_numerals_examples_test.go:1:9: package should be `romannumerals_test` instead of `romannumerals` (testpackage) +package romannumerals + ^ +roman_numerals_test.go:1:9: package should be `romannumerals_test` instead of `romannumerals` (testpackage) +package romannumerals + ^ + +real 0m0.520s +user 0m0.771s +sys 0m0.510s + + + ============================================================================== + +Exit code: -1 + +real 0m0.552s +user 0m0.785s +sys 0m0.540s + +real 0m0.553s +user 0m0.787s +sys 0m0.541s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.021s +sys 0m0.028s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +roman_numerals.go + (33, 10) https://revive.run/r#var-declaration should omit type map[int]string from declaration of var d2r; it will be inferred from the right-hand side + (43, 16) https://revive.run/r#var-declaration should omit type map[int]int from declaration of var subLadder; it will be inferred from the right-hand side + (51, 16) https://revive.run/r#var-declaration should omit type map[int]string from declaration of var outLadder; it will be inferred from the right-hand side + (59, 16) https://revive.run/r#var-declaration should omit type int from declaration of var remainder; it will be inferred from the right-hand side + (63, 14) https://revive.run/r#var-declaration should omit type []int from declaration of var numbers; it will be inferred from the right-hand side + + + ✖ 5 problems (0 errors) (5 warnings) + +real 0m0.071s +user 0m0.036s +sys 0m0.056s + + + ============================================================================== + +Exit code: 0 + +real 0m0.116s +user 0m0.061s +sys 0m0.097s + +real 0m0.118s +user 0m0.061s +sys 0m0.099s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.000s +user 0m0.000s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.018s +sys 0m0.023s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "errors" without types was imported from "romannumerals" + +real 0m0.090s +user 0m0.112s +sys 0m0.129s + + + ============================================================================== + +Exit code: -1 + +real 0m0.132s +user 0m0.138s +sys 0m0.165s + +real 0m0.134s +user 0m0.138s +sys 0m0.168s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.016s +sys 0m0.019s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +roman_numerals.go:12:14: error strings should not be capitalized (ST1005) +roman_numerals.go:17:14: error strings should not be capitalized (ST1005) +roman_numerals.go:33:10: should omit type map[int]string from declaration; it will be inferred from the right-hand side (ST1023) +roman_numerals.go:43:16: should omit type map[int]int from declaration; it will be inferred from the right-hand side (ST1023) +roman_numerals.go:51:16: should omit type map[int]string from declaration; it will be inferred from the right-hand side (ST1023) +roman_numerals.go:59:16: should omit type int from declaration; it will be inferred from the right-hand side (ST1023) +roman_numerals.go:63:14: should omit type []int from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.173s +user 0m0.229s +sys 0m0.107s + + + ============================================================================== + +Exit code: -1 + +real 0m0.210s +user 0m0.249s +sys 0m0.142s + +real 0m0.212s +user 0m0.251s +sys 0m0.142s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.011s +sys 0m0.023s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.867s +user 0m2.084s +sys 0m0.371s + + + ============================================================================== + +Exit code: 0 + +real 0m0.902s +user 0m2.103s +sys 0m0.402s + +real 0m0.904s +user 0m2.103s +sys 0m0.404s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.019s +sys 0m0.023s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.099s +user 0m0.155s +sys 0m0.099s + + + ============================================================================== + +Exit code: 0 + +real 0m0.141s +user 0m0.178s +sys 0m0.133s + +real 0m0.143s +user 0m0.180s +sys 0m0.133s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.014s +sys 0m0.026s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.021s +user 0m0.009s +sys 0m0.019s + + + ============================================================================== + +Exit code: 0 + +real 0m0.062s +user 0m0.033s +sys 0m0.058s + +real 0m0.065s +user 0m0.034s +sys 0m0.060s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out romannumerals +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.023s +sys 0m0.022s + + + ============================================================================== + +Running: errcheck ./... + +roman_numerals_test.go:43:18: ToRomanNumeral(tc.input) + +real 0m0.473s +user 0m1.305s +sys 0m0.282s + + + ============================================================================== + +Exit code: -1 + +real 0m0.516s +user 0m1.332s +sys 0m0.318s + +real 0m0.518s +user 0m1.333s +sys 0m0.319s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.014s +sys 0m0.016s + + + ============================================================================== + +Running: gocyclo . + +11 romannumerals ToRomanNumeral roman_numerals.go:10:1 +4 romannumerals BenchmarkRomanNumerals roman_numerals_test.go:37:1 +4 romannumerals TestRomanNumerals roman_numerals_test.go:5:1 +3 romannumerals TestRomanNumeralsInvalid roman_numerals_test.go:21:1 +2 romannumerals ExampleToRomanNumeral roman_numerals_examples_test.go:5:1 + +real 0m0.003s +user 0m0.001s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.034s +user 0m0.023s +sys 0m0.023s + +real 0m0.035s +user 0m0.024s +sys 0m0.024s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + +roman_numerals.go:25:37: "substract" is a misspelling of "subtract" +coverage.html:105:44: "substract" is a misspelling of "subtract" +run-tests-go.txt:48:26: "substract" is a misspelling of "subtract" +run-tests-go.txt:49:37: "substract" is a misspelling of "subtract" + +real 0m0.026s +user 0m0.034s +sys 0m0.008s + + + ============================================================================== + +Exit code: 0 + +real 0m0.036s +user 0m0.035s +sys 0m0.021s + +real 0m0.038s +user 0m0.035s +sys 0m0.023s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.016s +sys 0m0.025s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:30:05 Including rules: default +[gosec] 2023/09/07 00:30:05 Excluding rules: default +[gosec] 2023/09/07 00:30:05 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/roman-numerals +[gosec] 2023/09/07 00:30:05 Checking package: romannumerals +[gosec] 2023/09/07 00:30:05 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/roman-numerals/roman_numerals.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 127 + Nosec : 0 + Issues : 0 + + +real 0m0.123s +user 0m0.121s +sys 0m0.105s + + + ============================================================================== + +Exit code: 0 + +real 0m0.161s +user 0m0.142s +sys 0m0.141s + +real 0m0.163s +user 0m0.142s +sys 0m0.143s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.019s +sys 0m0.024s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestRomanNumerals +=== RUN TestRomanNumerals/1_is_I +=== RUN TestRomanNumerals/2_is_II +=== RUN TestRomanNumerals/3_is_III +=== RUN TestRomanNumerals/4_is_IV +=== RUN TestRomanNumerals/5_is_V +=== RUN TestRomanNumerals/6_is_VI +=== RUN TestRomanNumerals/9_is_IX +=== RUN TestRomanNumerals/27_is_XXVII +=== RUN TestRomanNumerals/48_is_XLVIII +=== RUN TestRomanNumerals/49_is_XLIX +=== RUN TestRomanNumerals/59_is_LIX +=== RUN TestRomanNumerals/93_is_XCIII +=== RUN TestRomanNumerals/141_is_CXLI +=== RUN TestRomanNumerals/163_is_CLXIII +=== RUN TestRomanNumerals/402_is_CDII +=== RUN TestRomanNumerals/575_is_DLXXV +=== RUN TestRomanNumerals/911_is_CMXI +=== RUN TestRomanNumerals/1024_is_MXXIV +=== RUN TestRomanNumerals/3000_is_MMM +=== RUN TestRomanNumerals/16_is_XVI +=== RUN TestRomanNumerals/66_is_LXVI +=== RUN TestRomanNumerals/166_is_CLXVI +=== RUN TestRomanNumerals/666_is_DCLXVI +=== RUN TestRomanNumerals/1666_is_MDCLXVI --- PASS: TestRomanNumerals (0.00s) + --- PASS: TestRomanNumerals/1_is_I (0.00s) + --- PASS: TestRomanNumerals/2_is_II (0.00s) + --- PASS: TestRomanNumerals/3_is_III (0.00s) + --- PASS: TestRomanNumerals/4_is_IV (0.00s) + --- PASS: TestRomanNumerals/5_is_V (0.00s) + --- PASS: TestRomanNumerals/6_is_VI (0.00s) + --- PASS: TestRomanNumerals/9_is_IX (0.00s) + --- PASS: TestRomanNumerals/27_is_XXVII (0.00s) + --- PASS: TestRomanNumerals/48_is_XLVIII (0.00s) + --- PASS: TestRomanNumerals/49_is_XLIX (0.00s) + --- PASS: TestRomanNumerals/59_is_LIX (0.00s) + --- PASS: TestRomanNumerals/93_is_XCIII (0.00s) + --- PASS: TestRomanNumerals/141_is_CXLI (0.00s) + --- PASS: TestRomanNumerals/163_is_CLXIII (0.00s) + --- PASS: TestRomanNumerals/402_is_CDII (0.00s) + --- PASS: TestRomanNumerals/575_is_DLXXV (0.00s) + --- PASS: TestRomanNumerals/911_is_CMXI (0.00s) + --- PASS: TestRomanNumerals/1024_is_MXXIV (0.00s) + --- PASS: TestRomanNumerals/3000_is_MMM (0.00s) + --- PASS: TestRomanNumerals/16_is_XVI (0.00s) + --- PASS: TestRomanNumerals/66_is_LXVI (0.00s) + --- PASS: TestRomanNumerals/166_is_CLXVI (0.00s) + --- PASS: TestRomanNumerals/666_is_DCLXVI (0.00s) + --- PASS: TestRomanNumerals/1666_is_MDCLXVI (0.00s) +=== RUN TestRomanNumeralsInvalid +=== RUN TestRomanNumeralsInvalid/0_is_out_of_range +=== RUN TestRomanNumeralsInvalid/-1_is_out_of_range +=== RUN TestRomanNumeralsInvalid/3001_is_out_of_range +--- PASS: TestRomanNumeralsInvalid (0.00s) + --- PASS: TestRomanNumeralsInvalid/0_is_out_of_range (0.00s) + --- PASS: TestRomanNumeralsInvalid/-1_is_out_of_range (0.00s) + --- PASS: TestRomanNumeralsInvalid/3001_is_out_of_range (0.00s) === RUN ExampleToRomanNumeral --- PASS: ExampleToRomanNumeral (0.00s) PASS coverage: 94.9% of statements -ok romannumerals 0.010s coverage: 94.9% of statements +ok romannumerals 0.004s coverage: 94.9% of statements -real 0m0.617s -user 0m0.724s -sys 0m0.510s +real 0m0.190s +user 0m0.244s +sys 0m0.186s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + romannumerals/roman_numerals.go:10: ToRomanNumeral 94.9% total: (statements) 94.9% -real 0m0.224s -user 0m0.166s -sys 0m0.183s +real 0m0.046s +user 0m0.059s +sys 0m0.066s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.161s -user 0m0.109s -sys 0m0.187s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic romannumerals +real 0m0.043s +user 0m0.046s +sys 0m0.057s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + + 10 func ToRomanNumeral(input int) (string, error) { + 11 if input <= 0 { + 12 return "", errors.New("Roman numerals can't be less than or equal to 0") + 13 } + 14 + 15 // Only process numbers <=3k. + 16 if input > 3_000 { + 17 return "", errors.New("Roman numerals were apparently rarely greater than 3k") + 18 } + 19 + 20 /* + 21 Steps + 22 1. set remainder to number + 23 2. divide remainder by 1000 + 24 3. if == 0 then look for special case for IV, IX, XL, XC, CD, CM + 25 a. if true then record it and substract it from the remainder + 26 b. if false continue with the next number + 27 4. if != 0 then + 28 a. output n, nn, nnn case + 29 b. update the remainder + 30 c. continue with the next number + 31 */ + 32 + 33 var d2r map[int]string = map[int]string{ + 34 1: "I", + 35 5: "V", + 36 10: "X", + 37 50: "L", + 38 100: "C", + 39 500: "D", + 40 1_000: "M", + 41 } + 42 + 43 var subLadder map[int]int = map[int]int{ + 44 10: 1, + 45 50: 10, + 46 100: 10, + 47 500: 100, + 48 1_000: 100, + 49 } + 50 + 51 var outLadder map[int]string = map[int]string{ + 52 10: "I", + 53 50: "X", + 54 100: "X", + 55 500: "C", + 56 1_000: "C", + 57 } + 58 + 59 var remainder int = input + 60 var output string + 61 var register int + 62 + 63 var numbers []int = []int{1_000, 500, 100, 50, 10, 5, 1} + 64 + 65 for _, next := range numbers { + 66 + 67 if remainder <= 0 { + 68 break + 69 } + 70 + 71 register = remainder / next + 72 + 73 if register == 0 { + 74 subNum, found := subLadder[next] + 75 + 76 if !found { + 77 subNum = 1 + 78 } + 79 + 80 if remainder >= next-subNum { + 81 + 82 // IV IX XL XC CD CM + 83 value, found := outLadder[next] + 84 + 85 if !found { + 86 value = "I" + 87 } + 88 + 89 output += value + 90 + 91 value, found = d2r[next] + 92 + 93 if !found { + 94 MISS value = "" + 95 } + 96 + 97 output += value + 98 + 99 register = remainder - (next - subNum) +100 +101 remainder = register +102 +103 } +104 +105 continue +106 +107 } else { +108 +109 value, found := d2r[next] +110 +111 if !found { +112 MISS value = "" +113 } +114 +115 // III xxx CCC +116 output += strings.Repeat(value, register) +117 +118 register = remainder % next +119 +120 remainder = register +121 +122 continue +123 } +124 } +125 +126 return output, nil +127 } + + +real 0m0.018s +user 0m0.012s +sys 0m0.017s + +real 0m0.018s +user 0m0.012s +sys 0m0.017s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestRomanNumerals +=== RUN TestRomanNumerals/1_is_I +=== RUN TestRomanNumerals/2_is_II +=== RUN TestRomanNumerals/3_is_III +=== RUN TestRomanNumerals/4_is_IV +=== RUN TestRomanNumerals/5_is_V +=== RUN TestRomanNumerals/6_is_VI +=== RUN TestRomanNumerals/9_is_IX +=== RUN TestRomanNumerals/27_is_XXVII +=== RUN TestRomanNumerals/48_is_XLVIII +=== RUN TestRomanNumerals/49_is_XLIX +=== RUN TestRomanNumerals/59_is_LIX +=== RUN TestRomanNumerals/93_is_XCIII +=== RUN TestRomanNumerals/141_is_CXLI +=== RUN TestRomanNumerals/163_is_CLXIII +=== RUN TestRomanNumerals/402_is_CDII +=== RUN TestRomanNumerals/575_is_DLXXV +=== RUN TestRomanNumerals/911_is_CMXI +=== RUN TestRomanNumerals/1024_is_MXXIV +=== RUN TestRomanNumerals/3000_is_MMM +=== RUN TestRomanNumerals/16_is_XVI +=== RUN TestRomanNumerals/66_is_LXVI +=== RUN TestRomanNumerals/166_is_CLXVI +=== RUN TestRomanNumerals/666_is_DCLXVI +=== RUN TestRomanNumerals/1666_is_MDCLXVI --- PASS: TestRomanNumerals (0.00s) + --- PASS: TestRomanNumerals/1_is_I (0.00s) + --- PASS: TestRomanNumerals/2_is_II (0.00s) + --- PASS: TestRomanNumerals/3_is_III (0.00s) + --- PASS: TestRomanNumerals/4_is_IV (0.00s) + --- PASS: TestRomanNumerals/5_is_V (0.00s) + --- PASS: TestRomanNumerals/6_is_VI (0.00s) + --- PASS: TestRomanNumerals/9_is_IX (0.00s) + --- PASS: TestRomanNumerals/27_is_XXVII (0.00s) + --- PASS: TestRomanNumerals/48_is_XLVIII (0.00s) + --- PASS: TestRomanNumerals/49_is_XLIX (0.00s) + --- PASS: TestRomanNumerals/59_is_LIX (0.00s) + --- PASS: TestRomanNumerals/93_is_XCIII (0.00s) + --- PASS: TestRomanNumerals/141_is_CXLI (0.00s) + --- PASS: TestRomanNumerals/163_is_CLXIII (0.00s) + --- PASS: TestRomanNumerals/402_is_CDII (0.00s) + --- PASS: TestRomanNumerals/575_is_DLXXV (0.00s) + --- PASS: TestRomanNumerals/911_is_CMXI (0.00s) + --- PASS: TestRomanNumerals/1024_is_MXXIV (0.00s) + --- PASS: TestRomanNumerals/3000_is_MMM (0.00s) + --- PASS: TestRomanNumerals/16_is_XVI (0.00s) + --- PASS: TestRomanNumerals/66_is_LXVI (0.00s) + --- PASS: TestRomanNumerals/166_is_CLXVI (0.00s) + --- PASS: TestRomanNumerals/666_is_DCLXVI (0.00s) + --- PASS: TestRomanNumerals/1666_is_MDCLXVI (0.00s) +=== RUN TestRomanNumeralsInvalid +=== RUN TestRomanNumeralsInvalid/0_is_out_of_range +=== RUN TestRomanNumeralsInvalid/-1_is_out_of_range +=== RUN TestRomanNumeralsInvalid/3001_is_out_of_range +--- PASS: TestRomanNumeralsInvalid (0.00s) + --- PASS: TestRomanNumeralsInvalid/0_is_out_of_range (0.00s) + --- PASS: TestRomanNumeralsInvalid/-1_is_out_of_range (0.00s) + --- PASS: TestRomanNumeralsInvalid/3001_is_out_of_range (0.00s) === RUN ExampleToRomanNumeral --- PASS: ExampleToRomanNumeral (0.00s) PASS coverage: 94.9% of statements -ok romannumerals 0.041s coverage: 94.9% of statements +ok romannumerals 1.013s coverage: 94.9% of statements + +real 0m1.230s +user 0m0.272s +sys 0m0.154s + + + ============================================================================== -real 0m0.781s -user 0m0.831s -sys 0m0.522s +Exit code: 0 + +real 0m1.571s +user 0m0.662s +sys 0m0.518s + +real 0m1.573s +user 0m0.663s +sys 0m0.520s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: romannumerals -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkRomanNumerals-4 63630 19132 ns/op 176 B/op 61 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkRomanNumerals +BenchmarkRomanNumerals-8 163629 7754 ns/op 256 B/op 63 allocs/op PASS -ok romannumerals 1.473s +ok romannumerals 1.349s -real 0m1.982s -user 0m2.111s -sys 0m0.469s +real 0m1.494s +user 0m1.550s +sys 0m0.134s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestRomanNumerals +=== RUN TestRomanNumerals/1_is_I +=== RUN TestRomanNumerals/2_is_II +=== RUN TestRomanNumerals/3_is_III +=== RUN TestRomanNumerals/4_is_IV +=== RUN TestRomanNumerals/5_is_V +=== RUN TestRomanNumerals/6_is_VI +=== RUN TestRomanNumerals/9_is_IX +=== RUN TestRomanNumerals/27_is_XXVII +=== RUN TestRomanNumerals/48_is_XLVIII +=== RUN TestRomanNumerals/49_is_XLIX +=== RUN TestRomanNumerals/59_is_LIX +=== RUN TestRomanNumerals/93_is_XCIII +=== RUN TestRomanNumerals/141_is_CXLI +=== RUN TestRomanNumerals/163_is_CLXIII +=== RUN TestRomanNumerals/402_is_CDII +=== RUN TestRomanNumerals/575_is_DLXXV +=== RUN TestRomanNumerals/911_is_CMXI +=== RUN TestRomanNumerals/1024_is_MXXIV +=== RUN TestRomanNumerals/3000_is_MMM +=== RUN TestRomanNumerals/16_is_XVI +=== RUN TestRomanNumerals/66_is_LXVI +=== RUN TestRomanNumerals/166_is_CLXVI +=== RUN TestRomanNumerals/666_is_DCLXVI +=== RUN TestRomanNumerals/1666_is_MDCLXVI +--- PASS: TestRomanNumerals (0.00s) + --- PASS: TestRomanNumerals/1_is_I (0.00s) + --- PASS: TestRomanNumerals/2_is_II (0.00s) + --- PASS: TestRomanNumerals/3_is_III (0.00s) + --- PASS: TestRomanNumerals/4_is_IV (0.00s) + --- PASS: TestRomanNumerals/5_is_V (0.00s) + --- PASS: TestRomanNumerals/6_is_VI (0.00s) + --- PASS: TestRomanNumerals/9_is_IX (0.00s) + --- PASS: TestRomanNumerals/27_is_XXVII (0.00s) + --- PASS: TestRomanNumerals/48_is_XLVIII (0.00s) + --- PASS: TestRomanNumerals/49_is_XLIX (0.00s) + --- PASS: TestRomanNumerals/59_is_LIX (0.00s) + --- PASS: TestRomanNumerals/93_is_XCIII (0.00s) + --- PASS: TestRomanNumerals/141_is_CXLI (0.00s) + --- PASS: TestRomanNumerals/163_is_CLXIII (0.00s) + --- PASS: TestRomanNumerals/402_is_CDII (0.00s) + --- PASS: TestRomanNumerals/575_is_DLXXV (0.00s) + --- PASS: TestRomanNumerals/911_is_CMXI (0.00s) + --- PASS: TestRomanNumerals/1024_is_MXXIV (0.00s) + --- PASS: TestRomanNumerals/3000_is_MMM (0.00s) + --- PASS: TestRomanNumerals/16_is_XVI (0.00s) + --- PASS: TestRomanNumerals/66_is_LXVI (0.00s) + --- PASS: TestRomanNumerals/166_is_CLXVI (0.00s) + --- PASS: TestRomanNumerals/666_is_DCLXVI (0.00s) + --- PASS: TestRomanNumerals/1666_is_MDCLXVI (0.00s) +=== RUN TestRomanNumeralsInvalid +=== RUN TestRomanNumeralsInvalid/0_is_out_of_range +=== RUN TestRomanNumeralsInvalid/-1_is_out_of_range +=== RUN TestRomanNumeralsInvalid/3001_is_out_of_range +--- PASS: TestRomanNumeralsInvalid (0.00s) + --- PASS: TestRomanNumeralsInvalid/0_is_out_of_range (0.00s) + --- PASS: TestRomanNumeralsInvalid/-1_is_out_of_range (0.00s) + --- PASS: TestRomanNumeralsInvalid/3001_is_out_of_range (0.00s) +=== RUN ExampleToRomanNumeral +--- PASS: ExampleToRomanNumeral (0.00s) PASS -ok romannumerals 0.010s +ok romannumerals 0.002s -real 0m0.936s -user 0m1.086s -sys 0m0.753s +real 0m0.130s +user 0m0.166s +sys 0m0.130s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m5.535s -user 0m0.757s -sys 0m0.383s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -RomanNumerals-4 13.8µs ± 0% 19.1µs ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -RomanNumerals-4 176B ± 0% 176B ± 0% ~ (all equal) - -name old allocs/op new allocs/op delta -RomanNumerals-4 61.0 ± 0% 61.0 ± 0% ~ (all equal) - -real 0m0.038s -user 0m0.024s -sys 0m0.028s - -=============================================================================== - -go vet romannumerals - -real 0m0.321s -user 0m0.358s -sys 0m0.324s +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: romannumerals +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +RomanNumerals-8 7.754µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-new.txt │ + │ B/op │ +RomanNumerals-8 256.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -go fix romannumerals + │ benchstat-new.txt │ + │ allocs/op │ +RomanNumerals-8 63.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.127s -user 0m0.086s -sys 0m0.104s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +RomanNumerals-4 19.13µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +RomanNumerals-4 176.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./roman-numerals -[gosec] 2022/06/28 21:59:39 Including rules: default -[gosec] 2022/06/28 21:59:39 Excluding rules: default -[gosec] 2022/06/28 21:59:39 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/roman-numerals -2022/06/28 21:59:40 internal error: package "errors" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +RomanNumerals-4 61.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.347s -user 0m0.343s -sys 0m0.273s +real 0m0.002s +user 0m0.000s +sys 0m0.003s =============================================================================== gomarkdoc --output romannumerals-doc.md -real 0m0.034s -user 0m0.029s -sys 0m0.014s +real 0m0.013s +user 0m0.011s +sys 0m0.003s =============================================================================== @@ -159,9 +1133,9 @@ func ToRomanNumeral(input int) (string, error) ToRomanNumeral returns a roman numeral string and and error code. -real 0m0.180s -user 0m0.088s -sys 0m0.174s +real 0m0.038s +user 0m0.022s +sys 0m0.029s =============================================================================== diff --git a/go/rotational-cipher/benchstat-new.txt b/go/rotational-cipher/benchstat-new.txt index 35948088..2d46b816 100644 --- a/go/rotational-cipher/benchstat-new.txt +++ b/go/rotational-cipher/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: rotationalcipher -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkRotationalCipher-4 454730 3611 ns/op 280 B/op 16 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkRotationalCipher +BenchmarkRotationalCipher-8 1147933 1004 ns/op 280 B/op 16 allocs/op PASS -ok rotationalcipher 1.722s +ok rotationalcipher 1.996s diff --git a/go/rotational-cipher/benchstat-old.txt b/go/rotational-cipher/benchstat-old.txt index 323c032c..35948088 100644 --- a/go/rotational-cipher/benchstat-old.txt +++ b/go/rotational-cipher/benchstat-old.txt @@ -2,6 +2,6 @@ goos: linux goarch: amd64 pkg: rotationalcipher cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkRotationalCipher-4 286296 4015 ns/op 680 B/op 14 allocs/op +BenchmarkRotationalCipher-4 454730 3611 ns/op 280 B/op 16 allocs/op PASS -ok rotationalcipher 1.231s +ok rotationalcipher 1.722s diff --git a/go/rotational-cipher/coverage-annotations.txt b/go/rotational-cipher/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/rotational-cipher/coverage.html b/go/rotational-cipher/coverage.html index ae29553c..c051afda 100644 --- a/go/rotational-cipher/coverage.html +++ b/go/rotational-cipher/coverage.html @@ -131,6 +131,18 @@ name old allocs/op new allocs/op delta RotationalCipher-4 14.0 ± 0% 14.0 ± 0% ~ (all equal) */ + +/* + === bytes.Buffer vs strings.Builder === + name old time/op new time/op delta + RotationalCipher-4 4.01µs ± 0% 3.61µs ± 0% ~ (p=1.000 n=1+1) + + name old alloc/op new alloc/op delta + RotationalCipher-4 680B ± 0% 280B ± 0% ~ (p=1.000 n=1+1) + + name old allocs/op new allocs/op delta + RotationalCipher-4 14.0 ± 0% 16.0 ± 0% ~ (p=1.000 n=1+1) +*/ diff --git a/go/rotational-cipher/coverage.out b/go/rotational-cipher/coverage.out index ed261df7..e6bb1354 100644 --- a/go/rotational-cipher/coverage.out +++ b/go/rotational-cipher/coverage.out @@ -1,13 +1,13 @@ mode: count rotationalcipher/rotational_cipher.go:10.58,11.21 1 12 -rotationalcipher/rotational_cipher.go:15.2,17.29 2 10 -rotationalcipher/rotational_cipher.go:25.2,25.24 1 10 rotationalcipher/rotational_cipher.go:11.21,13.3 1 2 +rotationalcipher/rotational_cipher.go:15.2,17.29 2 10 rotationalcipher/rotational_cipher.go:17.29,18.55 1 122 rotationalcipher/rotational_cipher.go:18.55,20.4 1 23 rotationalcipher/rotational_cipher.go:20.9,22.4 1 99 +rotationalcipher/rotational_cipher.go:25.2,25.24 1 10 rotationalcipher/rotational_cipher.go:28.43,31.27 2 99 -rotationalcipher/rotational_cipher.go:35.2,35.27 1 99 -rotationalcipher/rotational_cipher.go:39.2,39.59 1 99 rotationalcipher/rotational_cipher.go:31.27,33.3 1 63 +rotationalcipher/rotational_cipher.go:35.2,35.27 1 99 rotationalcipher/rotational_cipher.go:35.27,37.3 1 36 +rotationalcipher/rotational_cipher.go:39.2,39.59 1 99 diff --git a/go/rotational-cipher/rotationalcipher-doc.md b/go/rotational-cipher/rotationalcipher-doc.md index 39a1139a..2c07b61b 100755 --- a/go/rotational-cipher/rotationalcipher-doc.md +++ b/go/rotational-cipher/rotationalcipher-doc.md @@ -6,7 +6,7 @@ import "rotationalcipher" ``` -Package rotationalcipher is used to encrypt data\. +Package rotationalcipher is used to encrypt data. ## Index @@ -19,7 +19,7 @@ Package rotationalcipher is used to encrypt data\. func RotationalCipher(plain string, shiftKey int) string ``` -RotationalCipher returns a cipher text after applying a rotational cipher to a plain text input\. +RotationalCipher returns a cipher text after applying a rotational cipher to a plain text input.

Example

diff --git a/go/rotational-cipher/run-tests-go.txt b/go/rotational-cipher/run-tests-go.txt index 69aa7389..9c98acf2 100644 --- a/go/rotational-cipher/run-tests-go.txt +++ b/go/rotational-cipher/run-tests-go.txt @@ -5,15 +5,555 @@ Go packages: rotationalcipher =============================================================================== -golint rotationalcipher +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.019s +sys 0m0.020s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +rotational_cipher_test.go:88:3: expressions should not be cuddled with blocks (wsl) + t.Logf("PASS: %s", testCase.description) + ^ +rotational_cipher_test.go:96:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +rotational_cipher_test.go:7:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +rotational_cipher.go:39:46: mnd: Magic number: 26, in detected (gomnd) + return rune(((int(char) - offset + shift) % 26) + offset) + ^ +rotational_cipher_test.go:81:1: Function TestRotationalCipher missing the call to method parallel (paralleltest) +func TestRotationalCipher(t *testing.T) { +^ +rotational_cipher_examples_test.go:1:9: package should be `rotationalcipher_test` instead of `rotationalcipher` (testpackage) +package rotationalcipher + ^ +rotational_cipher_test.go:1:9: package should be `rotationalcipher_test` instead of `rotationalcipher` (testpackage) +package rotationalcipher + ^ + +real 0m0.513s +user 0m0.708s +sys 0m0.469s + + + ============================================================================== + +Exit code: -1 + +real 0m0.555s +user 0m0.736s +sys 0m0.502s + +real 0m0.558s +user 0m0.737s +sys 0m0.504s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.013s +sys 0m0.022s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.067s +user 0m0.039s +sys 0m0.051s + + + ============================================================================== + +Exit code: 0 + +real 0m0.106s +user 0m0.062s +sys 0m0.080s + +real 0m0.108s +user 0m0.062s +sys 0m0.082s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.017s +sys 0m0.021s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "strings" without types was imported from "rotationalcipher" + +real 0m0.091s +user 0m0.115s +sys 0m0.106s + + + ============================================================================== + +Exit code: -1 + +real 0m0.136s +user 0m0.141s +sys 0m0.143s real 0m0.139s -user 0m0.075s -sys 0m0.130s +user 0m0.142s +sys 0m0.145s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.017s +sys 0m0.015s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.178s +user 0m0.229s +sys 0m0.126s + + + ============================================================================== + +Exit code: 0 + +real 0m0.213s +user 0m0.254s +sys 0m0.151s + +real 0m0.215s +user 0m0.255s +sys 0m0.151s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.014s +sys 0m0.024s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./rotational_cipher.go:11:5: emptyStringTest: replace `len(plain) == 0` with `plain == ""` + +real 0m0.854s +user 0m2.021s +sys 0m0.298s + + + ============================================================================== + +Exit code: -1 + +real 0m0.894s +user 0m2.041s +sys 0m0.332s + +real 0m0.896s +user 0m2.042s +sys 0m0.333s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.012s +sys 0m0.019s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.072s +user 0m0.118s +sys 0m0.091s + + + ============================================================================== + +Exit code: 0 + +real 0m0.103s +user 0m0.136s +sys 0m0.118s + +real 0m0.105s +user 0m0.138s +sys 0m0.118s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.012s +sys 0m0.013s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.021s +user 0m0.009s +sys 0m0.022s + + + ============================================================================== + +Exit code: 0 + +real 0m0.048s +user 0m0.026s +sys 0m0.043s + +real 0m0.050s +user 0m0.027s +sys 0m0.045s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.013s +sys 0m0.017s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.482s +user 0m1.566s +sys 0m0.305s + + + ============================================================================== + +Exit code: 0 + +real 0m0.513s +user 0m1.582s +sys 0m0.334s + +real 0m0.516s +user 0m1.582s +sys 0m0.336s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.009s +sys 0m0.017s + + + ============================================================================== + +Running: gocyclo . + +5 rotationalcipher RotationalCipher rotational_cipher.go:10:1 +4 rotationalcipher BenchmarkRotationalCipher rotational_cipher_test.go:92:1 +3 rotationalcipher TestRotationalCipher rotational_cipher_test.go:81:1 +3 rotationalcipher shiftChar rotational_cipher.go:28:1 +1 rotationalcipher ExampleRotationalCipher rotational_cipher_examples_test.go:7:1 + +real 0m0.002s +user 0m0.000s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.033s +user 0m0.016s +sys 0m0.029s + +real 0m0.035s +user 0m0.017s +sys 0m0.030s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out rotationalcipher +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.041s +user 0m0.040s +sys 0m0.020s + + + ============================================================================== + +Exit code: 0 + +real 0m0.056s +user 0m0.050s +sys 0m0.029s + +real 0m0.059s +user 0m0.050s +sys 0m0.032s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.021s +sys 0m0.030s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:30:11 Including rules: default +[gosec] 2023/09/07 00:30:11 Excluding rules: default +[gosec] 2023/09/07 00:30:11 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/rotational-cipher +[gosec] 2023/09/07 00:30:11 Checking package: rotationalcipher +[gosec] 2023/09/07 00:30:11 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/rotational-cipher/rotational_cipher.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 65 + Nosec : 0 + Issues : 0 + + +real 0m0.120s +user 0m0.115s +sys 0m0.085s + + + ============================================================================== + +Exit code: 0 + +real 0m0.168s +user 0m0.141s +sys 0m0.132s + +real 0m0.172s +user 0m0.143s +sys 0m0.134s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.011s +sys 0m0.020s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestRotationalCipher rotational_cipher_test.go:88: PASS: zero len input, rotate by 0 rotational_cipher_test.go:88: PASS: zero len input, rotate by 3 @@ -31,34 +571,55 @@ go test -v -covermode=count -coverprofile coverage.out rotationalcipher --- PASS: ExampleRotationalCipher (0.00s) PASS coverage: 100.0% of statements -ok rotationalcipher 0.007s coverage: 100.0% of statements +ok rotationalcipher 0.002s coverage: 100.0% of statements -real 0m0.646s -user 0m0.662s -sys 0m0.536s +real 0m0.192s +user 0m0.298s +sys 0m0.157s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + rotationalcipher/rotational_cipher.go:10: RotationalCipher 100.0% rotationalcipher/rotational_cipher.go:28: shiftChar 100.0% total: (statements) 100.0% -real 0m0.153s -user 0m0.098s -sys 0m0.152s +real 0m0.045s +user 0m0.054s +sys 0m0.064s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.203s -user 0m0.163s -sys 0m0.206s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic rotationalcipher +real 0m0.041s +user 0m0.046s +sys 0m0.061s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.016s +user 0m0.012s +sys 0m0.015s + +real 0m0.016s +user 0m0.012s +sys 0m0.015s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestRotationalCipher rotational_cipher_test.go:88: PASS: zero len input, rotate by 0 rotational_cipher_test.go:88: PASS: zero len input, rotate by 3 @@ -76,126 +637,119 @@ go test -v -race -covermode=atomic rotationalcipher --- PASS: ExampleRotationalCipher (0.00s) PASS coverage: 100.0% of statements -ok rotationalcipher 0.058s coverage: 100.0% of statements +ok rotationalcipher 1.012s coverage: 100.0% of statements + +real 0m1.260s +user 0m0.306s +sys 0m0.169s + + + ============================================================================== + +Exit code: 0 -real 0m0.665s -user 0m0.608s -sys 0m0.478s +real 0m1.587s +user 0m0.735s +sys 0m0.494s + +real 0m1.590s +user 0m0.738s +sys 0m0.494s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: rotationalcipher -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkRotationalCipher-4 454730 3611 ns/op 280 B/op 16 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkRotationalCipher +BenchmarkRotationalCipher-8 1147933 1004 ns/op 280 B/op 16 allocs/op PASS -ok rotationalcipher 1.722s +ok rotationalcipher 1.996s -real 0m2.137s -user 0m2.772s -sys 0m0.440s +real 0m2.159s +user 0m2.262s +sys 0m0.184s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestRotationalCipher + rotational_cipher_test.go:88: PASS: zero len input, rotate by 0 + rotational_cipher_test.go:88: PASS: zero len input, rotate by 3 + rotational_cipher_test.go:88: PASS: rotate a by 0, same output as input + rotational_cipher_test.go:88: PASS: rotate a by 1 + rotational_cipher_test.go:88: PASS: rotate a by 26, same output as input + rotational_cipher_test.go:88: PASS: rotate n by 13 with wrap around alphabet + rotational_cipher_test.go:88: PASS: rotate capital letters + rotational_cipher_test.go:88: PASS: rotate spaces + rotational_cipher_test.go:88: PASS: rotate numbers + rotational_cipher_test.go:88: PASS: rotate punctuation + rotational_cipher_test.go:88: PASS: rotate all letters +--- PASS: TestRotationalCipher (0.00s) +=== RUN ExampleRotationalCipher +--- PASS: ExampleRotationalCipher (0.00s) PASS -ok rotationalcipher 0.008s +ok rotationalcipher 0.002s -real 0m0.510s -user 0m0.552s -sys 0m0.413s +real 0m0.125s +user 0m0.154s +sys 0m0.114s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m0.716s -user 0m0.651s -sys 0m0.328s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -RotationalCipher-4 4.01µs ± 0% 3.61µs ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -RotationalCipher-4 680B ± 0% 280B ± 0% ~ (p=1.000 n=1+1) - -name old allocs/op new allocs/op delta -RotationalCipher-4 14.0 ± 0% 16.0 ± 0% ~ (p=1.000 n=1+1) - -real 0m0.020s -user 0m0.002s -sys 0m0.015s - -=============================================================================== - -go vet rotationalcipher - -real 0m0.343s -user 0m0.415s -sys 0m0.323s - -=============================================================================== - -go fix rotationalcipher - -real 0m0.080s -user 0m0.034s -sys 0m0.074s - -=============================================================================== - -ineffassign ./... - -real 0m0.343s -user 0m0.337s -sys 0m0.305s - -=============================================================================== - -gocyclo . -5 rotationalcipher RotationalCipher rotational_cipher.go:10:1 -4 rotationalcipher BenchmarkRotationalCipher rotational_cipher_test.go:92:1 -3 rotationalcipher TestRotationalCipher rotational_cipher_test.go:81:1 -3 rotationalcipher shiftChar rotational_cipher.go:28:1 -1 rotationalcipher ExampleRotationalCipher rotational_cipher_examples_test.go:7:1 - -real 0m0.021s -user 0m0.002s -sys 0m0.006s - -=============================================================================== - -misspell . +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: rotationalcipher +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +RotationalCipher-8 1.004µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +RotationalCipher-8 280.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +RotationalCipher-8 16.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.117s -user 0m0.194s -sys 0m0.068s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +RotationalCipher-4 3.611µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +RotationalCipher-4 280.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./rotational-cipher -[gosec] 2022/08/17 21:04:16 Including rules: default -[gosec] 2022/08/17 21:04:16 Excluding rules: default -[gosec] 2022/08/17 21:04:16 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/rotational-cipher -2022/08/17 21:04:17 internal error: package "strings" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +RotationalCipher-4 16.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.456s -user 0m0.447s -sys 0m0.373s +real 0m0.006s +user 0m0.001s +sys 0m0.002s =============================================================================== gomarkdoc --output rotationalcipher-doc.md -real 0m0.032s -user 0m0.014s -sys 0m0.024s +real 0m0.010s +user 0m0.006s +sys 0m0.003s =============================================================================== @@ -211,9 +765,9 @@ func RotationalCipher(plain string, shiftKey int) string a plain text input. -real 0m0.204s -user 0m0.081s -sys 0m0.174s +real 0m0.046s +user 0m0.030s +sys 0m0.033s =============================================================================== diff --git a/go/scrabble-score/benchstat-new.txt b/go/scrabble-score/benchstat-new.txt index 0356dc1c..14efd2f0 100644 --- a/go/scrabble-score/benchstat-new.txt +++ b/go/scrabble-score/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: scrabble -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkScore-4 10000 133667 ns/op 26492 B/op 385 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkScore +BenchmarkScore-8 47186 23521 ns/op 26671 B/op 385 allocs/op PASS -ok scrabble 1.409s +ok scrabble 1.371s diff --git a/go/scrabble-score/benchstat-old.txt b/go/scrabble-score/benchstat-old.txt new file mode 100644 index 00000000..0356dc1c --- /dev/null +++ b/go/scrabble-score/benchstat-old.txt @@ -0,0 +1,7 @@ +goos: linux +goarch: amd64 +pkg: scrabble +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkScore-4 10000 133667 ns/op 26492 B/op 385 allocs/op +PASS +ok scrabble 1.409s diff --git a/go/scrabble-score/coverage-annotations.txt b/go/scrabble-score/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/scrabble-score/coverage.out b/go/scrabble-score/coverage.out index 23eedb28..fa81031b 100644 --- a/go/scrabble-score/coverage.out +++ b/go/scrabble-score/coverage.out @@ -8,7 +8,7 @@ scrabble/scrabble_score.go:23.16,24.11 1 6 scrabble/scrabble_score.go:25.16,26.12 1 8 scrabble/scrabble_score.go:27.10,29.11 1 61 scrabble/scrabble_score.go:34.29,41.57 4 17 -scrabble/scrabble_score.go:45.2,45.33 1 13 -scrabble/scrabble_score.go:49.2,49.14 1 13 scrabble/scrabble_score.go:41.57,43.3 1 4 +scrabble/scrabble_score.go:45.2,45.33 1 13 scrabble/scrabble_score.go:45.33,47.3 1 115 +scrabble/scrabble_score.go:49.2,49.14 1 13 diff --git a/go/scrabble-score/run-tests-go.txt b/go/scrabble-score/run-tests-go.txt index 9291a4c3..013dba59 100644 --- a/go/scrabble-score/run-tests-go.txt +++ b/go/scrabble-score/run-tests-go.txt @@ -5,15 +5,582 @@ Go packages: scrabble =============================================================================== -golint scrabble +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.020s +sys 0m0.030s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +scrabble_score_test.go:8:23: Using the variable on range scope `tc` in function literal (scopelint) + if actual := Score(tc.input); actual != tc.expected { + ^ +scrabble_score_test.go:9:41: Using the variable on range scope `tc` in function literal (scopelint) + t.Errorf("Score(%q) = %d, want:%d", tc.input, actual, tc.expected) + ^ +scrabble_score.go:36:2: declarations should never be cuddled (wsl) + var letters string + ^ +scrabble_score_test.go:19:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:12:5: scrabbleScoreTests is a global variable (gochecknoglobals) +var scrabbleScoreTests = []scrabbleTest{ + ^ +scrabble_score.go:16:10: mnd: Magic number: 2, in detected (gomnd) + return 2 + ^ +scrabble_score.go:18:10: mnd: Magic number: 3, in detected (gomnd) + return 3 + ^ +scrabble_score.go:20:10: mnd: Magic number: 4, in detected (gomnd) + return 4 + ^ +scrabble_score.go:22:10: mnd: Magic number: 5, in detected (gomnd) + return 5 + ^ +scrabble_score.go:24:10: mnd: Magic number: 8, in detected (gomnd) + return 8 + ^ +scrabble_score.go:26:10: mnd: Magic number: 10, in detected (gomnd) + return 10 + ^ +scrabble_score_test.go:5:1: Function TestScore missing the call to method parallel (paralleltest) +func TestScore(t *testing.T) { +^ +scrabble_score_test.go:6:2: Range statement for test TestScore missing the call to method parallel in test Run (paralleltest) + for _, tc := range scrabbleScoreTests { + ^ +cases_test.go:1:9: package should be `scrabble_test` instead of `scrabble` (testpackage) +package scrabble + ^ +scrabble_score_examples_test.go:1:9: package should be `scrabble_test` instead of `scrabble` (testpackage) +package scrabble + ^ +scrabble_score_test.go:1:9: package should be `scrabble_test` instead of `scrabble` (testpackage) +package scrabble + ^ + +real 0m0.567s +user 0m0.825s +sys 0m0.558s + + + ============================================================================== + +Exit code: -1 + +real 0m0.615s +user 0m0.855s +sys 0m0.601s + +real 0m0.617s +user 0m0.856s +sys 0m0.602s -real 0m0.192s -user 0m0.159s -sys 0m0.157s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.013s +sys 0m0.015s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.070s +user 0m0.027s +sys 0m0.063s + + + ============================================================================== + +Exit code: 0 + +real 0m0.099s +user 0m0.047s +sys 0m0.085s + +real 0m0.102s +user 0m0.048s +sys 0m0.087s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.000s +user 0m0.000s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.010s +sys 0m0.026s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "regexp" without types was imported from "scrabble" + +real 0m0.094s +user 0m0.122s +sys 0m0.106s + + + ============================================================================== + +Exit code: -1 + +real 0m0.131s +user 0m0.142s +sys 0m0.141s + +real 0m0.133s +user 0m0.143s +sys 0m0.142s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.023s +sys 0m0.012s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +scrabble_score.go:36:2: should merge variable declaration with assignment on next line (S1021) + +real 0m0.172s +user 0m0.199s +sys 0m0.134s + + + ============================================================================== + +Exit code: -1 + +real 0m0.204s +user 0m0.228s +sys 0m0.156s + +real 0m0.206s +user 0m0.229s +sys 0m0.156s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.023s +sys 0m0.031s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.848s +user 0m2.027s +sys 0m0.313s + + + ============================================================================== + +Exit code: 0 + +real 0m0.898s +user 0m2.057s +sys 0m0.361s + +real 0m0.900s +user 0m2.059s +sys 0m0.362s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.020s +sys 0m0.021s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.103s +user 0m0.155s +sys 0m0.129s + + + ============================================================================== + +Exit code: 0 + +real 0m0.137s +user 0m0.179s +sys 0m0.161s + +real 0m0.139s +user 0m0.179s +sys 0m0.163s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.017s +sys 0m0.023s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.024s +user 0m0.020s +sys 0m0.017s + + + ============================================================================== + +Exit code: 0 + +real 0m0.066s +user 0m0.047s +sys 0m0.052s + +real 0m0.068s +user 0m0.049s +sys 0m0.053s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out scrabble +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.016s +sys 0m0.018s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.449s +user 0m1.375s +sys 0m0.273s + + + ============================================================================== + +Exit code: 0 + +real 0m0.481s +user 0m1.396s +sys 0m0.300s + +real 0m0.483s +user 0m1.398s +sys 0m0.300s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.013s +sys 0m0.018s + + + ============================================================================== + +Running: gocyclo . + +7 scrabble charScore scrabble_score.go:11:1 +4 scrabble BenchmarkScore scrabble_score_test.go:15:1 +3 scrabble TestScore scrabble_score_test.go:5:1 +3 scrabble Score scrabble_score.go:34:1 +2 scrabble ExampleScore scrabble_score_examples_test.go:7:1 + +real 0m0.002s +user 0m0.001s +sys 0m0.001s + + + ============================================================================== + +Exit code: 0 + +real 0m0.033s +user 0m0.023s +sys 0m0.025s + +real 0m0.035s +user 0m0.025s +sys 0m0.025s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.030s +user 0m0.035s +sys 0m0.016s + + + ============================================================================== + +Exit code: 0 + +real 0m0.047s +user 0m0.044s +sys 0m0.030s + +real 0m0.049s +user 0m0.045s +sys 0m0.031s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.014s +sys 0m0.027s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:30:18 Including rules: default +[gosec] 2023/09/07 00:30:18 Excluding rules: default +[gosec] 2023/09/07 00:30:18 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/scrabble-score +[gosec] 2023/09/07 00:30:18 Checking package: scrabble +[gosec] 2023/09/07 00:30:18 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/scrabble-score/scrabble_score.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 50 + Nosec : 0 + Issues : 0 + + +real 0m0.106s +user 0m0.119s +sys 0m0.090s + + + ============================================================================== + +Exit code: 0 + +real 0m0.149s +user 0m0.142s +sys 0m0.135s + +real 0m0.153s +user 0m0.143s +sys 0m0.137s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.017s +sys 0m0.016s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestScore === RUN TestScore/lowercase_letter === RUN TestScore/uppercase_letter @@ -42,34 +609,55 @@ go test -v -covermode=count -coverprofile coverage.out scrabble --- PASS: ExampleScore (0.00s) PASS coverage: 100.0% of statements -ok scrabble 0.019s coverage: 100.0% of statements +ok scrabble 0.003s coverage: 100.0% of statements -real 0m0.837s -user 0m0.914s -sys 0m0.639s +real 0m0.177s +user 0m0.225s +sys 0m0.161s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + scrabble/scrabble_score.go:11: charScore 100.0% scrabble/scrabble_score.go:34: Score 100.0% total: (statements) 100.0% -real 0m0.282s -user 0m0.253s -sys 0m0.311s +real 0m0.061s +user 0m0.073s +sys 0m0.089s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.274s -user 0m0.269s -sys 0m0.306s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic scrabble +real 0m0.047s +user 0m0.043s +sys 0m0.073s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.018s +user 0m0.016s +sys 0m0.020s + +real 0m0.018s +user 0m0.016s +sys 0m0.020s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestScore === RUN TestScore/lowercase_letter === RUN TestScore/uppercase_letter @@ -98,76 +686,130 @@ go test -v -race -covermode=atomic scrabble --- PASS: ExampleScore (0.00s) PASS coverage: 100.0% of statements -ok scrabble 0.038s coverage: 100.0% of statements +ok scrabble 1.017s coverage: 100.0% of statements + +real 0m1.233s +user 0m0.267s +sys 0m0.147s + + + ============================================================================== -real 0m0.948s -user 0m1.065s -sys 0m0.754s +Exit code: 0 + +real 0m1.570s +user 0m0.647s +sys 0m0.520s + +real 0m1.573s +user 0m0.648s +sys 0m0.522s =============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: scrabble -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkScore-4 10000 133667 ns/op 26492 B/op 385 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkScore +BenchmarkScore-8 47186 23521 ns/op 26671 B/op 385 allocs/op PASS -ok scrabble 1.409s +ok scrabble 1.371s -real 0m2.205s -user 0m3.526s -sys 0m0.894s +real 0m1.515s +user 0m1.606s +sys 0m0.197s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestScore +=== RUN TestScore/lowercase_letter +=== RUN TestScore/uppercase_letter +=== RUN TestScore/valuable_letter +=== RUN TestScore/short_word +=== RUN TestScore/short,_valuable_word +=== RUN TestScore/medium_word +=== RUN TestScore/medium,_valuable_word +=== RUN TestScore/long,_mixed-case_word +=== RUN TestScore/english-like_word +=== RUN TestScore/empty_input +=== RUN TestScore/entire_alphabet_available +--- PASS: TestScore (0.00s) + --- PASS: TestScore/lowercase_letter (0.00s) + --- PASS: TestScore/uppercase_letter (0.00s) + --- PASS: TestScore/valuable_letter (0.00s) + --- PASS: TestScore/short_word (0.00s) + --- PASS: TestScore/short,_valuable_word (0.00s) + --- PASS: TestScore/medium_word (0.00s) + --- PASS: TestScore/medium,_valuable_word (0.00s) + --- PASS: TestScore/long,_mixed-case_word (0.00s) + --- PASS: TestScore/english-like_word (0.00s) + --- PASS: TestScore/empty_input (0.00s) + --- PASS: TestScore/entire_alphabet_available (0.00s) +=== RUN ExampleScore +--- PASS: ExampleScore (0.00s) PASS -ok scrabble 0.017s +ok scrabble 0.002s -real 0m0.970s -user 0m1.250s -sys 0m0.676s +real 0m0.138s +user 0m0.192s +sys 0m0.116s =============================================================================== -No old benchmarks to run benchstat against. - -=============================================================================== - -go vet scrabble - -real 0m0.619s -user 0m0.804s -sys 0m0.443s - -=============================================================================== - -go fix scrabble +benchstat benchstat-old.txt benchstat-new.txt +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: scrabble +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Score-8 23.52µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Score-8 26.05Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Score-8 385.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.214s -user 0m0.282s -sys 0m0.192s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Score-4 133.7µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +Score-4 25.87Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./scrabble-score -[gosec] 2022/07/25 08:09:25 Including rules: default -[gosec] 2022/07/25 08:09:25 Excluding rules: default -[gosec] 2022/07/25 08:09:25 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/scrabble-score -2022/07/25 08:09:25 internal error: package "regexp" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +Score-4 385.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.740s -user 0m0.841s -sys 0m0.542s +real 0m0.002s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output scrabble-doc.md -real 0m0.030s -user 0m0.021s -sys 0m0.015s +real 0m0.015s +user 0m0.007s +sys 0m0.010s =============================================================================== @@ -182,9 +824,9 @@ func Score(word string) int Score returns an `int` scrablle score for a given word (`string`). -real 0m0.283s -user 0m0.226s -sys 0m0.191s +real 0m0.046s +user 0m0.027s +sys 0m0.037s =============================================================================== diff --git a/go/scrabble-score/scrabble-doc.md b/go/scrabble-score/scrabble-doc.md index dc089176..62739599 100755 --- a/go/scrabble-score/scrabble-doc.md +++ b/go/scrabble-score/scrabble-doc.md @@ -6,7 +6,7 @@ import "scrabble" ``` -Package scrabble Given a word\, compute the Scrabble score for that word\. +Package scrabble Given a word, compute the Scrabble score for that word. ## Index @@ -19,7 +19,7 @@ Package scrabble Given a word\, compute the Scrabble score for that word\. func Score(word string) int ``` -Score returns an \`int\` scrablle score for a given word \(\`string\`\)\. +Score returns an \`int\` scrablle score for a given word \(\`string\`\).

Example

diff --git a/go/series/benchstat-new.txt b/go/series/benchstat-new.txt index 3752148f..68e894b7 100644 --- a/go/series/benchstat-new.txt +++ b/go/series/benchstat-new.txt @@ -1,2 +1,2 @@ PASS -ok series 0.005s +ok series 0.002s diff --git a/go/series/benchstat-old.txt b/go/series/benchstat-old.txt new file mode 100644 index 00000000..3752148f --- /dev/null +++ b/go/series/benchstat-old.txt @@ -0,0 +1,2 @@ +PASS +ok series 0.005s diff --git a/go/series/coverage-annotations.txt b/go/series/coverage-annotations.txt new file mode 100644 index 00000000..32baadee --- /dev/null +++ b/go/series/coverage-annotations.txt @@ -0,0 +1,44 @@ + +10 func All(size int, input string) []string { +11 var offset int +12 segments := []string{} +13 +14 reStr := `[[:digit:]]{` + fmt.Sprint(size) + `}` +15 re, e := regexp.Compile(reStr) +16 if e != nil { +17 MISS panic(e) +18 } +19 +20 for { +21 // It was easier to not use FindAllString(). +22 segment := re.FindString(input[offset:]) +23 if segment == "" { +24 break +25 } +26 +27 segments = append(segments, segment) +28 +29 offset++ +30 if offset > len(input)-(size-1) { +31 MISS break +32 } +33 } +34 +35 return segments +36 } + + +39 func UnsafeFirst(size int, input string) string { +40 if size > len(input) { +41 MISS return "" +42 } +43 +44 segments := All(size, input) +45 +46 if len(segments) > 0 { +47 return segments[0] +48 } +49 +50 MISS return "" +51 } + diff --git a/go/series/coverage.out b/go/series/coverage.out index e938f20d..478e8597 100644 --- a/go/series/coverage.out +++ b/go/series/coverage.out @@ -1,14 +1,14 @@ mode: count series/series.go:10.43,16.14 5 28 -series/series.go:20.2,20.6 1 28 -series/series.go:35.2,35.17 1 28 series/series.go:16.14,17.11 1 0 +series/series.go:20.2,20.6 1 28 series/series.go:20.6,23.20 2 116 -series/series.go:27.3,30.35 3 88 series/series.go:23.20,24.9 1 28 +series/series.go:27.3,30.35 3 88 series/series.go:30.35,31.9 1 0 +series/series.go:35.2,35.17 1 28 series/series.go:39.49,40.23 1 13 -series/series.go:44.2,46.23 2 13 -series/series.go:50.2,50.11 1 0 series/series.go:40.23,42.3 1 0 +series/series.go:44.2,46.23 2 13 series/series.go:46.23,48.3 1 13 +series/series.go:50.2,50.11 1 0 diff --git a/go/series/run-tests-go.txt b/go/series/run-tests-go.txt index 465aa21a..a16dc264 100644 --- a/go/series/run-tests-go.txt +++ b/go/series/run-tests-go.txt @@ -5,15 +5,594 @@ Go packages: series =============================================================================== -golint series +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.019s +sys 0m0.022s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +series_test.go:13: File is not `gofumpt`-ed (gofumpt) + {1, "01234", + []string{"0", "1", "2", "3", "4"}}, + {1, "92834", + []string{"9", "2", "8", "3", "4"}}, + {2, "01234", + []string{"01", "12", "23", "34"}}, + {2, "98273463", + []string{"98", "82", "27", "73", "34", "46", "63"}}, + {2, "37103", + []string{"37", "71", "10", "03"}}, + {3, "01234", + []string{"012", "123", "234"}}, + {3, "31001", + []string{"310", "100", "001"}}, + {3, "982347", + []string{"982", "823", "234", "347"}}, + {4, "01234", + []string{"0123", "1234"}}, + {4, "91274", + []string{"9127", "1274"}}, + {5, "01234", + []string{"01234"}}, + {5, "81228", + []string{"81228"}}, +series.go:12:2: assignments should only be cuddled with other assignments (wsl) + segments := []string{} + ^ +series.go:16:2: only one cuddle assignment allowed before if statement (wsl) + if e != nil { + ^ +series_test.go:60:3: if statements should only be cuddled with assignments (wsl) + if res := UnsafeFirst(test.n, test.s); res != test.out[0] { + ^ +series_test.go:8:5: allTests is a global variable (gochecknoglobals) +var allTests = []struct { + ^ +series_test.go:41:5: cx is a global variable (gochecknoglobals) +var cx = "01032987583" + ^ +series.go:44:2: variable 'segments' is only used in the if-statement (series.go:46:2); consider using short syntax (ifshort) + segments := All(size, input) + ^ +series_test.go:43:1: Function TestAll missing the call to method parallel (paralleltest) +func TestAll(t *testing.T) { +^ +series_test.go:55:1: Function TestUnsafeFirst missing the call to method parallel (paralleltest) +func TestUnsafeFirst(t *testing.T) { +^ +series_examples_test.go:1:9: package should be `series_test` instead of `series` (testpackage) +package series + ^ +series_test.go:1:9: package should be `series_test` instead of `series` (testpackage) +package series + ^ +series.go:15:2: variable name 're' is too short for the scope of its usage (varnamelen) + re, e := regexp.Compile(reStr) + ^ + +real 0m0.542s +user 0m0.782s +sys 0m0.539s + + + ============================================================================== + +Exit code: -1 + +real 0m0.576s +user 0m0.809s +sys 0m0.568s + +real 0m0.579s +user 0m0.810s +sys 0m0.570s -real 0m0.241s -user 0m0.261s -sys 0m0.244s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.022s +sys 0m0.026s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.043s +user 0m0.023s +sys 0m0.033s + + + ============================================================================== + +Exit code: 0 + +real 0m0.078s +user 0m0.046s +sys 0m0.071s + +real 0m0.080s +user 0m0.046s +sys 0m0.073s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.022s +sys 0m0.024s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "series" + +real 0m0.086s +user 0m0.099s +sys 0m0.110s + + + ============================================================================== + +Exit code: -1 + +real 0m0.118s +user 0m0.127s +sys 0m0.140s + +real 0m0.120s +user 0m0.129s +sys 0m0.140s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.021s +sys 0m0.031s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.180s +user 0m0.223s +sys 0m0.127s + + + ============================================================================== + +Exit code: 0 + +real 0m0.217s +user 0m0.250s +sys 0m0.164s + +real 0m0.219s +user 0m0.250s +sys 0m0.165s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out series +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.018s +sys 0m0.026s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.841s +user 0m1.995s +sys 0m0.304s + + + ============================================================================== + +Exit code: 0 + +real 0m0.875s +user 0m2.019s +sys 0m0.339s + +real 0m0.877s +user 0m2.021s +sys 0m0.339s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.022s +sys 0m0.024s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.092s +user 0m0.148s +sys 0m0.113s + + + ============================================================================== + +Exit code: 0 + +real 0m0.127s +user 0m0.175s +sys 0m0.146s + +real 0m0.128s +user 0m0.176s +sys 0m0.146s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.022s +sys 0m0.031s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.022s +user 0m0.018s +sys 0m0.019s + + + ============================================================================== + +Exit code: 0 + +real 0m0.073s +user 0m0.053s +sys 0m0.078s + +real 0m0.075s +user 0m0.054s +sys 0m0.079s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.019s +sys 0m0.032s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.508s +user 0m1.620s +sys 0m0.276s + + + ============================================================================== + +Exit code: 0 + +real 0m0.545s +user 0m1.645s +sys 0m0.316s + +real 0m0.546s +user 0m1.646s +sys 0m0.317s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.029s +sys 0m0.026s + + + ============================================================================== + +Running: gocyclo . + +6 series TestFirst first_test.go:8:1 +6 series TestAskTooMuch asktoomuch_test.go:8:1 +5 series TestAll series_test.go:43:1 +5 series All series.go:10:1 +4 series TestUnsafeFirst series_test.go:55:1 +3 series UnsafeFirst series.go:39:1 +1 series ExampleUnsafeFirst series_examples_test.go:13:1 +1 series ExampleAll series_examples_test.go:7:1 + +real 0m0.003s +user 0m0.000s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.038s +user 0m0.036s +sys 0m0.037s + +real 0m0.040s +user 0m0.038s +sys 0m0.037s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.028s +user 0m0.034s +sys 0m0.018s + + + ============================================================================== + +Exit code: 0 + +real 0m0.041s +user 0m0.043s +sys 0m0.027s + +real 0m0.043s +user 0m0.044s +sys 0m0.027s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.024s +sys 0m0.030s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:30:24 Including rules: default +[gosec] 2023/09/07 00:30:24 Excluding rules: default +[gosec] 2023/09/07 00:30:24 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/series +[gosec] 2023/09/07 00:30:24 Checking package: series +[gosec] 2023/09/07 00:30:24 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/series/series.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 51 + Nosec : 0 + Issues : 0 + + +real 0m0.121s +user 0m0.146s +sys 0m0.099s + + + ============================================================================== + +Exit code: 0 + +real 0m0.168s +user 0m0.183s +sys 0m0.140s + +real 0m0.171s +user 0m0.184s +sys 0m0.141s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.029s +sys 0m0.030s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestAll --- PASS: TestAll (0.00s) === RUN TestUnsafeFirst @@ -24,34 +603,99 @@ go test -v -covermode=count -coverprofile coverage.out series --- PASS: ExampleUnsafeFirst (0.00s) PASS coverage: 81.0% of statements -ok series 0.016s coverage: 81.0% of statements +ok series 0.003s coverage: 81.0% of statements -real 0m0.630s -user 0m0.695s -sys 0m0.484s +real 0m0.183s +user 0m0.234s +sys 0m0.161s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + series/series.go:10: All 86.7% series/series.go:39: UnsafeFirst 66.7% total: (statements) 81.0% -real 0m0.249s -user 0m0.239s -sys 0m0.254s +real 0m0.055s +user 0m0.090s +sys 0m0.079s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.222s -user 0m0.232s -sys 0m0.210s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic series +real 0m0.071s +user 0m0.081s +sys 0m0.110s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +10 func All(size int, input string) []string { +11 var offset int +12 segments := []string{} +13 +14 reStr := `[[:digit:]]{` + fmt.Sprint(size) + `}` +15 re, e := regexp.Compile(reStr) +16 if e != nil { +17 MISS panic(e) +18 } +19 +20 for { +21 // It was easier to not use FindAllString(). +22 segment := re.FindString(input[offset:]) +23 if segment == "" { +24 break +25 } +26 +27 segments = append(segments, segment) +28 +29 offset++ +30 if offset > len(input)-(size-1) { +31 MISS break +32 } +33 } +34 +35 return segments +36 } + + +39 func UnsafeFirst(size int, input string) string { +40 if size > len(input) { +41 MISS return "" +42 } +43 +44 segments := All(size, input) +45 +46 if len(segments) > 0 { +47 return segments[0] +48 } +49 +50 MISS return "" +51 } + + +real 0m0.018s +user 0m0.026s +sys 0m0.014s + +real 0m0.019s +user 0m0.026s +sys 0m0.014s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestAll --- PASS: TestAll (0.00s) === RUN TestUnsafeFirst @@ -62,71 +706,71 @@ go test -v -race -covermode=atomic series --- PASS: ExampleUnsafeFirst (0.00s) PASS coverage: 81.0% of statements -ok series 0.061s coverage: 81.0% of statements +ok series 1.014s coverage: 81.0% of statements -real 0m0.768s -user 0m0.756s -sys 0m0.578s - -=============================================================================== +real 0m1.260s +user 0m0.309s +sys 0m0.184s -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -PASS -ok series 0.005s -real 0m0.613s -user 0m0.697s -sys 0m0.450s + ============================================================================== -=============================================================================== +Exit code: 0 -go test -tags bonus -PASS -ok series 0.010s +real 0m1.638s +user 0m0.774s +sys 0m0.596s -real 0m0.590s -user 0m0.671s -sys 0m0.513s +real 0m1.642s +user 0m0.775s +sys 0m0.599s =============================================================================== -No old benchmarks to run benchstat against. - -=============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go vet series +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok series 0.002s -real 0m0.398s -user 0m0.469s -sys 0m0.327s +real 0m0.154s +user 0m0.203s +sys 0m0.138s =============================================================================== -go fix series +gotest -v -tags bonus +=== RUN TestAll +--- PASS: TestAll (0.00s) +=== RUN TestUnsafeFirst +--- PASS: TestUnsafeFirst (0.00s) +=== RUN ExampleAll +--- PASS: ExampleAll (0.00s) +=== RUN ExampleUnsafeFirst +--- PASS: ExampleUnsafeFirst (0.00s) +PASS +ok series 0.001s -real 0m0.164s -user 0m0.149s -sys 0m0.170s +real 0m0.138s +user 0m0.187s +sys 0m0.128s =============================================================================== -gosec ./series -[gosec] 2022/07/03 18:19:38 Including rules: default -[gosec] 2022/07/03 18:19:38 Excluding rules: default -[gosec] 2022/07/03 18:19:38 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/series -2022/07/03 18:19:39 internal error: package "fmt" without types was imported from "command-line-arguments" +benchstat benchstat-old.txt benchstat-new.txt -real 0m0.730s -user 0m0.800s -sys 0m0.484s +real 0m0.002s +user 0m0.001s +sys 0m0.001s =============================================================================== gomarkdoc --output series-doc.md -real 0m0.045s -user 0m0.054s -sys 0m0.038s +real 0m0.020s +user 0m0.016s +sys 0m0.005s =============================================================================== @@ -146,9 +790,9 @@ func UnsafeFirst(size int, input string) string string. -real 0m0.405s -user 0m0.410s -sys 0m0.320s +real 0m0.043s +user 0m0.031s +sys 0m0.037s =============================================================================== diff --git a/go/series/series-doc.md b/go/series/series-doc.md index 1de610be..9acf5c7e 100755 --- a/go/series/series-doc.md +++ b/go/series/series-doc.md @@ -6,7 +6,7 @@ import "series" ``` -Package series returns contiguous substrings from a string\. +Package series returns contiguous substrings from a string. ## Index @@ -20,7 +20,7 @@ Package series returns contiguous substrings from a string\. func All(size int, input string) []string ``` -All returns all the contiguous substrings of length n in that string in the order that they appear\. +All returns all the contiguous substrings of length n in that string in the order that they appear.

Example

@@ -47,7 +47,7 @@ All returns all the contiguous substrings of length n in that string in the orde func UnsafeFirst(size int, input string) string ``` -UnsafeFirst return the first contiguous substrings of length n in that string\. +UnsafeFirst return the first contiguous substrings of length n in that string.

Example

diff --git a/go/sieve/benchstat-new.txt b/go/sieve/benchstat-new.txt index 6e0f4d05..49dff96a 100644 --- a/go/sieve/benchstat-new.txt +++ b/go/sieve/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: sieve -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkSieve-4 4113 301091 ns/op 58221 B/op 103 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkSieve +BenchmarkSieve-8 7575 140258 ns/op 56668 B/op 86 allocs/op PASS -ok sieve 1.312s +ok sieve 1.083s diff --git a/go/sieve/benchstat-old.txt b/go/sieve/benchstat-old.txt index f3f16827..6e0f4d05 100644 --- a/go/sieve/benchstat-old.txt +++ b/go/sieve/benchstat-old.txt @@ -2,6 +2,6 @@ goos: linux goarch: amd64 pkg: sieve cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkSieve-4 2 818023420 ns/op 57877472 B/op 38573 allocs/op +BenchmarkSieve-4 4113 301091 ns/op 58221 B/op 103 allocs/op PASS -ok sieve 2.618s +ok sieve 1.312s diff --git a/go/sieve/coverage-annotations.txt b/go/sieve/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/sieve/coverage.html b/go/sieve/coverage.html index 6e7d85ba..af3d0de8 100644 --- a/go/sieve/coverage.html +++ b/go/sieve/coverage.html @@ -124,8 +124,8 @@ for number, isPrime := range numbers { // fmt.Printf("number: %d\nisPrime: %v\n", number, isPrime) - if isPrime { - for x, j := 1, number*number; j <= limit; x, j = x+1, number*number+x*number { + if isPrime { + for x, j := 1, number*number; j <= limit; x, j = x+1, number*number+x*number { // fmt.Printf("\tx: %d\tj: %d\t", x, j) // fmt.Printf("i^2 + xi => %d^2 + %d*%d => %d\n", number, x, number, j) numbers[j] = false diff --git a/go/sieve/coverage.out b/go/sieve/coverage.out index 421ccbe6..4dd7c729 100644 --- a/go/sieve/coverage.out +++ b/go/sieve/coverage.out @@ -1,11 +1,11 @@ mode: count sieve/sieve.go:27.29,39.30 3 15 -sieve/sieve.go:44.2,44.39 1 15 -sieve/sieve.go:56.2,56.39 1 15 -sieve/sieve.go:62.2,64.15 2 15 sieve/sieve.go:39.30,41.3 1 1057 +sieve/sieve.go:44.2,44.39 1 15 sieve/sieve.go:44.39,47.14 1 1057 -sieve/sieve.go:47.14,48.81 1 525 -sieve/sieve.go:48.81,52.5 1 2292 +sieve/sieve.go:47.14,48.81 1 494 +sieve/sieve.go:48.81,52.5 1 1837 +sieve/sieve.go:56.2,56.39 1 15 sieve/sieve.go:56.39,57.14 1 1057 sieve/sieve.go:57.14,59.4 1 202 +sieve/sieve.go:62.2,64.15 2 15 diff --git a/go/sieve/run-tests-go.txt b/go/sieve/run-tests-go.txt index 2fc438e6..cd78a743 100644 --- a/go/sieve/run-tests-go.txt +++ b/go/sieve/run-tests-go.txt @@ -5,15 +5,580 @@ Go packages: sieve =============================================================================== -golint sieve +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.008s +sys 0m0.017s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +sieve.go:30: sieve.go:30: Line contains TODO/BUG/FIXME: "TODO: If limit is even, substract 1." (godox) + // TODO: If limit is even, substract 1. +sieve.go:33: sieve.go:33: Line contains TODO/BUG/FIXME: "TODO:" (godox) + // TODO: +sieve.go:67: sieve.go:67: Line contains TODO/BUG/FIXME: "TODO: Write and benchmark a Sieve64(int6..." (godox) +// TODO: Write and benchmark a Sieve64(int64) []int64 function. +cases_test.go:34: line is 832 characters (lll) + expected: []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997}, +sieve_test.go:11:20: Using the variable on range scope `tc` in function literal (scopelint) + actual := Sieve(tc.limit) + ^ +sieve_test.go:13:31: Using the variable on range scope `tc` in function literal (scopelint) + if len(actual) == 0 || len(tc.expected) == 0 { + ^ +sieve_test.go:16:34: Using the variable on range scope `tc` in function literal (scopelint) + if !reflect.DeepEqual(actual, tc.expected) { + ^ +sieve.go:44:39: block should not start with a whitespace (wsl) + for number, isPrime := range numbers { + ^ +sieve_test.go:27:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +sieve_test.go:8:1: Function TestSieve missing the call to method parallel (paralleltest) +func TestSieve(t *testing.T) { +^ +sieve_test.go:9:2: Range statement for test TestSieve missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +cases_test.go:1:9: package should be `sieve_test` instead of `sieve` (testpackage) +package sieve + ^ +sieve_examples_test.go:1:9: package should be `sieve_test` instead of `sieve` (testpackage) +package sieve + ^ +sieve_test.go:1:9: package should be `sieve_test` instead of `sieve` (testpackage) +package sieve + ^ + +real 0m0.533s +user 0m0.824s +sys 0m0.527s + + + ============================================================================== + +Exit code: -1 + +real 0m0.562s +user 0m0.839s +sys 0m0.550s + +real 0m0.563s +user 0m0.841s +sys 0m0.550s -real 0m0.154s -user 0m0.091s -sys 0m0.141s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.009s +sys 0m0.017s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.047s +user 0m0.026s +sys 0m0.035s + + + ============================================================================== + +Exit code: 0 + +real 0m0.080s +user 0m0.039s +sys 0m0.063s + +real 0m0.082s +user 0m0.041s +sys 0m0.064s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out sieve +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.000s +user 0m0.000s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.008s +sys 0m0.019s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "sort" without types was imported from "sieve" + +real 0m0.080s +user 0m0.130s +sys 0m0.099s + + + ============================================================================== + +Exit code: -1 + +real 0m0.112s +user 0m0.143s +sys 0m0.128s + +real 0m0.113s +user 0m0.144s +sys 0m0.128s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.011s +sys 0m0.017s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.168s +user 0m0.179s +sys 0m0.124s + + + ============================================================================== + +Exit code: 0 + +real 0m0.201s +user 0m0.190s +sys 0m0.155s + +real 0m0.203s +user 0m0.191s +sys 0m0.156s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.013s +sys 0m0.018s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./sieve.go:42:2: commentedOutCode: may want to remove commented-out code +./sieve.go:45:3: commentedOutCode: may want to remove commented-out code +./sieve.go:49:5: commentedOutCode: may want to remove commented-out code + +real 0m0.863s +user 0m2.080s +sys 0m0.283s + + + ============================================================================== + +Exit code: -1 + +real 0m0.903s +user 0m2.098s +sys 0m0.318s + +real 0m0.905s +user 0m2.098s +sys 0m0.319s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.011s +sys 0m0.013s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.077s +user 0m0.103s +sys 0m0.088s + + + ============================================================================== + +Exit code: 0 + +real 0m0.106s +user 0m0.122s +sys 0m0.108s + +real 0m0.108s +user 0m0.122s +sys 0m0.110s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.019s +sys 0m0.017s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.024s +user 0m0.015s +sys 0m0.017s + + + ============================================================================== + +Exit code: 0 + +real 0m0.065s +user 0m0.040s +sys 0m0.048s + +real 0m0.067s +user 0m0.041s +sys 0m0.049s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.008s +sys 0m0.021s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.466s +user 0m1.240s +sys 0m0.298s + + + ============================================================================== + +Exit code: 0 + +real 0m0.502s +user 0m1.254s +sys 0m0.332s + +real 0m0.504s +user 0m1.255s +sys 0m0.332s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.016s +sys 0m0.020s + + + ============================================================================== + +Running: gocyclo . + +7 sieve Sieve sieve.go:27:1 +5 sieve TestSieve sieve_test.go:8:1 +4 sieve BenchmarkSieve sieve_test.go:23:1 +2 sieve ExampleSieve sieve_examples_test.go:7:1 + +real 0m0.003s +user 0m0.001s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.047s +user 0m0.026s +sys 0m0.034s + +real 0m0.048s +user 0m0.028s +sys 0m0.034s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + +sieve.go:30:28: "substract" is a misspelling of "subtract" +coverage.html:110:35: "substract" is a misspelling of "subtract" +run-tests-go.txt:41:81: "substract" is a misspelling of "subtract" +run-tests-go.txt:42:28: "substract" is a misspelling of "subtract" + +real 0m0.037s +user 0m0.043s +sys 0m0.023s + + + ============================================================================== + +Exit code: 0 + +real 0m0.055s +user 0m0.050s +sys 0m0.042s + +real 0m0.058s +user 0m0.051s +sys 0m0.044s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.023s +sys 0m0.020s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:30:29 Including rules: default +[gosec] 2023/09/07 00:30:29 Excluding rules: default +[gosec] 2023/09/07 00:30:29 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/sieve +[gosec] 2023/09/07 00:30:29 Checking package: sieve +[gosec] 2023/09/07 00:30:29 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/sieve/sieve.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 67 + Nosec : 0 + Issues : 0 + + +real 0m0.134s +user 0m0.103s +sys 0m0.112s + + + ============================================================================== + +Exit code: 0 + +real 0m0.177s +user 0m0.136s +sys 0m0.142s + +real 0m0.180s +user 0m0.137s +sys 0m0.144s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.016s +sys 0m0.027s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestSieve === RUN TestSieve/no_primes_under_two === RUN TestSieve/find_first_prime @@ -30,140 +595,182 @@ go test -v -covermode=count -coverprofile coverage.out sieve --- PASS: ExampleSieve (0.00s) PASS coverage: 100.0% of statements -ok sieve 0.009s coverage: 100.0% of statements +ok sieve 0.002s coverage: 100.0% of statements -real 0m0.523s -user 0m0.578s -sys 0m0.404s +real 0m0.175s +user 0m0.218s +sys 0m0.138s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + sieve/sieve.go:27: Sieve 100.0% total: (statements) 100.0% -real 0m0.180s -user 0m0.114s -sys 0m0.184s +real 0m0.050s +user 0m0.033s +sys 0m0.047s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.185s -user 0m0.138s -sys 0m0.173s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic sieve +real 0m0.041s +user 0m0.026s +sys 0m0.064s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.018s +user 0m0.004s +sys 0m0.021s + +real 0m0.018s +user 0m0.005s +sys 0m0.021s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestSieve === RUN TestSieve/no_primes_under_two === RUN TestSieve/find_first_prime === RUN TestSieve/find_primes_up_to_10 === RUN TestSieve/limit_is_prime === RUN TestSieve/find_primes_up_to_1000 ---- PASS: TestSieve (0.01s) +--- PASS: TestSieve (0.00s) --- PASS: TestSieve/no_primes_under_two (0.00s) --- PASS: TestSieve/find_first_prime (0.00s) --- PASS: TestSieve/find_primes_up_to_10 (0.00s) --- PASS: TestSieve/limit_is_prime (0.00s) - --- PASS: TestSieve/find_primes_up_to_1000 (0.01s) + --- PASS: TestSieve/find_primes_up_to_1000 (0.00s) === RUN ExampleSieve --- PASS: ExampleSieve (0.00s) PASS coverage: 100.0% of statements -ok sieve 0.056s coverage: 100.0% of statements +ok sieve 1.013s coverage: 100.0% of statements + +real 0m1.252s +user 0m0.281s +sys 0m0.161s + + + ============================================================================== -real 0m0.646s -user 0m0.706s -sys 0m0.423s +Exit code: 0 + +real 0m1.580s +user 0m0.587s +sys 0m0.467s + +real 0m1.582s +user 0m0.589s +sys 0m0.467s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: sieve -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkSieve-4 4113 301091 ns/op 58221 B/op 103 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkSieve +BenchmarkSieve-8 7575 140258 ns/op 56668 B/op 86 allocs/op PASS -ok sieve 1.312s +ok sieve 1.083s -real 0m1.789s -user 0m2.164s -sys 0m0.419s +real 0m1.224s +user 0m1.263s +sys 0m0.202s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestSieve +=== RUN TestSieve/no_primes_under_two +=== RUN TestSieve/find_first_prime +=== RUN TestSieve/find_primes_up_to_10 +=== RUN TestSieve/limit_is_prime +=== RUN TestSieve/find_primes_up_to_1000 +--- PASS: TestSieve (0.00s) + --- PASS: TestSieve/no_primes_under_two (0.00s) + --- PASS: TestSieve/find_first_prime (0.00s) + --- PASS: TestSieve/find_primes_up_to_10 (0.00s) + --- PASS: TestSieve/limit_is_prime (0.00s) + --- PASS: TestSieve/find_primes_up_to_1000 (0.00s) +=== RUN ExampleSieve +--- PASS: ExampleSieve (0.00s) PASS -ok sieve 0.016s +ok sieve 0.001s -real 0m0.594s -user 0m0.666s -sys 0m0.453s +real 0m0.130s +user 0m0.201s +sys 0m0.115s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m0.463s -user 0m0.656s -sys 0m0.356s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -Sieve-4 818ms ± 0% 0ms ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -Sieve-4 57.9MB ± 0% 0.1MB ± 0% ~ (p=1.000 n=1+1) - -name old allocs/op new allocs/op delta -Sieve-4 38.6k ± 0% 0.1k ± 0% ~ (p=1.000 n=1+1) - -real 0m0.029s -user 0m0.017s -sys 0m0.030s - -=============================================================================== - -go vet sieve - -real 0m0.395s -user 0m0.431s -sys 0m0.346s - -=============================================================================== - -go fix sieve +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: sieve +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Sieve-8 140.3µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Sieve-8 55.34Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Sieve-8 86.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.120s -user 0m0.073s -sys 0m0.101s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Sieve-4 301.1µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +Sieve-4 56.86Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./sieve -[gosec] 2022/07/24 00:39:43 Including rules: default -[gosec] 2022/07/24 00:39:43 Excluding rules: default -[gosec] 2022/07/24 00:39:43 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/sieve -2022/07/24 00:39:43 internal error: package "sort" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +Sieve-4 103.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.358s -user 0m0.375s -sys 0m0.264s +real 0m0.002s +user 0m0.001s +sys 0m0.001s =============================================================================== gomarkdoc --output sieve-doc.md -real 0m0.040s -user 0m0.029s -sys 0m0.015s +real 0m0.010s +user 0m0.004s +sys 0m0.006s =============================================================================== @@ -195,9 +802,9 @@ func Sieve(limit int) []int return all i such that A[i] is true. -real 0m0.202s -user 0m0.101s -sys 0m0.178s +real 0m0.037s +user 0m0.024s +sys 0m0.023s =============================================================================== diff --git a/go/sieve/sieve-doc.md b/go/sieve/sieve-doc.md index 4e44520f..d2f3eb2f 100755 --- a/go/sieve/sieve-doc.md +++ b/go/sieve/sieve-doc.md @@ -6,7 +6,7 @@ import "sieve" ``` -Package sieve of Eratosthenes is used to find all the primes from 2 up to a given number\. +Package sieve of Eratosthenes is used to find all the primes from 2 up to a given number. ## Index @@ -19,7 +19,7 @@ Package sieve of Eratosthenes is used to find all the primes from 2 up to a give func Sieve(limit int) []int ``` -Sieve returns a list of prime numbers using the Sieve of Eratosthenes\. https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes Litering the code with optimization todos so I can play with Go benchmarks\. +Sieve returns a list of prime numbers using the Sieve of Eratosthenes. https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes Litering the code with optimization todos so I can play with Go benchmarks. ``` algorithm Sieve of Eratosthenes is diff --git a/go/simple-cipher/benchstat-new.txt b/go/simple-cipher/benchstat-new.txt index 62fc9258..7487d4fb 100644 --- a/go/simple-cipher/benchstat-new.txt +++ b/go/simple-cipher/benchstat-new.txt @@ -1,14 +1,22 @@ goos: linux goarch: amd64 pkg: cipher -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkEncodeCaesar-4 46074 28353 ns/op 5440 B/op 104 allocs/op -BenchmarkDecodeCaesar-4 1000000 1650 ns/op 184 B/op 12 allocs/op -BenchmarkNewShift-4 42856383 25.17 ns/op 0 B/op 0 allocs/op -BenchmarkEncodeShift-4 23102 51998 ns/op 9571 B/op 185 allocs/op -BenchmarkDecodeShift-4 309681 4083 ns/op 504 B/op 25 allocs/op -BenchmarkNewVigenere-4 13005 82509 ns/op 23604 B/op 345 allocs/op -BenchmarkEncVigenere-4 45820 26012 ns/op 5298 B/op 103 allocs/op -BenchmarkDecVigenere-4 994320 1497 ns/op 160 B/op 13 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkEncodeCaesar +BenchmarkEncodeCaesar-8 133518 9154 ns/op 5515 B/op 104 allocs/op +BenchmarkDecodeCaesar +BenchmarkDecodeCaesar-8 2185735 547.1 ns/op 184 B/op 12 allocs/op +BenchmarkNewShift +BenchmarkNewShift-8 69165717 20.51 ns/op 0 B/op 0 allocs/op +BenchmarkEncodeShift +BenchmarkEncodeShift-8 64356 18424 ns/op 9694 B/op 185 allocs/op +BenchmarkDecodeShift +BenchmarkDecodeShift-8 855981 1345 ns/op 504 B/op 25 allocs/op +BenchmarkNewVigenere +BenchmarkNewVigenere-8 55738 22226 ns/op 23766 B/op 345 allocs/op +BenchmarkEncVigenere +BenchmarkEncVigenere-8 155208 7620 ns/op 5374 B/op 103 allocs/op +BenchmarkDecVigenere +BenchmarkDecVigenere-8 2421415 499.6 ns/op 160 B/op 13 allocs/op PASS -ok cipher 13.694s +ok cipher 12.977s diff --git a/go/simple-cipher/benchstat-old.txt b/go/simple-cipher/benchstat-old.txt new file mode 100644 index 00000000..62fc9258 --- /dev/null +++ b/go/simple-cipher/benchstat-old.txt @@ -0,0 +1,14 @@ +goos: linux +goarch: amd64 +pkg: cipher +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkEncodeCaesar-4 46074 28353 ns/op 5440 B/op 104 allocs/op +BenchmarkDecodeCaesar-4 1000000 1650 ns/op 184 B/op 12 allocs/op +BenchmarkNewShift-4 42856383 25.17 ns/op 0 B/op 0 allocs/op +BenchmarkEncodeShift-4 23102 51998 ns/op 9571 B/op 185 allocs/op +BenchmarkDecodeShift-4 309681 4083 ns/op 504 B/op 25 allocs/op +BenchmarkNewVigenere-4 13005 82509 ns/op 23604 B/op 345 allocs/op +BenchmarkEncVigenere-4 45820 26012 ns/op 5298 B/op 103 allocs/op +BenchmarkDecVigenere-4 994320 1497 ns/op 160 B/op 13 allocs/op +PASS +ok cipher 13.694s diff --git a/go/simple-cipher/coverage.out b/go/simple-cipher/coverage.out index 788f4b4b..422c4384 100644 --- a/go/simple-cipher/coverage.out +++ b/go/simple-cipher/coverage.out @@ -1,54 +1,54 @@ mode: count cipher/simple_cipher.go:18.25,24.2 3 3 cipher/simple_cipher.go:27.36,28.54 1 9 -cipher/simple_cipher.go:32.2,36.15 3 4 cipher/simple_cipher.go:28.54,30.3 1 5 +cipher/simple_cipher.go:32.2,36.15 3 4 cipher/simple_cipher.go:40.44,41.17 1 26 -cipher/simple_cipher.go:45.2,51.29 4 24 -cipher/simple_cipher.go:63.2,63.24 1 24 cipher/simple_cipher.go:41.17,43.3 1 2 +cipher/simple_cipher.go:45.2,51.29 4 24 cipher/simple_cipher.go:51.29,55.17 2 379 -cipher/simple_cipher.go:59.3,60.33 2 379 cipher/simple_cipher.go:55.17,57.4 1 10 +cipher/simple_cipher.go:59.3,60.33 2 379 +cipher/simple_cipher.go:63.2,63.24 1 24 cipher/simple_cipher.go:67.45,68.18 1 26 -cipher/simple_cipher.go:72.2,78.29 4 22 -cipher/simple_cipher.go:90.2,90.24 1 22 cipher/simple_cipher.go:68.18,70.3 1 4 +cipher/simple_cipher.go:72.2,78.29 4 22 cipher/simple_cipher.go:78.29,82.17 2 379 -cipher/simple_cipher.go:86.3,87.33 2 379 cipher/simple_cipher.go:82.17,84.4 1 18 +cipher/simple_cipher.go:86.3,87.33 2 379 +cipher/simple_cipher.go:90.2,90.24 1 22 cipher/simple_cipher.go:94.37,95.15 1 13 -cipher/simple_cipher.go:99.2,102.16 3 12 -cipher/simple_cipher.go:107.2,107.11 1 12 -cipher/simple_cipher.go:111.2,114.16 3 10 -cipher/simple_cipher.go:119.2,119.12 1 10 -cipher/simple_cipher.go:123.2,127.15 2 6 cipher/simple_cipher.go:95.15,97.3 1 1 +cipher/simple_cipher.go:99.2,102.16 3 12 cipher/simple_cipher.go:102.16,103.13 1 0 +cipher/simple_cipher.go:107.2,107.11 1 12 cipher/simple_cipher.go:107.11,109.3 1 2 +cipher/simple_cipher.go:111.2,114.16 3 10 cipher/simple_cipher.go:114.16,115.13 1 0 +cipher/simple_cipher.go:119.2,119.12 1 10 cipher/simple_cipher.go:119.12,121.3 1 4 +cipher/simple_cipher.go:123.2,127.15 2 6 cipher/simple_cipher.go:131.47,132.17 1 7 -cipher/simple_cipher.go:136.2,142.27 4 7 -cipher/simple_cipher.go:154.2,154.24 1 7 cipher/simple_cipher.go:132.17,134.3 1 0 +cipher/simple_cipher.go:136.2,142.27 4 7 cipher/simple_cipher.go:142.27,147.19 3 90 -cipher/simple_cipher.go:151.3,151.33 1 90 cipher/simple_cipher.go:147.19,149.4 1 19 +cipher/simple_cipher.go:151.3,151.33 1 90 +cipher/simple_cipher.go:154.2,154.24 1 7 cipher/simple_cipher.go:158.48,159.18 1 7 -cipher/simple_cipher.go:163.2,169.27 4 7 -cipher/simple_cipher.go:181.2,181.23 1 7 cipher/simple_cipher.go:159.18,161.3 1 0 +cipher/simple_cipher.go:163.2,169.27 4 7 cipher/simple_cipher.go:169.27,174.18 3 90 -cipher/simple_cipher.go:178.3,178.32 1 90 cipher/simple_cipher.go:174.18,176.4 1 19 +cipher/simple_cipher.go:178.3,178.32 1 90 +cipher/simple_cipher.go:181.2,181.23 1 7 cipher/simple_cipher.go:184.36,185.16 1 33 -cipher/simple_cipher.go:189.2,194.16 4 33 -cipher/simple_cipher.go:198.2,201.15 3 33 cipher/simple_cipher.go:185.16,187.3 1 0 +cipher/simple_cipher.go:189.2,194.16 4 33 cipher/simple_cipher.go:194.16,195.13 1 0 +cipher/simple_cipher.go:198.2,201.15 3 33 cipher/simple_cipher.go:204.45,205.15 1 15 -cipher/simple_cipher.go:209.2,211.25 2 15 -cipher/simple_cipher.go:215.2,217.15 2 15 cipher/simple_cipher.go:205.15,207.3 1 0 +cipher/simple_cipher.go:209.2,211.25 2 15 cipher/simple_cipher.go:211.25,213.3 1 5 +cipher/simple_cipher.go:215.2,217.15 2 15 diff --git a/go/simple-cipher/run-tests-go.txt b/go/simple-cipher/run-tests-go.txt index 84a259e8..9c0ce279 100644 --- a/go/simple-cipher/run-tests-go.txt +++ b/go/simple-cipher/run-tests-go.txt @@ -5,56 +5,724 @@ Go packages: cipher =============================================================================== -golint ./... +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.107s -user 0m0.110s -sys 0m0.074s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.022s +sys 0m0.024s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +simple_cipher_test.go:8:60: Comment should end in a period (godot) +// type for testing implementations of the Cipher interface + ^ +simple_cipher_examples_test.go:74: File is not `gofmt`-ed with `-s` (gofmt) + []string{"abcdefghijklmnopqrstuvwxyz", "aaaaaaaaaaaaaaaaaaaaaaaaaa"}, +simple_cipher.go:101: File is not `gofumpt`-ed (gofumpt) + +simple_cipher.go:193: File is not `gofumpt`-ed (gofumpt) + +simple_cipher_test.go:59: File is not `gofumpt`-ed (gofumpt) + {"SPIES SEND SECRET MESSAGES", +simple_cipher_test.go:45:23: Using the variable on range scope `test` in function literal (scopelint) + if enc := c.Encode(test.source); enc != test.cipher { + ^ +simple_cipher_test.go:46:47: Using the variable on range scope `test` in function literal (scopelint) + tt.Errorf("Encode(%s): got %q, want %q.", test.source, enc, test.cipher) + ^ +simple_cipher_test.go:50:23: Using the variable on range scope `test` in function literal (scopelint) + if dec := c.Decode(test.cipher); dec != test.plain { + ^ +simple_cipher_test.go:34:2: only cuddled expressions if assigning variable or using from line above (wsl) + t.Run("no extra symbols", func(t *testing.T) { + ^ +simple_cipher_test.go:89:1: block should not end with a whitespace (or comment) (wsl) +} +^ +simple_cipher_test.go:146:2: assignments should only be cuddled with other assignments (wsl) + c := NewCaesar() + ^ +simple_cipher_test.go:147:2: only cuddled expressions if assigning variable or using from line above (wsl) + b.ResetTimer() + ^ +simple_cipher_test.go:148:2: only one cuddle assignment allowed before for statement (wsl) + for i := 0; i < b.N; i++ { + ^ +simple_cipher_test.go:159:2: assignments should only be cuddled with other assignments (wsl) + c := NewCaesar() + ^ +simple_cipher_test.go:160:2: only cuddled expressions if assigning variable or using from line above (wsl) + b.ResetTimer() + ^ +simple_cipher_test.go:161:2: only one cuddle assignment allowed before for statement (wsl) + for i := 0; i < b.N; i++ { + ^ +simple_cipher_test.go:172:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +simple_cipher_test.go:183:2: assignments should only be cuddled with other assignments (wsl) + s := NewShift(5) + ^ +simple_cipher_test.go:187:2: only one cuddle assignment allowed before for statement (wsl) + for i := 0; i < b.N; i++ { + ^ +simple_cipher_test.go:213:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +simple_cipher_test.go:225:2: only one cuddle assignment allowed before range statement (wsl) + for i, test := range vtests { + ^ +simple_cipher_test.go:231:2: expressions should not be cuddled with blocks (wsl) + b.ResetTimer() + ^ +simple_cipher_test.go:247:2: only one cuddle assignment allowed before range statement (wsl) + for i, test := range vtests { + ^ +simple_cipher_test.go:253:2: expressions should not be cuddled with blocks (wsl) + b.ResetTimer() + ^ +simple_cipher_test.go:15:5: caesarPrepped is a global variable (gochecknoglobals) +var caesarPrepped = []cipherTest{ + ^ +simple_cipher_test.go:22:5: caesarTests is a global variable (gochecknoglobals) +var caesarTests = []cipherTest{ + ^ +simple_cipher_test.go:57:5: NSATests is a global variable (gochecknoglobals) +var NSATests = []cipherTest{ + ^ +simple_cipher_test.go:99:5: vtests is a global variable (gochecknoglobals) +var vtests = []struct { + ^ +simple_cipher.go:147:15: mnd: Magic number: 122, in detected (gomnd) + if target > 122 { + ^ +simple_cipher.go:174:15: mnd: Magic number: 97, in detected (gomnd) + if target < 97 { + ^ +simple_cipher.go:59:22: mnd: Magic number: 26, in detected (gomnd) + letter = (letter % 26) + offset + ^ +simple_cipher.go:86:22: mnd: Magic number: 26, in detected (gomnd) + letter = (letter % 26) + offset + ^ +simple_cipher.go:143:25: mnd: Magic number: 97, in detected (gomnd) + offset := int(char) - 97 + ^ +simple_cipher.go:170:25: mnd: Magic number: 97, in detected (gomnd) + offset := int(char) - 97 + ^ +simple_cipher_examples_test.go:5:1: tests: ExampleNormalizeText refers to unknown identifier: NormalizeText (govet) +func ExampleNormalizeText() { +^ +simple_cipher_examples_test.go:22:1: tests: ExampleFixKey refers to unknown identifier: FixKey (govet) +func ExampleFixKey() { +^ +simple_cipher_examples_test.go:32:1: tests: ExampleCeasarCipher refers to unknown identifier: CeasarCipher (govet) +func ExampleCeasarCipher() { +^ +simple_cipher_examples_test.go:52:1: tests: ExampleShiftCipher refers to unknown identifier: ShiftCipher (govet) +func ExampleShiftCipher() { +^ +simple_cipher_examples_test.go:72:1: tests: ExampleVigenereCipher refers to unknown identifier: VigenereCipher (govet) +func ExampleVigenereCipher() { +^ +simple_cipher.go:18:1: NewCaesar returns interface (cipher.Cipher) (ireturn) +func NewCaesar() Cipher { +^ +simple_cipher.go:27:1: NewShift returns interface (cipher.Cipher) (ireturn) +func NewShift(distance int) Cipher { +^ +simple_cipher.go:94:1: NewVigenere returns interface (cipher.Cipher) (ireturn) +func NewVigenere(key string) Cipher { +^ +simple_cipher_test.go:32:1: Function TestCaesar missing the call to method parallel (paralleltest) +func TestCaesar(t *testing.T) { +^ +simple_cipher_test.go:37:2: Function TestCaesar has missing the call to method parallel in the test run (paralleltest) + t.Run("with extra symbols", func(t *testing.T) { + ^ +simple_cipher_test.go:70:1: Function TestShift missing the call to method parallel (paralleltest) +func TestShift(t *testing.T) { +^ +simple_cipher_test.go:72:2: Function TestShift has missing the call to method parallel in the test run (paralleltest) + t.Run(fmt.Sprintf("key=%d", 3), func(t *testing.T) { + ^ +simple_cipher_test.go:81:2: Function TestShift has missing the call to method parallel in the test run (paralleltest) + t.Run(fmt.Sprintf("key=%d", -3), func(t *testing.T) { + ^ +simple_cipher_test.go:91:1: Function TestWrongShiftKey missing the call to method parallel (paralleltest) +func TestWrongShiftKey(t *testing.T) { +^ +simple_cipher_test.go:119:1: Function TestVigenere missing the call to method parallel (paralleltest) +func TestVigenere(t *testing.T) { +^ +simple_cipher_test.go:120:2: Range statement for test TestVigenere missing the call to method parallel in test Run (paralleltest) + for _, test := range vtests { + ^ +simple_cipher_test.go:132:1: Function TestVigenereWrongKey missing the call to method parallel (paralleltest) +func TestVigenereWrongKey(t *testing.T) { +^ +simple_cipher_examples_test.go:1:9: package should be `cipher_test` instead of `cipher` (testpackage) +package cipher + ^ +simple_cipher_test.go:1:9: package should be `cipher_test` instead of `cipher` (testpackage) +package cipher + ^ +simple_cipher_test.go:42:6: parameter *testing.T should be the first or after context.Context (thelper) +func testCipher(c Cipher, tests []cipherTest, t *testing.T) { + ^ +simple_cipher.go:192:2: variable name 're' is too short for the scope of its usage (varnamelen) + re, err := regexp.Compile(reStr) + ^ + +real 0m0.543s +user 0m0.862s +sys 0m0.502s + + + ============================================================================== + +Exit code: -1 + +real 0m0.586s +user 0m0.893s +sys 0m0.534s + +real 0m0.588s +user 0m0.894s +sys 0m0.536s =============================================================================== -revive ./... +Running: ../../.github/citools/go/go-lint-revive -real 0m0.033s -user 0m0.034s -sys 0m0.016s +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.022s +sys 0m0.023s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.048s +user 0m0.026s +sys 0m0.035s + + + ============================================================================== + +Exit code: 0 + +real 0m0.091s +user 0m0.056s +sys 0m0.068s + +real 0m0.093s +user 0m0.058s +sys 0m0.068s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.239s -user 0m0.276s -sys 0m0.253s +real 0m0.001s +user 0m0.000s +sys 0m0.000s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.020s +sys 0m0.024s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." +internal error: package "regexp" without types was imported from "cipher" + +real 0m0.087s +user 0m0.118s +sys 0m0.104s + + + ============================================================================== -real 0m0.510s -user 0m0.587s -sys 0m0.487s +Exit code: -1 + +real 0m0.126s +user 0m0.145s +sys 0m0.137s + +real 0m0.127s +user 0m0.146s +sys 0m0.138s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.017s +sys 0m0.021s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.180s +user 0m0.211s +sys 0m0.145s -real 0m0.489s -user 0m0.648s -sys 0m0.442s + + ============================================================================== + +Exit code: 0 + +real 0m0.214s +user 0m0.233s +sys 0m0.178s + +real 0m0.216s +user 0m0.233s +sys 0m0.180s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.014s +sys 0m0.018s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.857s +user 0m2.155s +sys 0m0.309s + + + ============================================================================== + +Exit code: 0 + +real 0m0.893s +user 0m2.182s +sys 0m0.335s + +real 0m0.895s +user 0m2.182s +sys 0m0.337s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.018s +sys 0m0.019s + + + ============================================================================== + +Running: go vet ./... + +# cipher +./simple_cipher_examples_test.go:5:1: ExampleNormalizeText refers to unknown identifier: NormalizeText +./simple_cipher_examples_test.go:22:1: ExampleFixKey refers to unknown identifier: FixKey +./simple_cipher_examples_test.go:32:1: ExampleCeasarCipher refers to unknown identifier: CeasarCipher +./simple_cipher_examples_test.go:52:1: ExampleShiftCipher refers to unknown identifier: ShiftCipher +./simple_cipher_examples_test.go:72:1: ExampleVigenereCipher refers to unknown identifier: VigenereCipher + +real 0m0.097s +user 0m0.152s +sys 0m0.135s + + + ============================================================================== + +Exit code: -1 + +real 0m0.131s +user 0m0.173s +sys 0m0.165s + +real 0m0.133s +user 0m0.173s +sys 0m0.167s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.010s +sys 0m0.020s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.032s +user 0m0.025s +sys 0m0.023s + + + ============================================================================== + +Exit code: 0 + +real 0m0.063s +user 0m0.041s +sys 0m0.052s + +real 0m0.065s +user 0m0.042s +sys 0m0.053s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.034s +user 0m0.028s +sys 0m0.027s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.499s +user 0m1.365s +sys 0m0.292s + + + ============================================================================== + +Exit code: 0 + +real 0m0.551s +user 0m1.401s +sys 0m0.338s + +real 0m0.555s +user 0m1.402s +sys 0m0.339s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.016s +sys 0m0.017s + + + ============================================================================== + +Running: gocyclo . + +7 cipher BenchmarkDecVigenere simple_cipher_test.go:242:1 +7 cipher BenchmarkEncVigenere simple_cipher_test.go:220:1 +6 cipher NewVigenere simple_cipher.go:94:1 +4 cipher BenchmarkNewVigenere simple_cipher_test.go:209:1 +4 cipher BenchmarkDecodeShift simple_cipher_test.go:194:1 +4 cipher BenchmarkEncodeShift simple_cipher_test.go:179:1 +4 cipher BenchmarkNewShift simple_cipher_test.go:168:1 +4 cipher BenchmarkDecodeCaesar simple_cipher_test.go:155:1 +4 cipher BenchmarkEncodeCaesar simple_cipher_test.go:142:1 +4 cipher testCipher simple_cipher_test.go:42:1 +4 cipher (vigenere).Decode simple_cipher.go:158:1 +4 cipher (vigenere).Encode simple_cipher.go:131:1 +4 cipher (shift).Decode simple_cipher.go:67:1 +4 cipher (shift).Encode simple_cipher.go:40:1 +4 cipher NewShift simple_cipher.go:27:1 +3 cipher TestVigenereWrongKey simple_cipher_test.go:132:1 +3 cipher TestVigenere simple_cipher_test.go:119:1 +3 cipher TestWrongShiftKey simple_cipher_test.go:91:1 +3 cipher TestShift simple_cipher_test.go:70:1 +3 cipher fixKey simple_cipher.go:204:1 +3 cipher normalize simple_cipher.go:184:1 +2 cipher ExampleVigenereCipher simple_cipher_examples_test.go:72:1 +2 cipher ExampleShiftCipher simple_cipher_examples_test.go:52:1 +2 cipher ExampleCeasarCipher simple_cipher_examples_test.go:32:1 +2 cipher ExampleNormalizeText simple_cipher_examples_test.go:5:1 +1 cipher TestCaesar simple_cipher_test.go:32:1 +1 cipher ExampleFixKey simple_cipher_examples_test.go:22:1 +1 cipher NewCaesar simple_cipher.go:18:1 + +real 0m0.005s +user 0m0.001s +sys 0m0.004s + + + ============================================================================== + +Exit code: 0 + +real 0m0.036s +user 0m0.022s +sys 0m0.031s + +real 0m0.038s +user 0m0.022s +sys 0m0.032s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.030s +user 0m0.034s +sys 0m0.015s + + + ============================================================================== + +Exit code: 0 + +real 0m0.042s +user 0m0.041s +sys 0m0.024s + +real 0m0.045s +user 0m0.043s +sys 0m0.025s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.038s +user 0m0.027s +sys 0m0.030s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:30:35 Including rules: default +[gosec] 2023/09/07 00:30:35 Excluding rules: default +[gosec] 2023/09/07 00:30:35 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/simple-cipher +[gosec] 2023/09/07 00:30:35 Checking package: cipher +[gosec] 2023/09/07 00:30:35 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/simple-cipher/cipher.go +[gosec] 2023/09/07 00:30:35 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/simple-cipher/simple_cipher.go +Results: + + +Summary: + Gosec : dev + Files : 2 + Lines : 225 + Nosec : 0 + Issues : 0 + + +real 0m0.112s +user 0m0.109s +sys 0m0.087s + + + ============================================================================== + +Exit code: 0 + +real 0m0.170s +user 0m0.142s +sys 0m0.138s -real 0m2.467s -user 0m4.126s -sys 0m1.079s +real 0m0.174s +user 0m0.145s +sys 0m0.139s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.014s +sys 0m0.026s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestCaesar === RUN TestCaesar/no_extra_symbols === RUN TestCaesar/no_extra_symbols/Encode(iamapandabear) @@ -80,7 +748,7 @@ gotest -v -covermode=count -coverprofile coverage.out ./... === RUN TestCaesar/with_extra_symbols/Decode() === RUN TestCaesar/with_extra_symbols/Encode() === RUN TestCaesar/with_extra_symbols/Decode()#01 ---- PASS: TestCaesar (0.01s) +--- PASS: TestCaesar (0.00s) --- PASS: TestCaesar/no_extra_symbols (0.00s) --- PASS: TestCaesar/no_extra_symbols/Encode(iamapandabear) (0.00s) --- PASS: TestCaesar/no_extra_symbols/Decode(ldpdsdqgdehdu) (0.00s) @@ -90,7 +758,7 @@ gotest -v -covermode=count -coverprofile coverage.out ./... --- PASS: TestCaesar/no_extra_symbols/Decode(wrgdblvkrolgdb) (0.00s) --- PASS: TestCaesar/no_extra_symbols/Encode(venividivici) (0.00s) --- PASS: TestCaesar/no_extra_symbols/Decode(yhqlylglylfl) (0.00s) - --- PASS: TestCaesar/with_extra_symbols (0.01s) + --- PASS: TestCaesar/with_extra_symbols (0.00s) --- PASS: TestCaesar/with_extra_symbols/Encode(Go,_go,_gophers) (0.00s) --- PASS: TestCaesar/with_extra_symbols/Decode(jrjrjrskhuv) (0.00s) --- PASS: TestCaesar/with_extra_symbols/Encode(I_am_a_panda_bear.) (0.00s) @@ -207,15 +875,17 @@ gotest -v -covermode=count -coverprofile coverage.out ./... --- PASS: ExampleVigenereCipher (0.00s) PASS coverage: 92.1% of statements -ok cipher 0.040s coverage: 92.1% of statements +ok cipher 0.008s coverage: 92.1% of statements -real 0m0.828s -user 0m1.020s -sys 0m0.733s +real 0m0.211s +user 0m0.273s +sys 0m0.148s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + cipher/simple_cipher.go:18: NewCaesar 100.0% cipher/simple_cipher.go:27: NewShift 100.0% cipher/simple_cipher.go:40: Encode 100.0% @@ -227,21 +897,26 @@ cipher/simple_cipher.go:184: normalize 80.0% cipher/simple_cipher.go:204: fixKey 85.7% total: (statements) 92.1% -real 0m0.300s -user 0m0.223s -sys 0m0.349s +real 0m0.050s +user 0m0.058s +sys 0m0.077s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.167s -user 0m0.139s -sys 0m0.206s +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.043s +user 0m0.050s +sys 0m0.068s -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt 94 func NewVigenere(key string) Cipher { 95 if key == "" { @@ -372,13 +1047,19 @@ gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annota 155 } -real 0m0.063s -user 0m0.038s -sys 0m0.066s +real 0m0.020s +user 0m0.012s +sys 0m0.022s -=============================================================================== +real 0m0.020s +user 0m0.012s +sys 0m0.022s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestCaesar === RUN TestCaesar/no_extra_symbols === RUN TestCaesar/no_extra_symbols/Encode(iamapandabear) @@ -414,7 +1095,7 @@ gotest -v -race -covermode=atomic ./... --- PASS: TestCaesar/no_extra_symbols/Decode(wrgdblvkrolgdb) (0.00s) --- PASS: TestCaesar/no_extra_symbols/Encode(venividivici) (0.00s) --- PASS: TestCaesar/no_extra_symbols/Decode(yhqlylglylfl) (0.00s) - --- PASS: TestCaesar/with_extra_symbols (0.01s) + --- PASS: TestCaesar/with_extra_symbols (0.00s) --- PASS: TestCaesar/with_extra_symbols/Encode(Go,_go,_gophers) (0.00s) --- PASS: TestCaesar/with_extra_symbols/Decode(jrjrjrskhuv) (0.00s) --- PASS: TestCaesar/with_extra_symbols/Encode(I_am_a_panda_bear.) (0.00s) @@ -455,7 +1136,7 @@ gotest -v -race -covermode=atomic ./... === RUN TestShift/key=-3/Encode(the_quick_brown_fox_jumps_over_the_lazy_dog) === RUN TestShift/key=-3/Decode(qebnrfzhyoltkclugrjmplsboqebixwvald) --- PASS: TestShift (0.01s) - --- PASS: TestShift/key=3 (0.01s) + --- PASS: TestShift/key=3 (0.00s) --- PASS: TestShift/key=3/Encode(Go,_go,_gophers) (0.00s) --- PASS: TestShift/key=3/Decode(jrjrjrskhuv) (0.00s) --- PASS: TestShift/key=3/Encode(I_am_a_panda_bear.) (0.00s) @@ -470,12 +1151,12 @@ gotest -v -race -covermode=atomic ./... --- PASS: TestShift/key=3/Decode() (0.00s) --- PASS: TestShift/key=3/Encode() (0.00s) --- PASS: TestShift/key=3/Decode()#01 (0.00s) - --- PASS: TestShift/key=-3 (0.01s) + --- PASS: TestShift/key=-3 (0.00s) --- PASS: TestShift/key=-3/Encode(THE_ENEMY_IS_NEAR) (0.00s) --- PASS: TestShift/key=-3/Decode(qebbkbjvfpkbxo) (0.00s) --- PASS: TestShift/key=-3/Encode(SPIES_SEND_SECRET_MESSAGES) (0.00s) --- PASS: TestShift/key=-3/Decode(pmfbppbkapbzobqjbppxdbp) (0.00s) - --- PASS: TestShift/key=-3/Encode(THOMAS_JEFFERSON_DESIGNED_A_SUBSTITUTION_CIPHER) (0.01s) + --- PASS: TestShift/key=-3/Encode(THOMAS_JEFFERSON_DESIGNED_A_SUBSTITUTION_CIPHER) (0.00s) --- PASS: TestShift/key=-3/Decode(qeljxpgbccboplkabpfdkbaxprypqfqrqflkzfmebo) (0.00s) --- PASS: TestShift/key=-3/Encode(the_quick_brown_fox_jumps_over_the_lazy_dog) (0.00s) --- PASS: TestShift/key=-3/Decode(qebnrfzhyoltkclugrjmplsboqebixwvald) (0.00s) @@ -499,7 +1180,7 @@ gotest -v -race -covermode=atomic ./... === RUN TestVigenere/key=qgbvno === RUN TestVigenere/key=qgbvno/Encode(cof-FEE,_123!) === RUN TestVigenere/key=qgbvno/Decode(sugars) ---- PASS: TestVigenere (0.01s) +--- PASS: TestVigenere (0.00s) --- PASS: TestVigenere/key=lemon (0.00s) --- PASS: TestVigenere/key=lemon/Encode(ATTACKATDAWN) (0.00s) --- PASS: TestVigenere/key=lemon/Decode(lxfopvefrnhr) (0.00s) @@ -531,133 +1212,327 @@ gotest -v -race -covermode=atomic ./... --- PASS: ExampleVigenereCipher (0.00s) PASS coverage: 92.1% of statements -ok cipher 0.089s coverage: 92.1% of statements +ok cipher 1.036s coverage: 92.1% of statements -real 0m0.893s -user 0m0.954s -sys 0m0.611s - -=============================================================================== - -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -goos: linux -goarch: amd64 -pkg: cipher -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkEncodeCaesar-4 46074 28353 ns/op 5440 B/op 104 allocs/op -BenchmarkDecodeCaesar-4 1000000 1650 ns/op 184 B/op 12 allocs/op -BenchmarkNewShift-4 42856383 25.17 ns/op 0 B/op 0 allocs/op -BenchmarkEncodeShift-4 23102 51998 ns/op 9571 B/op 185 allocs/op -BenchmarkDecodeShift-4 309681 4083 ns/op 504 B/op 25 allocs/op -BenchmarkNewVigenere-4 13005 82509 ns/op 23604 B/op 345 allocs/op -BenchmarkEncVigenere-4 45820 26012 ns/op 5298 B/op 103 allocs/op -BenchmarkDecVigenere-4 994320 1497 ns/op 160 B/op 13 allocs/op -PASS -ok cipher 13.694s - -real 0m14.245s -user 0m21.001s -sys 0m1.933s - -=============================================================================== - -go test -tags bonus -PASS -ok cipher 0.017s - -real 0m0.495s -user 0m0.542s -sys 0m0.357s +real 0m1.284s +user 0m0.316s +sys 0m0.189s -=============================================================================== -No old benchmarks to run benchstat against. + ============================================================================== -=============================================================================== +Exit code: 0 -go vet ./... -# cipher -./simple_cipher_examples_test.go:5:1: ExampleNormalizeText refers to unknown identifier: NormalizeText -./simple_cipher_examples_test.go:22:1: ExampleFixKey refers to unknown identifier: FixKey -./simple_cipher_examples_test.go:32:1: ExampleCeasarCipher refers to unknown identifier: CeasarCipher -./simple_cipher_examples_test.go:52:1: ExampleShiftCipher refers to unknown identifier: ShiftCipher -./simple_cipher_examples_test.go:72:1: ExampleVigenereCipher refers to unknown identifier: VigenereCipher +real 0m1.649s +user 0m0.730s +sys 0m0.543s -real 0m0.311s -user 0m0.326s -sys 0m0.310s +real 0m1.651s +user 0m0.731s +sys 0m0.544s =============================================================================== -go fix ./... +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -real 0m0.095s -user 0m0.068s -sys 0m0.093s - -=============================================================================== - -gocyclo . -7 cipher BenchmarkDecVigenere simple_cipher_test.go:242:1 -7 cipher BenchmarkEncVigenere simple_cipher_test.go:220:1 -6 cipher NewVigenere simple_cipher.go:94:1 -4 cipher BenchmarkNewVigenere simple_cipher_test.go:209:1 -4 cipher BenchmarkDecodeShift simple_cipher_test.go:194:1 -4 cipher BenchmarkEncodeShift simple_cipher_test.go:179:1 -4 cipher BenchmarkNewShift simple_cipher_test.go:168:1 -4 cipher BenchmarkDecodeCaesar simple_cipher_test.go:155:1 -4 cipher BenchmarkEncodeCaesar simple_cipher_test.go:142:1 -4 cipher testCipher simple_cipher_test.go:42:1 -4 cipher (vigenere).Decode simple_cipher.go:158:1 -4 cipher (vigenere).Encode simple_cipher.go:131:1 -4 cipher (shift).Decode simple_cipher.go:67:1 -4 cipher (shift).Encode simple_cipher.go:40:1 -4 cipher NewShift simple_cipher.go:27:1 -3 cipher TestVigenereWrongKey simple_cipher_test.go:132:1 -3 cipher TestVigenere simple_cipher_test.go:119:1 -3 cipher TestWrongShiftKey simple_cipher_test.go:91:1 -3 cipher TestShift simple_cipher_test.go:70:1 -3 cipher fixKey simple_cipher.go:204:1 -3 cipher normalize simple_cipher.go:184:1 -2 cipher ExampleVigenereCipher simple_cipher_examples_test.go:72:1 -2 cipher ExampleShiftCipher simple_cipher_examples_test.go:52:1 -2 cipher ExampleCeasarCipher simple_cipher_examples_test.go:32:1 -2 cipher ExampleNormalizeText simple_cipher_examples_test.go:5:1 -1 cipher TestCaesar simple_cipher_test.go:32:1 -1 cipher ExampleFixKey simple_cipher_examples_test.go:22:1 -1 cipher NewCaesar simple_cipher.go:18:1 +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +goos: linux +goarch: amd64 +pkg: cipher +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkEncodeCaesar +BenchmarkEncodeCaesar-8 133518 9154 ns/op 5515 B/op 104 allocs/op +BenchmarkDecodeCaesar +BenchmarkDecodeCaesar-8 2185735 547.1 ns/op 184 B/op 12 allocs/op +BenchmarkNewShift +BenchmarkNewShift-8 69165717 20.51 ns/op 0 B/op 0 allocs/op +BenchmarkEncodeShift +BenchmarkEncodeShift-8 64356 18424 ns/op 9694 B/op 185 allocs/op +BenchmarkDecodeShift +BenchmarkDecodeShift-8 855981 1345 ns/op 504 B/op 25 allocs/op +BenchmarkNewVigenere +BenchmarkNewVigenere-8 55738 22226 ns/op 23766 B/op 345 allocs/op +BenchmarkEncVigenere +BenchmarkEncVigenere-8 155208 7620 ns/op 5374 B/op 103 allocs/op +BenchmarkDecVigenere +BenchmarkDecVigenere-8 2421415 499.6 ns/op 160 B/op 13 allocs/op +PASS +ok cipher 12.977s -real 0m0.012s -user 0m0.005s -sys 0m0.009s +real 0m13.124s +user 0m13.493s +sys 0m0.306s =============================================================================== -misspell . +gotest -v -tags bonus +=== RUN TestCaesar +=== RUN TestCaesar/no_extra_symbols +=== RUN TestCaesar/no_extra_symbols/Encode(iamapandabear) +=== RUN TestCaesar/no_extra_symbols/Decode(ldpdsdqgdehdu) +=== RUN TestCaesar/no_extra_symbols/Encode(programmingisawesome) +=== RUN TestCaesar/no_extra_symbols/Decode(surjudpplqjlvdzhvrph) +=== RUN TestCaesar/no_extra_symbols/Encode(todayisholiday) +=== RUN TestCaesar/no_extra_symbols/Decode(wrgdblvkrolgdb) +=== RUN TestCaesar/no_extra_symbols/Encode(venividivici) +=== RUN TestCaesar/no_extra_symbols/Decode(yhqlylglylfl) +=== RUN TestCaesar/with_extra_symbols +=== RUN TestCaesar/with_extra_symbols/Encode(Go,_go,_gophers) +=== RUN TestCaesar/with_extra_symbols/Decode(jrjrjrskhuv) +=== RUN TestCaesar/with_extra_symbols/Encode(I_am_a_panda_bear.) +=== RUN TestCaesar/with_extra_symbols/Decode(ldpdsdqgdehdu) +=== RUN TestCaesar/with_extra_symbols/Encode(Programming_is_AWESOME!) +=== RUN TestCaesar/with_extra_symbols/Decode(surjudpplqjlvdzhvrph) +=== RUN TestCaesar/with_extra_symbols/Encode(today_is_holiday) +=== RUN TestCaesar/with_extra_symbols/Decode(wrgdblvkrolgdb) +=== RUN TestCaesar/with_extra_symbols/Encode(Twas_the_night_before_Christmas) +=== RUN TestCaesar/with_extra_symbols/Decode(wzdvwkhqljkwehiruhfkulvwpdv) +=== RUN TestCaesar/with_extra_symbols/Encode(_--_@#!) +=== RUN TestCaesar/with_extra_symbols/Decode() +=== RUN TestCaesar/with_extra_symbols/Encode() +=== RUN TestCaesar/with_extra_symbols/Decode()#01 +--- PASS: TestCaesar (0.00s) + --- PASS: TestCaesar/no_extra_symbols (0.00s) + --- PASS: TestCaesar/no_extra_symbols/Encode(iamapandabear) (0.00s) + --- PASS: TestCaesar/no_extra_symbols/Decode(ldpdsdqgdehdu) (0.00s) + --- PASS: TestCaesar/no_extra_symbols/Encode(programmingisawesome) (0.00s) + --- PASS: TestCaesar/no_extra_symbols/Decode(surjudpplqjlvdzhvrph) (0.00s) + --- PASS: TestCaesar/no_extra_symbols/Encode(todayisholiday) (0.00s) + --- PASS: TestCaesar/no_extra_symbols/Decode(wrgdblvkrolgdb) (0.00s) + --- PASS: TestCaesar/no_extra_symbols/Encode(venividivici) (0.00s) + --- PASS: TestCaesar/no_extra_symbols/Decode(yhqlylglylfl) (0.00s) + --- PASS: TestCaesar/with_extra_symbols (0.00s) + --- PASS: TestCaesar/with_extra_symbols/Encode(Go,_go,_gophers) (0.00s) + --- PASS: TestCaesar/with_extra_symbols/Decode(jrjrjrskhuv) (0.00s) + --- PASS: TestCaesar/with_extra_symbols/Encode(I_am_a_panda_bear.) (0.00s) + --- PASS: TestCaesar/with_extra_symbols/Decode(ldpdsdqgdehdu) (0.00s) + --- PASS: TestCaesar/with_extra_symbols/Encode(Programming_is_AWESOME!) (0.00s) + --- PASS: TestCaesar/with_extra_symbols/Decode(surjudpplqjlvdzhvrph) (0.00s) + --- PASS: TestCaesar/with_extra_symbols/Encode(today_is_holiday) (0.00s) + --- PASS: TestCaesar/with_extra_symbols/Decode(wrgdblvkrolgdb) (0.00s) + --- PASS: TestCaesar/with_extra_symbols/Encode(Twas_the_night_before_Christmas) (0.00s) + --- PASS: TestCaesar/with_extra_symbols/Decode(wzdvwkhqljkwehiruhfkulvwpdv) (0.00s) + --- PASS: TestCaesar/with_extra_symbols/Encode(_--_@#!) (0.00s) + --- PASS: TestCaesar/with_extra_symbols/Decode() (0.00s) + --- PASS: TestCaesar/with_extra_symbols/Encode() (0.00s) + --- PASS: TestCaesar/with_extra_symbols/Decode()#01 (0.00s) +=== RUN TestShift +=== RUN TestShift/key=3 +=== RUN TestShift/key=3/Encode(Go,_go,_gophers) +=== RUN TestShift/key=3/Decode(jrjrjrskhuv) +=== RUN TestShift/key=3/Encode(I_am_a_panda_bear.) +=== RUN TestShift/key=3/Decode(ldpdsdqgdehdu) +=== RUN TestShift/key=3/Encode(Programming_is_AWESOME!) +=== RUN TestShift/key=3/Decode(surjudpplqjlvdzhvrph) +=== RUN TestShift/key=3/Encode(today_is_holiday) +=== RUN TestShift/key=3/Decode(wrgdblvkrolgdb) +=== RUN TestShift/key=3/Encode(Twas_the_night_before_Christmas) +=== RUN TestShift/key=3/Decode(wzdvwkhqljkwehiruhfkulvwpdv) +=== RUN TestShift/key=3/Encode(_--_@#!) +=== RUN TestShift/key=3/Decode() +=== RUN TestShift/key=3/Encode() +=== RUN TestShift/key=3/Decode()#01 +=== RUN TestShift/key=-3 +=== RUN TestShift/key=-3/Encode(THE_ENEMY_IS_NEAR) +=== RUN TestShift/key=-3/Decode(qebbkbjvfpkbxo) +=== RUN TestShift/key=-3/Encode(SPIES_SEND_SECRET_MESSAGES) +=== RUN TestShift/key=-3/Decode(pmfbppbkapbzobqjbppxdbp) +=== RUN TestShift/key=-3/Encode(THOMAS_JEFFERSON_DESIGNED_A_SUBSTITUTION_CIPHER) +=== RUN TestShift/key=-3/Decode(qeljxpgbccboplkabpfdkbaxprypqfqrqflkzfmebo) +=== RUN TestShift/key=-3/Encode(the_quick_brown_fox_jumps_over_the_lazy_dog) +=== RUN TestShift/key=-3/Decode(qebnrfzhyoltkclugrjmplsboqebixwvald) +--- PASS: TestShift (0.00s) + --- PASS: TestShift/key=3 (0.00s) + --- PASS: TestShift/key=3/Encode(Go,_go,_gophers) (0.00s) + --- PASS: TestShift/key=3/Decode(jrjrjrskhuv) (0.00s) + --- PASS: TestShift/key=3/Encode(I_am_a_panda_bear.) (0.00s) + --- PASS: TestShift/key=3/Decode(ldpdsdqgdehdu) (0.00s) + --- PASS: TestShift/key=3/Encode(Programming_is_AWESOME!) (0.00s) + --- PASS: TestShift/key=3/Decode(surjudpplqjlvdzhvrph) (0.00s) + --- PASS: TestShift/key=3/Encode(today_is_holiday) (0.00s) + --- PASS: TestShift/key=3/Decode(wrgdblvkrolgdb) (0.00s) + --- PASS: TestShift/key=3/Encode(Twas_the_night_before_Christmas) (0.00s) + --- PASS: TestShift/key=3/Decode(wzdvwkhqljkwehiruhfkulvwpdv) (0.00s) + --- PASS: TestShift/key=3/Encode(_--_@#!) (0.00s) + --- PASS: TestShift/key=3/Decode() (0.00s) + --- PASS: TestShift/key=3/Encode() (0.00s) + --- PASS: TestShift/key=3/Decode()#01 (0.00s) + --- PASS: TestShift/key=-3 (0.00s) + --- PASS: TestShift/key=-3/Encode(THE_ENEMY_IS_NEAR) (0.00s) + --- PASS: TestShift/key=-3/Decode(qebbkbjvfpkbxo) (0.00s) + --- PASS: TestShift/key=-3/Encode(SPIES_SEND_SECRET_MESSAGES) (0.00s) + --- PASS: TestShift/key=-3/Decode(pmfbppbkapbzobqjbppxdbp) (0.00s) + --- PASS: TestShift/key=-3/Encode(THOMAS_JEFFERSON_DESIGNED_A_SUBSTITUTION_CIPHER) (0.00s) + --- PASS: TestShift/key=-3/Decode(qeljxpgbccboplkabpfdkbaxprypqfqrqflkzfmebo) (0.00s) + --- PASS: TestShift/key=-3/Encode(the_quick_brown_fox_jumps_over_the_lazy_dog) (0.00s) + --- PASS: TestShift/key=-3/Decode(qebnrfzhyoltkclugrjmplsboqebixwvald) (0.00s) +=== RUN TestWrongShiftKey +--- PASS: TestWrongShiftKey (0.00s) +=== RUN TestVigenere +=== RUN TestVigenere/key=lemon +=== RUN TestVigenere/key=lemon/Encode(ATTACKATDAWN) +=== RUN TestVigenere/key=lemon/Decode(lxfopvefrnhr) +=== RUN TestVigenere/key=abcdefghij +=== RUN TestVigenere/key=abcdefghij/Encode(aaaaaaaaaa) +=== RUN TestVigenere/key=abcdefghij/Decode(abcdefghij) +=== RUN TestVigenere/key=abcdefghij/Encode(zzzzzzzzzz) +=== RUN TestVigenere/key=abcdefghij/Decode(zabcdefghi) +=== RUN TestVigenere/key=iamapandabear +=== RUN TestVigenere/key=iamapandabear/Encode(I_am_a_panda_bear.) +=== RUN TestVigenere/key=iamapandabear/Decode(qayaeaagaciai) +=== RUN TestVigenere/key=duxrceqyaimciuucnelkeoxjhdyduu +=== RUN TestVigenere/key=duxrceqyaimciuucnelkeoxjhdyduu/Encode(Diffie_Hellman) +=== RUN TestVigenere/key=duxrceqyaimciuucnelkeoxjhdyduu/Decode(gccwkixcltycv) +=== RUN TestVigenere/key=qgbvno +=== RUN TestVigenere/key=qgbvno/Encode(cof-FEE,_123!) +=== RUN TestVigenere/key=qgbvno/Decode(sugars) +--- PASS: TestVigenere (0.00s) + --- PASS: TestVigenere/key=lemon (0.00s) + --- PASS: TestVigenere/key=lemon/Encode(ATTACKATDAWN) (0.00s) + --- PASS: TestVigenere/key=lemon/Decode(lxfopvefrnhr) (0.00s) + --- PASS: TestVigenere/key=abcdefghij (0.00s) + --- PASS: TestVigenere/key=abcdefghij/Encode(aaaaaaaaaa) (0.00s) + --- PASS: TestVigenere/key=abcdefghij/Decode(abcdefghij) (0.00s) + --- PASS: TestVigenere/key=abcdefghij/Encode(zzzzzzzzzz) (0.00s) + --- PASS: TestVigenere/key=abcdefghij/Decode(zabcdefghi) (0.00s) + --- PASS: TestVigenere/key=iamapandabear (0.00s) + --- PASS: TestVigenere/key=iamapandabear/Encode(I_am_a_panda_bear.) (0.00s) + --- PASS: TestVigenere/key=iamapandabear/Decode(qayaeaagaciai) (0.00s) + --- PASS: TestVigenere/key=duxrceqyaimciuucnelkeoxjhdyduu (0.00s) + --- PASS: TestVigenere/key=duxrceqyaimciuucnelkeoxjhdyduu/Encode(Diffie_Hellman) (0.00s) + --- PASS: TestVigenere/key=duxrceqyaimciuucnelkeoxjhdyduu/Decode(gccwkixcltycv) (0.00s) + --- PASS: TestVigenere/key=qgbvno (0.00s) + --- PASS: TestVigenere/key=qgbvno/Encode(cof-FEE,_123!) (0.00s) + --- PASS: TestVigenere/key=qgbvno/Decode(sugars) (0.00s) +=== RUN TestVigenereWrongKey +--- PASS: TestVigenereWrongKey (0.00s) +=== RUN ExampleNormalizeText +--- PASS: ExampleNormalizeText (0.00s) +=== RUN ExampleFixKey +--- PASS: ExampleFixKey (0.00s) +=== RUN ExampleCeasarCipher +--- PASS: ExampleCeasarCipher (0.00s) +=== RUN ExampleShiftCipher +--- PASS: ExampleShiftCipher (0.00s) +=== RUN ExampleVigenereCipher +--- PASS: ExampleVigenereCipher (0.00s) +PASS +ok cipher 0.005s -real 0m0.080s -user 0m0.080s -sys 0m0.040s +real 0m0.131s +user 0m0.181s +sys 0m0.132s =============================================================================== -gosec ./... -[gosec] 2022/08/20 18:45:39 Including rules: default -[gosec] 2022/08/20 18:45:39 Excluding rules: default -[gosec] 2022/08/20 18:45:39 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/simple-cipher -2022/08/20 18:45:39 internal error: package "regexp" without types was imported from "command-line-arguments" +benchstat benchstat-old.txt benchstat-new.txt +benchstat-new.txt:5: missing iteration count +benchstat-new.txt:7: missing iteration count +benchstat-new.txt:9: missing iteration count +benchstat-new.txt:11: missing iteration count +benchstat-new.txt:13: missing iteration count +benchstat-new.txt:15: missing iteration count +benchstat-new.txt:17: missing iteration count +benchstat-new.txt:19: missing iteration count +goos: linux +goarch: amd64 +pkg: cipher +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +EncodeCaesar-8 9.154µ ± ∞ ¹ +DecodeCaesar-8 547.1n ± ∞ ¹ +NewShift-8 20.51n ± ∞ ¹ +EncodeShift-8 18.42µ ± ∞ ¹ +DecodeShift-8 1.345µ ± ∞ ¹ +NewVigenere-8 22.23µ ± ∞ ¹ +EncVigenere-8 7.620µ ± ∞ ¹ +DecVigenere-8 499.6n ± ∞ ¹ +geomean 1.957µ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +EncodeCaesar-8 5.386Ki ± ∞ ¹ +DecodeCaesar-8 184.0 ± ∞ ¹ +NewShift-8 0.000 ± ∞ ¹ +EncodeShift-8 9.467Ki ± ∞ ¹ +DecodeShift-8 504.0 ± ∞ ¹ +NewVigenere-8 23.21Ki ± ∞ ¹ +EncVigenere-8 5.248Ki ± ∞ ¹ +DecVigenere-8 160.0 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean + + │ benchstat-new.txt │ + │ allocs/op │ +EncodeCaesar-8 104.0 ± ∞ ¹ +DecodeCaesar-8 12.00 ± ∞ ¹ +NewShift-8 0.000 ± ∞ ¹ +EncodeShift-8 185.0 ± ∞ ¹ +DecodeShift-8 25.00 ± ∞ ¹ +NewVigenere-8 345.0 ± ∞ ¹ +EncVigenere-8 103.0 ± ∞ ¹ +DecVigenere-8 13.00 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean -real 0m0.479s -user 0m0.530s -sys 0m0.527s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +EncodeCaesar-4 28.35µ ± ∞ ¹ +DecodeCaesar-4 1.650µ ± ∞ ¹ +NewShift-4 25.17n ± ∞ ¹ +EncodeShift-4 52.00µ ± ∞ ¹ +DecodeShift-4 4.083µ ± ∞ ¹ +NewVigenere-4 82.51µ ± ∞ ¹ +EncVigenere-4 26.01µ ± ∞ ¹ +DecVigenere-4 1.497µ ± ∞ ¹ +geomean 5.471µ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ B/op │ +EncodeCaesar-4 5.312Ki ± ∞ ¹ +DecodeCaesar-4 184.0 ± ∞ ¹ +NewShift-4 0.000 ± ∞ ¹ +EncodeShift-4 9.347Ki ± ∞ ¹ +DecodeShift-4 504.0 ± ∞ ¹ +NewVigenere-4 23.05Ki ± ∞ ¹ +EncVigenere-4 5.174Ki ± ∞ ¹ +DecVigenere-4 160.0 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean + + │ benchstat-old.txt │ + │ allocs/op │ +EncodeCaesar-4 104.0 ± ∞ ¹ +DecodeCaesar-4 12.00 ± ∞ ¹ +NewShift-4 0.000 ± ∞ ¹ +EncodeShift-4 185.0 ± ∞ ¹ +DecodeShift-4 25.00 ± ∞ ¹ +NewVigenere-4 345.0 ± ∞ ¹ +EncVigenere-4 103.0 ± ∞ ¹ +DecVigenere-4 13.00 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean + +real 0m0.015s +user 0m0.004s +sys 0m0.004s =============================================================================== gomarkdoc --output cipher-doc.md -real 0m0.079s -user 0m0.089s -sys 0m0.031s +real 0m0.010s +user 0m0.008s +sys 0m0.002s =============================================================================== @@ -684,9 +1559,9 @@ func NewVigenere(key string) Cipher NewVigenere returns a Cipher. -real 0m0.191s -user 0m0.083s -sys 0m0.194s +real 0m0.037s +user 0m0.020s +sys 0m0.031s =============================================================================== diff --git a/go/simple-linked-list/benchstat-new.txt b/go/simple-linked-list/benchstat-new.txt index 462322ce..f87e18dd 100644 --- a/go/simple-linked-list/benchstat-new.txt +++ b/go/simple-linked-list/benchstat-new.txt @@ -1,18 +1,18 @@ goos: linux goarch: amd64 pkg: linkedlist -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkNewList -BenchmarkNewList-4 1411635 875.7 ns/op 192 B/op 11 allocs/op +BenchmarkNewList-8 2568748 475.7 ns/op 192 B/op 11 allocs/op BenchmarkListSize -BenchmarkListSize-4 1000000000 0.4249 ns/op 0 B/op 0 allocs/op +BenchmarkListSize-8 1000000000 0.2539 ns/op 0 B/op 0 allocs/op BenchmarkListPush -BenchmarkListPush-4 10000 109892 ns/op 16000 B/op 1000 allocs/op +BenchmarkListPush-8 28504 38174 ns/op 16000 B/op 1000 allocs/op BenchmarkListPop -BenchmarkListPop-4 608 1999668 ns/op 0 B/op 0 allocs/op +BenchmarkListPop-8 1024 1203566 ns/op 0 B/op 0 allocs/op BenchmarkListToArray -BenchmarkListToArray-4 294727376 4.008 ns/op 0 B/op 0 allocs/op +BenchmarkListToArray-8 860650098 1.389 ns/op 0 B/op 0 allocs/op BenchmarkListReverse -BenchmarkListReverse-4 13296807 108.0 ns/op 32 B/op 1 allocs/op +BenchmarkListReverse-8 35884407 34.56 ns/op 32 B/op 1 allocs/op PASS -ok linkedlist 11.072s +ok linkedlist 8.381s diff --git a/go/simple-linked-list/benchstat-old.txt b/go/simple-linked-list/benchstat-old.txt new file mode 100644 index 00000000..462322ce --- /dev/null +++ b/go/simple-linked-list/benchstat-old.txt @@ -0,0 +1,18 @@ +goos: linux +goarch: amd64 +pkg: linkedlist +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkNewList +BenchmarkNewList-4 1411635 875.7 ns/op 192 B/op 11 allocs/op +BenchmarkListSize +BenchmarkListSize-4 1000000000 0.4249 ns/op 0 B/op 0 allocs/op +BenchmarkListPush +BenchmarkListPush-4 10000 109892 ns/op 16000 B/op 1000 allocs/op +BenchmarkListPop +BenchmarkListPop-4 608 1999668 ns/op 0 B/op 0 allocs/op +BenchmarkListToArray +BenchmarkListToArray-4 294727376 4.008 ns/op 0 B/op 0 allocs/op +BenchmarkListReverse +BenchmarkListReverse-4 13296807 108.0 ns/op 32 B/op 1 allocs/op +PASS +ok linkedlist 11.072s diff --git a/go/simple-linked-list/coverage.out b/go/simple-linked-list/coverage.out index dfc0817f..1f183a99 100644 --- a/go/simple-linked-list/coverage.out +++ b/go/simple-linked-list/coverage.out @@ -1,36 +1,36 @@ mode: count linkedlist/simple_linked_list.go:21.29,29.21 2 27 -linkedlist/simple_linked_list.go:33.2,33.26 1 16 -linkedlist/simple_linked_list.go:37.2,37.13 1 16 linkedlist/simple_linked_list.go:29.21,31.3 1 11 +linkedlist/simple_linked_list.go:33.2,33.26 1 16 linkedlist/simple_linked_list.go:33.26,35.3 1 60 +linkedlist/simple_linked_list.go:37.2,37.13 1 16 linkedlist/simple_linked_list.go:41.27,43.2 1 56 linkedlist/simple_linked_list.go:46.32,47.36 1 62 -linkedlist/simple_linked_list.go:51.2,54.13 3 61 linkedlist/simple_linked_list.go:47.36,49.3 1 1 +linkedlist/simple_linked_list.go:51.2,54.13 3 61 linkedlist/simple_linked_list.go:58.31,64.9 2 74 -linkedlist/simple_linked_list.go:75.2,75.10 1 74 linkedlist/simple_linked_list.go:65.21,68.18 3 20 linkedlist/simple_linked_list.go:69.10,72.20 3 54 +linkedlist/simple_linked_list.go:75.2,75.10 1 74 linkedlist/simple_linked_list.go:79.24,84.2 4 2 linkedlist/simple_linked_list.go:87.35,88.19 1 13 -linkedlist/simple_linked_list.go:92.2,92.19 1 11 -linkedlist/simple_linked_list.go:99.2,101.20 2 9 -linkedlist/simple_linked_list.go:108.2,114.18 6 9 linkedlist/simple_linked_list.go:88.19,90.3 1 2 +linkedlist/simple_linked_list.go:92.2,92.19 1 11 linkedlist/simple_linked_list.go:92.19,97.3 3 2 +linkedlist/simple_linked_list.go:99.2,101.20 2 9 linkedlist/simple_linked_list.go:101.20,102.25 1 20 -linkedlist/simple_linked_list.go:105.3,105.15 1 11 linkedlist/simple_linked_list.go:102.25,103.9 1 9 +linkedlist/simple_linked_list.go:105.3,105.15 1 11 +linkedlist/simple_linked_list.go:108.2,114.18 6 9 linkedlist/simple_linked_list.go:118.30,119.19 1 15 -linkedlist/simple_linked_list.go:123.2,127.14 3 11 -linkedlist/simple_linked_list.go:135.2,135.14 1 11 linkedlist/simple_linked_list.go:119.19,121.3 1 4 +linkedlist/simple_linked_list.go:123.2,127.14 3 11 linkedlist/simple_linked_list.go:127.14,128.21 1 11 -linkedlist/simple_linked_list.go:132.3,132.32 1 11 linkedlist/simple_linked_list.go:128.21,131.4 2 25 +linkedlist/simple_linked_list.go:132.3,132.32 1 11 +linkedlist/simple_linked_list.go:135.2,135.14 1 11 linkedlist/simple_linked_list.go:139.32,140.19 1 4 -linkedlist/simple_linked_list.go:144.2,147.24 3 2 -linkedlist/simple_linked_list.go:151.2,153.14 2 2 linkedlist/simple_linked_list.go:140.19,142.3 1 2 +linkedlist/simple_linked_list.go:144.2,147.24 3 2 linkedlist/simple_linked_list.go:147.24,149.3 1 8 +linkedlist/simple_linked_list.go:151.2,153.14 2 2 diff --git a/go/simple-linked-list/run-tests-go.txt b/go/simple-linked-list/run-tests-go.txt index 03cec2db..f8564a7e 100644 --- a/go/simple-linked-list/run-tests-go.txt +++ b/go/simple-linked-list/run-tests-go.txt @@ -5,86 +5,564 @@ Go packages: linkedlist =============================================================================== -golangci-lint run ./... +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.010s +sys 0m0.016s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " simple_linked_list_test.go:134:10: Error return value of `list.Pop` is not checked (errcheck) list.Pop() ^ simple_linked_list_test.go:137:10: Error return value of `list.Pop` is not checked (errcheck) list.Pop() ^ - -real 0m9.112s -user 0m18.678s -sys 0m3.623s +simple_linked_list.go:105:3: assignments should only be cuddled with other assignments (wsl) + e = l.Next() + ^ +simple_linked_list.go:132:3: append only allowed to cuddle with appended value (wsl) + slice = append(slice, e.data) + ^ +simple_linked_list_examples_test.go:41:3: assignments should only be cuddled with other assignments (wsl) + n = list.Next() + ^ +simple_linked_list_test.go:15:2: assignments should only be cuddled with other assignments (wsl) + list = New(nil) + ^ +simple_linked_list_test.go:16:2: only one cuddle assignment allowed before if statement (wsl) + if size := list.Size(); size != 0 { + ^ +simple_linked_list_test.go:65:2: only one cuddle assignment allowed before if statement (wsl) + if array := list.Array(); len(array) != 0 { + ^ +simple_linked_list_test.go:74:2: only one cuddle assignment allowed before if statement (wsl) + if !reflect.DeepEqual(array, expected) { + ^ +simple_linked_list_test.go:96:2: if statements should only be cuddled with assignments (wsl) + if elem != 3 { + ^ +simple_linked_list_test.go:170:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +simple_linked_list_test.go:180:2: only cuddled expressions if assigning variable or using from line above (wsl) + b.ResetTimer() + ^ +simple_linked_list_test.go:181:2: only one cuddle assignment allowed before for statement (wsl) + for i := 0; i < b.N; i++ { + ^ +simple_linked_list_test.go:193:3: only cuddled expressions if assigning variable or using from line above (wsl) + b.StartTimer() + ^ +simple_linked_list_test.go:194:3: only one cuddle assignment allowed before for statement (wsl) + for k := 0; k < 1000; k++ { + ^ +simple_linked_list_test.go:190:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +simple_linked_list_test.go:207:3: only one cuddle assignment allowed before for statement (wsl) + for k := 0; k < 1000; k++ { + ^ +simple_linked_list_test.go:204:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +simple_linked_list_test.go:222:2: only cuddled expressions if assigning variable or using from line above (wsl) + b.ResetTimer() + ^ +simple_linked_list.go:141:11: head, tail, curr, size are missing in List (exhaustivestruct) + return &List{} + ^ +simple_linked_list_test.go:8:5: array1To10 is a global variable (gochecknoglobals) +var array1To10 = []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} + ^ +simple_linked_list.go:89:13: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"can't pop an element from an empty list\")" (goerr113) + return 0, errors.New("can't pop an element from an empty list") + ^ +simple_linked_list.go:125:2: variable 'e' is only used in the if-statement (simple_linked_list.go:127:2); consider using short syntax (ifshort) + e := l.Next() + ^ +simple_linked_list_test.go:73:2: variable 'array' is only used in the if-statement (simple_linked_list_test.go:74:2); consider using short syntax (ifshort) + array := list.Array() + ^ +simple_linked_list_test.go:100:2: variable 'expected' is only used in the if-statement (simple_linked_list_test.go:101:2); consider using short syntax (ifshort) + expected := []int{1, 2} + ^ +simple_linked_list_test.go:125:2: variable 'actual' is only used in the if-statement (simple_linked_list_test.go:127:2); consider using short syntax (ifshort) + actual := list.Array() + ^ +simple_linked_list_test.go:126:2: variable 'expected' is only used in the if-statement (simple_linked_list_test.go:127:2); consider using short syntax (ifshort) + expected := []int{1, 2, 3, 4} + ^ +simple_linked_list_test.go:139:2: variable 'actual' is only used in the if-statement (simple_linked_list_test.go:141:2); consider using short syntax (ifshort) + actual := list.Array() + ^ +simple_linked_list_test.go:140:2: variable 'expected' is only used in the if-statement (simple_linked_list_test.go:141:2); consider using short syntax (ifshort) + expected := []int{1, 2, 4, 6} + ^ +simple_linked_list_test.go:160:2: variable 'expected' is only used in the if-statement (simple_linked_list_test.go:161:2); consider using short syntax (ifshort) + expected := []int{3, 2, 1} + ^ +simple_linked_list_examples_test.go:5:6: ExampleList_new contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleList_new() { + ^ +simple_linked_list_examples_test.go:20:6: ExampleList_size contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleList_size() { + ^ +simple_linked_list_examples_test.go:31:6: ExampleList_next contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleList_next() { + ^ +simple_linked_list_examples_test.go:52:6: ExampleList_push contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleList_push() { + ^ +simple_linked_list_examples_test.go:86:6: ExampleList_pop contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleList_pop() { + ^ +simple_linked_list_examples_test.go:126:6: ExampleList_array contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleList_array() { + ^ +simple_linked_list_examples_test.go:138:6: ExampleList_reverse contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleList_reverse() { + ^ +simple_linked_list_test.go:10:1: Function TestEmptyListHasSizeZero missing the call to method parallel (paralleltest) +func TestEmptyListHasSizeZero(t *testing.T) { +^ +simple_linked_list_test.go:21:1: Function TestSingletonListHasSizeOne missing the call to method parallel (paralleltest) +func TestSingletonListHasSizeOne(t *testing.T) { +^ +simple_linked_list_test.go:28:1: Function TestNonEmptyListHasCorrectSize missing the call to method parallel (paralleltest) +func TestNonEmptyListHasCorrectSize(t *testing.T) { +^ +simple_linked_list_test.go:35:1: Function TestListHasCorrectSizeAfterPop missing the call to method parallel (paralleltest) +func TestListHasCorrectSizeAfterPop(t *testing.T) { +^ +simple_linked_list_test.go:47:1: Function TestListHasCorrectSizeAfterPush missing the call to method parallel (paralleltest) +func TestListHasCorrectSizeAfterPush(t *testing.T) { +^ +simple_linked_list_test.go:59:1: Function TestEmptyListToEmptyArray missing the call to method parallel (paralleltest) +func TestEmptyListToEmptyArray(t *testing.T) { +^ +simple_linked_list_test.go:70:1: Function TestNonEmptyListToArray missing the call to method parallel (paralleltest) +func TestNonEmptyListToArray(t *testing.T) { +^ +simple_linked_list_test.go:79:1: Function TestPopFromEmptyList missing the call to method parallel (paralleltest) +func TestPopFromEmptyList(t *testing.T) { +^ +simple_linked_list_test.go:90:1: Function TestPopFromNonEmptyList missing the call to method parallel (paralleltest) +func TestPopFromNonEmptyList(t *testing.T) { +^ +simple_linked_list_test.go:106:1: Function TestPushToEmptyList missing the call to method parallel (paralleltest) +func TestPushToEmptyList(t *testing.T) { +^ +simple_linked_list_test.go:122:1: Function TestPushToNonEmptyList missing the call to method parallel (paralleltest) +func TestPushToNonEmptyList(t *testing.T) { +^ +simple_linked_list_test.go:132:1: Function TestPushAndPop missing the call to method parallel (paralleltest) +func TestPushAndPop(t *testing.T) { +^ +simple_linked_list_test.go:146:1: Function TestReverseEmptyList missing the call to method parallel (paralleltest) +func TestReverseEmptyList(t *testing.T) { +^ +simple_linked_list_test.go:157:1: Function TestReverseNonEmptyList missing the call to method parallel (paralleltest) +func TestReverseNonEmptyList(t *testing.T) { +^ +simple_linked_list_examples_test.go:1:9: package should be `linkedlist_test` instead of `linkedlist` (testpackage) +package linkedlist + ^ +simple_linked_list_test.go:1:9: package should be `linkedlist_test` instead of `linkedlist` (testpackage) +package linkedlist + ^ +simple_linked_list_examples_test.go:93:2: variable name 'd' is too short for the scope of its usage (varnamelen) + d, e := list.Pop() + ^ +simple_linked_list.go:99:2: variable name 'e' is too short for the scope of its usage (varnamelen) + e := l.Next() + ^ +simple_linked_list_examples_test.go:53:2: variable name 'l1' is too short for the scope of its usage (varnamelen) + l1 := List{ + ^ + +real 0m0.549s +user 0m0.878s +sys 0m0.517s + + + ============================================================================== + +Exit code: -1 + +real 0m0.582s +user 0m0.894s +sys 0m0.544s + +real 0m0.584s +user 0m0.895s +sys 0m0.546s =============================================================================== -golint ./... +Running: ../../.github/citools/go/go-lint-revive -real 0m0.116s -user 0m0.117s -sys 0m0.074s +Running Go Lint Revive -=============================================================================== +Go version: -revive -formatter=stylish ./... + go version go1.21.0 linux/amd64 -real 0m0.062s -user 0m0.054s -sys 0m0.037s + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.014s +sys 0m0.018s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.064s +user 0m0.037s +sys 0m0.043s + + + ============================================================================== + +Exit code: 0 + +real 0m0.101s +user 0m0.059s +sys 0m0.068s + +real 0m0.103s +user 0m0.061s +sys 0m0.069s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.318s -user 0m0.326s -sys 0m0.329s +real 0m0.001s +user 0m0.000s +sys 0m0.000s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.012s +sys 0m0.014s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." +internal error: package "errors" without types was imported from "linkedlist" + +real 0m0.090s +user 0m0.139s +sys 0m0.098s -real 0m0.425s -user 0m0.501s -sys 0m0.414s + + ============================================================================== + +Exit code: -1 + +real 0m0.124s +user 0m0.155s +sys 0m0.123s + +real 0m0.126s +user 0m0.155s +sys 0m0.125s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.009s +sys 0m0.015s + + + ============================================================================== + +Running: staticcheck -checks=all ./... -real 0m0.451s -user 0m0.461s -sys 0m0.459s + +real 0m0.179s +user 0m0.216s +sys 0m0.132s + + + ============================================================================== + +Exit code: 0 + +real 0m0.208s +user 0m0.233s +sys 0m0.155s + +real 0m0.209s +user 0m0.233s +sys 0m0.156s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.011s +sys 0m0.015s + -real 0m2.685s -user 0m4.607s -sys 0m1.238s + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.844s +user 0m2.121s +sys 0m0.263s + + + ============================================================================== + +Exit code: 0 + +real 0m0.876s +user 0m2.138s +sys 0m0.288s + +real 0m0.879s +user 0m2.138s +sys 0m0.290s =============================================================================== -go vet ./... +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + -real 0m0.303s -user 0m0.335s -sys 0m0.259s +real 0m0.023s +user 0m0.013s +sys 0m0.016s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.074s +user 0m0.105s +sys 0m0.098s + + + ============================================================================== + +Exit code: 0 + +real 0m0.112s +user 0m0.126s +sys 0m0.124s + +real 0m0.114s +user 0m0.128s +sys 0m0.124s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.010s +sys 0m0.013s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.034s +user 0m0.022s +sys 0m0.021s + + + ============================================================================== + +Exit code: 0 + +real 0m0.062s +user 0m0.034s +sys 0m0.046s -real 0m0.098s -user 0m0.048s -sys 0m0.103s +real 0m0.064s +user 0m0.034s +sys 0m0.047s =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.040s +user 0m0.021s +sys 0m0.035s + + + ============================================================================== + +Running: errcheck ./... + +simple_linked_list_test.go:134:10: list.Pop() +simple_linked_list_test.go:137:10: list.Pop() + +real 0m0.537s +user 0m1.672s +sys 0m0.329s + + + ============================================================================== + +Exit code: -1 + +real 0m0.597s +user 0m1.701s +sys 0m0.382s + +real 0m0.600s +user 0m1.704s +sys 0m0.383s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.015s +sys 0m0.018s + + + ============================================================================== + +Running: gocyclo . + 5 linkedlist BenchmarkListPop simple_linked_list_test.go:200:1 5 linkedlist (*List).Pop simple_linked_list.go:87:1 4 linkedlist BenchmarkListPush simple_linked_list_test.go:186:1 @@ -121,33 +599,139 @@ gocyclo . 1 linkedlist (*List).Reset simple_linked_list.go:79:1 1 linkedlist (*List).Size simple_linked_list.go:41:1 -real 0m0.025s -user 0m0.012s -sys 0m0.013s +real 0m0.002s +user 0m0.000s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.040s +user 0m0.023s +sys 0m0.027s + +real 0m0.042s +user 0m0.023s +sys 0m0.029s =============================================================================== -misspell . +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 -real 0m0.122s -user 0m0.171s -sys 0m0.087s + + ============================================================================== + +Running: misspell . + + +real 0m0.030s +user 0m0.036s +sys 0m0.014s + + + ============================================================================== + +Exit code: 0 + +real 0m0.042s +user 0m0.043s +sys 0m0.023s + +real 0m0.044s +user 0m0.043s +sys 0m0.025s =============================================================================== -gosec ./... -[gosec] 2022/09/17 15:21:13 Including rules: default -[gosec] 2022/09/17 15:21:13 Excluding rules: default -[gosec] 2022/09/17 15:21:13 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/simple-linked-list -2022/09/17 15:21:14 internal error: package "errors" without types was imported from "command-line-arguments" +Running: ../../.github/citools/go/go-lint-gosec -real 0m0.497s -user 0m0.390s -sys 0m0.382s +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.021s +sys 0m0.022s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:30:53 Including rules: default +[gosec] 2023/09/07 00:30:53 Excluding rules: default +[gosec] 2023/09/07 00:30:53 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/simple-linked-list +[gosec] 2023/09/07 00:30:53 Checking package: linkedlist +[gosec] 2023/09/07 00:30:53 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/simple-linked-list/simple_linked_list.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 154 + Nosec : 0 + Issues : 0 + + +real 0m0.127s +user 0m0.123s +sys 0m0.100s + + + ============================================================================== + +Exit code: 0 + +real 0m0.177s +user 0m0.152s +sys 0m0.137s + +real 0m0.180s +user 0m0.152s +sys 0m0.139s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.016s +sys 0m0.018s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestEmptyListHasSizeZero --- PASS: TestEmptyListHasSizeZero (0.00s) === RUN TestSingletonListHasSizeOne @@ -192,15 +776,17 @@ gotest -v -covermode=count -coverprofile coverage.out ./... --- PASS: ExampleList_reverse (0.00s) PASS coverage: 100.0% of statements -ok linkedlist 0.013s coverage: 100.0% of statements +ok linkedlist 0.003s coverage: 100.0% of statements -real 0m0.776s -user 0m0.970s -sys 0m0.552s +real 0m0.201s +user 0m0.281s +sys 0m0.186s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + linkedlist/simple_linked_list.go:21: New 100.0% linkedlist/simple_linked_list.go:41: Size 100.0% linkedlist/simple_linked_list.go:46: Next 100.0% @@ -211,29 +797,40 @@ linkedlist/simple_linked_list.go:118: Array 100.0% linkedlist/simple_linked_list.go:139: Reverse 100.0% total: (statements) 100.0% -real 0m0.219s -user 0m0.196s -sys 0m0.241s +real 0m0.042s +user 0m0.038s +sys 0m0.047s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.157s -user 0m0.118s -sys 0m0.159s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +real 0m0.045s +user 0m0.034s +sys 0m0.053s -real 0m0.061s -user 0m0.037s -sys 0m0.057s -=============================================================================== + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.014s +user 0m0.008s +sys 0m0.013s + +real 0m0.014s +user 0m0.008s +sys 0m0.013s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestEmptyListHasSizeZero --- PASS: TestEmptyListHasSizeZero (0.00s) === RUN TestSingletonListHasSizeOne @@ -271,44 +868,60 @@ gotest -v -race -covermode=atomic ./... === RUN ExampleList_push --- PASS: ExampleList_push (0.00s) === RUN ExampleList_pop ---- PASS: ExampleList_pop (0.01s) +--- PASS: ExampleList_pop (0.00s) === RUN ExampleList_array --- PASS: ExampleList_array (0.00s) === RUN ExampleList_reverse --- PASS: ExampleList_reverse (0.00s) PASS coverage: 100.0% of statements -ok linkedlist (cached) coverage: 100.0% of statements +ok linkedlist 1.014s coverage: 100.0% of statements -real 0m0.343s -user 0m0.363s -sys 0m0.340s +real 0m1.286s +user 0m0.328s +sys 0m0.182s + + + ============================================================================== + +Exit code: 0 + +real 0m1.623s +user 0m0.712s +sys 0m0.512s + +real 0m1.625s +user 0m0.713s +sys 0m0.514s =============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: linkedlist -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkNewList -BenchmarkNewList-4 1411635 875.7 ns/op 192 B/op 11 allocs/op +BenchmarkNewList-8 2568748 475.7 ns/op 192 B/op 11 allocs/op BenchmarkListSize -BenchmarkListSize-4 1000000000 0.4249 ns/op 0 B/op 0 allocs/op +BenchmarkListSize-8 1000000000 0.2539 ns/op 0 B/op 0 allocs/op BenchmarkListPush -BenchmarkListPush-4 10000 109892 ns/op 16000 B/op 1000 allocs/op +BenchmarkListPush-8 28504 38174 ns/op 16000 B/op 1000 allocs/op BenchmarkListPop -BenchmarkListPop-4 608 1999668 ns/op 0 B/op 0 allocs/op +BenchmarkListPop-8 1024 1203566 ns/op 0 B/op 0 allocs/op BenchmarkListToArray -BenchmarkListToArray-4 294727376 4.008 ns/op 0 B/op 0 allocs/op +BenchmarkListToArray-8 860650098 1.389 ns/op 0 B/op 0 allocs/op BenchmarkListReverse -BenchmarkListReverse-4 13296807 108.0 ns/op 32 B/op 1 allocs/op +BenchmarkListReverse-8 35884407 34.56 ns/op 32 B/op 1 allocs/op PASS -ok linkedlist 11.072s +ok linkedlist 8.381s -real 0m11.635s -user 0m13.790s -sys 0m1.802s +real 0m8.607s +user 0m8.651s +sys 0m0.697s =============================================================================== @@ -356,23 +969,113 @@ gotest -v -tags bonus === RUN ExampleList_reverse --- PASS: ExampleList_reverse (0.00s) PASS -ok linkedlist 0.006s +ok linkedlist 0.003s -real 0m0.514s -user 0m0.591s -sys 0m0.437s +real 0m0.135s +user 0m0.198s +sys 0m0.125s =============================================================================== -No old benchmarks to run benchstat against. +benchstat benchstat-old.txt benchstat-new.txt +benchstat-old.txt:5: missing iteration count +benchstat-old.txt:7: missing iteration count +benchstat-old.txt:9: missing iteration count +benchstat-old.txt:11: missing iteration count +benchstat-old.txt:13: missing iteration count +benchstat-old.txt:15: missing iteration count +benchstat-new.txt:5: missing iteration count +benchstat-new.txt:7: missing iteration count +benchstat-new.txt:9: missing iteration count +benchstat-new.txt:11: missing iteration count +benchstat-new.txt:13: missing iteration count +benchstat-new.txt:15: missing iteration count +goos: linux +goarch: amd64 +pkg: linkedlist +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +NewList-8 475.7n ± ∞ ¹ +ListSize-8 0.2539n ± ∞ ¹ +ListPush-8 38.17µ ± ∞ ¹ +ListPop-8 1.204m ± ∞ ¹ +ListToArray-8 1.389n ± ∞ ¹ +ListReverse-8 34.56n ± ∞ ¹ +geomean 253.7n +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +NewList-8 192.0 ± ∞ ¹ +ListSize-8 0.000 ± ∞ ¹ +ListPush-8 15.62Ki ± ∞ ¹ +ListPop-8 0.000 ± ∞ ¹ +ListToArray-8 0.000 ± ∞ ¹ +ListReverse-8 32.00 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean + + │ benchstat-new.txt │ + │ allocs/op │ +NewList-8 11.00 ± ∞ ¹ +ListSize-8 0.000 ± ∞ ¹ +ListPush-8 1.000k ± ∞ ¹ +ListPop-8 0.000 ± ∞ ¹ +ListToArray-8 0.000 ± ∞ ¹ +ListReverse-8 1.000 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean + +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +NewList-4 875.7n ± ∞ ¹ +ListSize-4 0.4249n ± ∞ ¹ +ListPush-4 109.9µ ± ∞ ¹ +ListPop-4 2.000m ± ∞ ¹ +ListToArray-4 4.008n ± ∞ ¹ +ListReverse-4 108.0n ± ∞ ¹ +geomean 573.0n +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ B/op │ +NewList-4 192.0 ± ∞ ¹ +ListSize-4 0.000 ± ∞ ¹ +ListPush-4 15.62Ki ± ∞ ¹ +ListPop-4 0.000 ± ∞ ¹ +ListToArray-4 0.000 ± ∞ ¹ +ListReverse-4 32.00 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean + + │ benchstat-old.txt │ + │ allocs/op │ +NewList-4 11.00 ± ∞ ¹ +ListSize-4 0.000 ± ∞ ¹ +ListPush-4 1.000k ± ∞ ¹ +ListPop-4 0.000 ± ∞ ¹ +ListToArray-4 0.000 ± ∞ ¹ +ListReverse-4 1.000 ± ∞ ¹ +geomean ² +¹ need >= 6 samples for confidence interval at level 0.95 +² summaries must be >0 to compute geomean + +real 0m0.003s +user 0m0.001s +sys 0m0.002s =============================================================================== gomarkdoc --output linkedlist-doc.md -real 0m0.041s -user 0m0.025s -sys 0m0.021s +real 0m0.013s +user 0m0.005s +sys 0m0.008s =============================================================================== @@ -419,9 +1122,9 @@ func (l *List) Size() int Size returns the size of the list. -real 0m0.180s -user 0m0.102s -sys 0m0.136s +real 0m0.043s +user 0m0.016s +sys 0m0.042s =============================================================================== diff --git a/go/sorting-room/benchstat-new.txt b/go/sorting-room/benchstat-new.txt new file mode 100644 index 00000000..515e0d1e --- /dev/null +++ b/go/sorting-room/benchstat-new.txt @@ -0,0 +1,2 @@ +PASS +ok sorting 0.002s diff --git a/go/sorting-room/coverage-annotations.txt b/go/sorting-room/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/sorting-room/coverage.html b/go/sorting-room/coverage.html new file mode 100644 index 00000000..b20b5274 --- /dev/null +++ b/go/sorting-room/coverage.html @@ -0,0 +1,192 @@ + + + + + + sorting: Go Coverage Report + + + +

+ +
+ not tracked + + no coverage + low coverage + * + * + * + * + * + * + * + * + high coverage + +
+
+
+ + + +
+ + + diff --git a/go/sorting-room/coverage.out b/go/sorting-room/coverage.out index 9b83579a..5ae30767 100644 --- a/go/sorting-room/coverage.out +++ b/go/sorting-room/coverage.out @@ -3,10 +3,10 @@ sorting/sorting_room.go:9.39,12.2 2 7 sorting/sorting_room.go:20.45,23.2 2 4 sorting/sorting_room.go:31.37,33.2 1 9 sorting/sorting_room.go:42.49,45.25 2 13 -sorting/sorting_room.go:50.2,52.14 2 13 -sorting/sorting_room.go:56.2,56.10 1 8 sorting/sorting_room.go:46.19,47.16 1 9 +sorting/sorting_room.go:50.2,52.14 2 13 sorting/sorting_room.go:52.14,54.3 1 5 +sorting/sorting_room.go:56.2,56.10 1 8 sorting/sorting_room.go:60.56,64.2 2 8 sorting/sorting_room.go:67.45,68.23 1 7 sorting/sorting_room.go:69.11,70.36 1 1 diff --git a/go/sorting-room/run-tests-go.txt b/go/sorting-room/run-tests-go.txt index c5159536..eefacfa3 100644 --- a/go/sorting-room/run-tests-go.txt +++ b/go/sorting-room/run-tests-go.txt @@ -5,15 +5,622 @@ Go packages: sorting =============================================================================== -golint sorting +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.022s +sys 0m0.037s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +sorting_room.go:45:2: singleCaseSwitch: should rewrite switch statement to if statement (gocritic) + switch t := fnb.(type) { + ^ +sorting_room.go:61:8: var-declaration: should omit type float64 from declaration of var f; it will be inferred from the right-hand side (revive) + var f float64 = float64(ExtractFancyNumber(fnb)) + ^ +sorting_room_test.go:34:29: Using the variable on range scope `test` in function literal (scopelint) + if got := DescribeNumber(test.input); got != test.want { + ^ +sorting_room_test.go:35:50: Using the variable on range scope `test` in function literal (scopelint) + t.Errorf("DescribeNumber(%v) = %v; want %v", test.input, got, test.want) + ^ +sorting_room_test.go:68:32: Using the variable on range scope `test` in function literal (scopelint) + if got := DescribeNumberBox(test.input); got != test.want { + ^ +sorting_room.go:11:2: return with no blank line before (nlreturn) + return fmt.Sprintf("%s %.1f", str, f) + ^ +sorting_room.go:22:2: return with no blank line before (nlreturn) + return fmt.Sprintf("%s %.1f", str, float64(nb.Number())) + ^ +sorting_room_test.go:5:1: Function TestDescribeNumber missing the call to method parallel (paralleltest) +func TestDescribeNumber(t *testing.T) { +^ +sorting_room_test.go:32:2: Range statement for test TestDescribeNumber missing the call to method parallel in test Run (paralleltest) + for _, test := range tests { + ^ +sorting_room_test.go:49:1: Function TestDescribeNumberBox missing the call to method parallel (paralleltest) +func TestDescribeNumberBox(t *testing.T) { +^ +sorting_room_test.go:66:2: Range statement for test TestDescribeNumberBox missing the call to method parallel in test Run (paralleltest) + for _, test := range tests { + ^ +sorting_room_test.go:83:1: Function TestExtractFancyNumber missing the call to method parallel (paralleltest) +func TestExtractFancyNumber(t *testing.T) { +^ +sorting_room_test.go:110:2: Range statement for test TestExtractFancyNumber missing the call to method parallel in test Run (paralleltest) + for _, test := range tests { + ^ +sorting_room_test.go:119:1: Function TestDescribeFancyNumberBox missing the call to method parallel (paralleltest) +func TestDescribeFancyNumberBox(t *testing.T) { +^ +sorting_room_test.go:146:2: Range statement for test TestDescribeFancyNumberBox missing the call to method parallel in test Run (paralleltest) + for _, test := range tests { + ^ +sorting_room_test.go:155:1: Function TestDescribeAnything missing the call to method parallel (paralleltest) +func TestDescribeAnything(t *testing.T) { +^ +sorting_room_test.go:192:2: Range statement for test TestDescribeAnything missing the call to method parallel in test Run (paralleltest) + for _, test := range tests { + ^ +sorting_room_examples_test.go:1:9: package should be `sorting_test` instead of `sorting` (testpackage) +package sorting + ^ +sorting_room_test.go:1:9: package should be `sorting_test` instead of `sorting` (testpackage) +package sorting + ^ +sorting_room.go:50:2: variable name 'i' is too short for the scope of its usage (varnamelen) + i, e := strconv.Atoi(s) + ^ +sorting_room.go:43:6: variable name 's' is too short for the scope of its usage (varnamelen) + var s string + ^ +sorting_room.go:68:9: variable name 'v' is too short for the scope of its usage (varnamelen) + switch v := i.(type) { + ^ + +real 0m0.512s +user 0m0.717s +sys 0m0.488s + + + ============================================================================== + +Exit code: -1 + +real 0m0.558s +user 0m0.748s +sys 0m0.533s + +real 0m0.560s +user 0m0.748s +sys 0m0.535s -real 0m0.172s -user 0m0.203s -sys 0m0.159s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.020s +sys 0m0.040s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +sorting_room.go + (61, 8) https://revive.run/r#var-declaration should omit type float64 from declaration of var f; it will be inferred from the right-hand side + (1, 1) https://revive.run/r#package-comments should have a package comment + + + ✖ 2 problems (0 errors) (2 warnings) + +real 0m0.053s +user 0m0.028s +sys 0m0.043s + + + ============================================================================== + +Exit code: 0 + +real 0m0.092s +user 0m0.050s +sys 0m0.095s + +real 0m0.094s +user 0m0.053s +sys 0m0.095s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.035s +sys 0m0.026s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "sorting" + +real 0m0.096s +user 0m0.122s +sys 0m0.131s + + + ============================================================================== + +Exit code: -1 + +real 0m0.142s +user 0m0.167s +sys 0m0.169s + +real 0m0.144s +user 0m0.168s +sys 0m0.171s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.020s +sys 0m0.027s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +sorting_room.go:1:1: at least one file in a package should have a package comment (ST1000) +sorting_room.go:61:8: should omit type float64 from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.173s +user 0m0.213s +sys 0m0.095s + + + ============================================================================== + +Exit code: -1 + +real 0m0.208s +user 0m0.239s +sys 0m0.130s + +real 0m0.210s +user 0m0.241s +sys 0m0.130s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.019s +sys 0m0.025s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./sorting_room.go:45:2: singleCaseSwitch: should rewrite switch statement to if statement + +real 0m0.869s +user 0m2.173s +sys 0m0.278s + + + ============================================================================== + +Exit code: -1 + +real 0m0.902s +user 0m2.201s +sys 0m0.310s + +real 0m0.904s +user 0m2.203s +sys 0m0.310s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.024s +sys 0m0.032s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.077s +user 0m0.109s +sys 0m0.111s + + + ============================================================================== + +Exit code: 0 + +real 0m0.118s +user 0m0.143s +sys 0m0.151s + +real 0m0.121s +user 0m0.144s +sys 0m0.153s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.019s +sys 0m0.025s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.025s +user 0m0.018s +sys 0m0.027s + + + ============================================================================== + +Exit code: 0 + +real 0m0.065s +user 0m0.047s +sys 0m0.062s + +real 0m0.068s +user 0m0.049s +sys 0m0.064s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.018s +sys 0m0.017s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.485s +user 0m1.541s +sys 0m0.315s + + + ============================================================================== + +Exit code: 0 + +real 0m0.518s +user 0m1.563s +sys 0m0.344s + +real 0m0.520s +user 0m1.564s +sys 0m0.344s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.034s +user 0m0.046s +sys 0m0.052s + + + ============================================================================== + +Running: gocyclo . + +5 sorting DescribeAnything sorting_room.go:67:1 +3 sorting TestDescribeAnything sorting_room_test.go:155:1 +3 sorting TestDescribeFancyNumberBox sorting_room_test.go:119:1 +3 sorting TestExtractFancyNumber sorting_room_test.go:83:1 +3 sorting TestDescribeNumberBox sorting_room_test.go:49:1 +3 sorting TestDescribeNumber sorting_room_test.go:5:1 +3 sorting ExtractFancyNumber sorting_room.go:42:1 +1 sorting (differentFancyNumber).Value sorting_room_test.go:79:1 +1 sorting (testNumberBox).Number sorting_room_test.go:45:1 +1 sorting ExampleDescribeAnything sorting_room_examples_test.go:45:1 +1 sorting ExampleDescribeFancyNumberBox sorting_room_examples_test.go:37:1 +1 sorting ExampleExtractFancyNumber sorting_room_examples_test.go:29:1 +1 sorting ExampleDescribeNumberBox sorting_room_examples_test.go:21:1 +1 sorting (exampleNumberBox).Number sorting_room_examples_test.go:17:1 +1 sorting ExampleDescribeNumber sorting_room_examples_test.go:7:1 +1 sorting DescribeFancyNumberBox sorting_room.go:60:1 +1 sorting (FancyNumber).Value sorting_room.go:31:1 +1 sorting DescribeNumberBox sorting_room.go:20:1 +1 sorting DescribeNumber sorting_room.go:9:1 + +real 0m0.002s +user 0m0.000s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.048s +user 0m0.053s +sys 0m0.063s + +real 0m0.049s +user 0m0.054s +sys 0m0.063s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.027s +user 0m0.033s +sys 0m0.008s + + + ============================================================================== + +Exit code: 0 + +real 0m0.037s +user 0m0.038s +sys 0m0.018s + +real 0m0.039s +user 0m0.039s +sys 0m0.018s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.023s +sys 0m0.024s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:31:06 Including rules: default +[gosec] 2023/09/07 00:31:06 Excluding rules: default +[gosec] 2023/09/07 00:31:06 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/sorting-room +[gosec] 2023/09/07 00:31:06 Checking package: sorting +[gosec] 2023/09/07 00:31:06 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/sorting-room/sorting_room.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 80 + Nosec : 0 + Issues : 0 + + +real 0m0.126s +user 0m0.159s +sys 0m0.086s + + + ============================================================================== + +Exit code: 0 + +real 0m0.160s +user 0m0.190s +sys 0m0.117s + +real 0m0.161s +user 0m0.190s +sys 0m0.118s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out sorting +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.019s +sys 0m0.021s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestDescribeNumber === RUN TestDescribeNumber/Describe_4.1 === RUN TestDescribeNumber/Describe_-3.2 @@ -57,7 +664,7 @@ go test -v -covermode=count -coverprofile coverage.out sorting === RUN TestDescribeAnything/Describe_FancyNumber_with_16 === RUN TestDescribeAnything/Describe_a_different_FancyNumberBox === RUN TestDescribeAnything/Something_unknown_is_labelled_return_to_sender ---- PASS: TestDescribeAnything (0.01s) +--- PASS: TestDescribeAnything (0.00s) --- PASS: TestDescribeAnything/Describe_7.2 (0.00s) --- PASS: TestDescribeAnything/Describe_42 (0.00s) --- PASS: TestDescribeAnything/Describe_NumberBox_with_16 (0.00s) @@ -76,15 +683,17 @@ go test -v -covermode=count -coverprofile coverage.out sorting --- PASS: ExampleDescribeAnything (0.00s) PASS coverage: 100.0% of statements -ok sorting 0.027s coverage: 100.0% of statements +ok sorting 0.003s coverage: 100.0% of statements -real 0m0.714s -user 0m0.786s -sys 0m0.568s +real 0m0.198s +user 0m0.277s +sys 0m0.174s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + sorting/sorting_room.go:9: DescribeNumber 100.0% sorting/sorting_room.go:20: DescribeNumberBox 100.0% sorting/sorting_room.go:31: Value 100.0% @@ -93,19 +702,46 @@ sorting/sorting_room.go:60: DescribeFancyNumberBox 100.0% sorting/sorting_room.go:67: DescribeAnything 100.0% total: (statements) 100.0% -real 0m0.279s -user 0m0.251s -sys 0m0.310s +real 0m0.047s +user 0m0.056s +sys 0m0.064s + + + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.049s +user 0m0.071s +sys 0m0.066s -=============================================================================== -go test -v -race -covermode=atomic sorting + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.016s +user 0m0.018s +sys 0m0.020s + +real 0m0.016s +user 0m0.018s +sys 0m0.020s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestDescribeNumber === RUN TestDescribeNumber/Describe_4.1 === RUN TestDescribeNumber/Describe_-3.2 === RUN TestDescribeNumber/Pads_to_single_decimal_place === RUN TestDescribeNumber/Truncates_to_single_decimal_place ---- PASS: TestDescribeNumber (0.01s) +--- PASS: TestDescribeNumber (0.00s) --- PASS: TestDescribeNumber/Describe_4.1 (0.00s) --- PASS: TestDescribeNumber/Describe_-3.2 (0.00s) --- PASS: TestDescribeNumber/Pads_to_single_decimal_place (0.00s) @@ -131,7 +767,7 @@ go test -v -race -covermode=atomic sorting === RUN TestDescribeFancyNumberBox/Describe_fancy_number_0 === RUN TestDescribeFancyNumberBox/Describe_a_different_fancy_number === RUN TestDescribeFancyNumberBox/Describe_a_valid_different_fancy_number ---- PASS: TestDescribeFancyNumberBox (0.01s) +--- PASS: TestDescribeFancyNumberBox (0.00s) --- PASS: TestDescribeFancyNumberBox/Describe_fancy_number_12 (0.00s) --- PASS: TestDescribeFancyNumberBox/Describe_fancy_number_0 (0.00s) --- PASS: TestDescribeFancyNumberBox/Describe_a_different_fancy_number (0.00s) @@ -143,7 +779,7 @@ go test -v -race -covermode=atomic sorting === RUN TestDescribeAnything/Describe_FancyNumber_with_16 === RUN TestDescribeAnything/Describe_a_different_FancyNumberBox === RUN TestDescribeAnything/Something_unknown_is_labelled_return_to_sender ---- PASS: TestDescribeAnything (0.01s) +--- PASS: TestDescribeAnything (0.00s) --- PASS: TestDescribeAnything/Describe_7.2 (0.00s) --- PASS: TestDescribeAnything/Describe_42 (0.00s) --- PASS: TestDescribeAnything/Describe_NumberBox_with_16 (0.00s) @@ -162,67 +798,116 @@ go test -v -race -covermode=atomic sorting --- PASS: ExampleDescribeAnything (0.00s) PASS coverage: 100.0% of statements -ok sorting 0.073s coverage: 100.0% of statements +ok sorting 1.020s coverage: 100.0% of statements -real 0m0.776s -user 0m0.858s -sys 0m0.530s +real 0m1.258s +user 0m0.284s +sys 0m0.181s -=============================================================================== -go test --bench . --benchmem -PASS -ok sorting 0.032s + ============================================================================== -real 0m0.513s -user 0m0.593s -sys 0m0.401s +Exit code: 0 -=============================================================================== - -go test -tags bonus -PASS -ok sorting 0.013s +real 0m1.600s +user 0m0.726s +sys 0m0.540s -real 0m0.653s -user 0m0.805s -sys 0m0.458s +real 0m1.602s +user 0m0.729s +sys 0m0.540s =============================================================================== -go vet sorting +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok sorting 0.002s -real 0m0.437s -user 0m0.484s -sys 0m0.409s +real 0m0.163s +user 0m0.174s +sys 0m0.155s =============================================================================== -go fix sorting +gotest -v -tags bonus +=== RUN TestDescribeNumber +=== RUN TestDescribeNumber/Describe_4.1 +=== RUN TestDescribeNumber/Describe_-3.2 +=== RUN TestDescribeNumber/Pads_to_single_decimal_place +=== RUN TestDescribeNumber/Truncates_to_single_decimal_place +--- PASS: TestDescribeNumber (0.00s) + --- PASS: TestDescribeNumber/Describe_4.1 (0.00s) + --- PASS: TestDescribeNumber/Describe_-3.2 (0.00s) + --- PASS: TestDescribeNumber/Pads_to_single_decimal_place (0.00s) + --- PASS: TestDescribeNumber/Truncates_to_single_decimal_place (0.00s) +=== RUN TestDescribeNumberBox +=== RUN TestDescribeNumberBox/Describe_NumberBox_with_4 +=== RUN TestDescribeNumberBox/Describe_NumberBox_with_-3 +--- PASS: TestDescribeNumberBox (0.00s) + --- PASS: TestDescribeNumberBox/Describe_NumberBox_with_4 (0.00s) + --- PASS: TestDescribeNumberBox/Describe_NumberBox_with_-3 (0.00s) +=== RUN TestExtractFancyNumber +=== RUN TestExtractFancyNumber/Extract_fancy_number_11 +=== RUN TestExtractFancyNumber/Extract_fancy_number_0 +=== RUN TestExtractFancyNumber/Extract_a_differentFancyNumber_returns_0 +=== RUN TestExtractFancyNumber/Extract_an_invalid_fancy_number_returns_0 +--- PASS: TestExtractFancyNumber (0.00s) + --- PASS: TestExtractFancyNumber/Extract_fancy_number_11 (0.00s) + --- PASS: TestExtractFancyNumber/Extract_fancy_number_0 (0.00s) + --- PASS: TestExtractFancyNumber/Extract_a_differentFancyNumber_returns_0 (0.00s) + --- PASS: TestExtractFancyNumber/Extract_an_invalid_fancy_number_returns_0 (0.00s) +=== RUN TestDescribeFancyNumberBox +=== RUN TestDescribeFancyNumberBox/Describe_fancy_number_12 +=== RUN TestDescribeFancyNumberBox/Describe_fancy_number_0 +=== RUN TestDescribeFancyNumberBox/Describe_a_different_fancy_number +=== RUN TestDescribeFancyNumberBox/Describe_a_valid_different_fancy_number +--- PASS: TestDescribeFancyNumberBox (0.00s) + --- PASS: TestDescribeFancyNumberBox/Describe_fancy_number_12 (0.00s) + --- PASS: TestDescribeFancyNumberBox/Describe_fancy_number_0 (0.00s) + --- PASS: TestDescribeFancyNumberBox/Describe_a_different_fancy_number (0.00s) + --- PASS: TestDescribeFancyNumberBox/Describe_a_valid_different_fancy_number (0.00s) +=== RUN TestDescribeAnything +=== RUN TestDescribeAnything/Describe_7.2 +=== RUN TestDescribeAnything/Describe_42 +=== RUN TestDescribeAnything/Describe_NumberBox_with_16 +=== RUN TestDescribeAnything/Describe_FancyNumber_with_16 +=== RUN TestDescribeAnything/Describe_a_different_FancyNumberBox +=== RUN TestDescribeAnything/Something_unknown_is_labelled_return_to_sender +--- PASS: TestDescribeAnything (0.00s) + --- PASS: TestDescribeAnything/Describe_7.2 (0.00s) + --- PASS: TestDescribeAnything/Describe_42 (0.00s) + --- PASS: TestDescribeAnything/Describe_NumberBox_with_16 (0.00s) + --- PASS: TestDescribeAnything/Describe_FancyNumber_with_16 (0.00s) + --- PASS: TestDescribeAnything/Describe_a_different_FancyNumberBox (0.00s) + --- PASS: TestDescribeAnything/Something_unknown_is_labelled_return_to_sender (0.00s) +=== RUN ExampleDescribeNumber +--- PASS: ExampleDescribeNumber (0.00s) +=== RUN ExampleDescribeNumberBox +--- PASS: ExampleDescribeNumberBox (0.00s) +=== RUN ExampleExtractFancyNumber +--- PASS: ExampleExtractFancyNumber (0.00s) +=== RUN ExampleDescribeFancyNumberBox +--- PASS: ExampleDescribeFancyNumberBox (0.00s) +=== RUN ExampleDescribeAnything +--- PASS: ExampleDescribeAnything (0.00s) +PASS +ok sorting 0.002s -real 0m0.201s -user 0m0.228s -sys 0m0.151s +real 0m0.134s +user 0m0.187s +sys 0m0.148s =============================================================================== -gosec ./sorting-room -[gosec] 2022/06/20 16:31:08 Including rules: default -[gosec] 2022/06/20 16:31:08 Excluding rules: default -[gosec] 2022/06/20 16:31:08 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/sorting-room -2022/06/20 16:31:08 internal error: package "fmt" without types was imported from "command-line-arguments" - -real 0m0.559s -user 0m0.606s -sys 0m0.421s +No old benchmarks to run benchstat against. =============================================================================== gomarkdoc --output sorting-doc.md -real 0m0.034s -user 0m0.031s -sys 0m0.008s +real 0m0.011s +user 0m0.007s +sys 0m0.004s =============================================================================== @@ -270,9 +955,9 @@ type NumberBox interface { NumberBox struct method set interface. -real 0m0.259s -user 0m0.261s -sys 0m0.264s +real 0m0.046s +user 0m0.054s +sys 0m0.063s =============================================================================== diff --git a/go/sorting-room/sorting-doc.md b/go/sorting-room/sorting-doc.md index 1bf34540..44f17990 100755 --- a/go/sorting-room/sorting-doc.md +++ b/go/sorting-room/sorting-doc.md @@ -25,7 +25,7 @@ import "sorting" func DescribeAnything(i interface{}) string ``` -DescribeAnything should return a string describing whatever it contains\. +DescribeAnything should return a string describing whatever it contains.
Example

@@ -54,7 +54,7 @@ This is a fancy box containing the number 12.0 func DescribeFancyNumberBox(fnb FancyNumberBox) string ``` -DescribeFancyNumberBox should return a string describing the FancyNumberBox\. +DescribeFancyNumberBox should return a string describing the FancyNumberBox.

Example

@@ -83,7 +83,7 @@ This is a fancy box containing the number 12.0 func DescribeNumber(f float64) string ``` -DescribeNumber should return a string describing the number\. +DescribeNumber should return a string describing the number.

Example

@@ -110,7 +110,7 @@ This is the number -12.3 func DescribeNumberBox(nb NumberBox) string ``` -DescribeNumberBox should return a string describing the NumberBox\. +DescribeNumberBox should return a string describing the NumberBox.

Example

@@ -139,7 +139,7 @@ This is a box containing the number 12.0 func ExtractFancyNumber(fnb FancyNumberBox) int ``` -ExtractFancyNumber should return the integer value for a FancyNumber and 0 if any other FancyNumberBox is supplied\. +ExtractFancyNumber should return the integer value for a FancyNumber and 0 if any other FancyNumberBox is supplied.

Example

@@ -164,7 +164,7 @@ ExtractFancyNumber should return the integer value for a FancyNumber and 0 if an ## type [FancyNumber]() -FancyNumber struct that holds a string number\. +FancyNumber struct that holds a string number. ```go type FancyNumber struct { @@ -178,11 +178,11 @@ type FancyNumber struct { func (i FancyNumber) Value() string ``` -Value is a FancyNumber method\. +Value is a FancyNumber method. ## type [FancyNumberBox]() -FancyNumberBox struct method set interface\. +FancyNumberBox struct method set interface. ```go type FancyNumberBox interface { @@ -192,7 +192,7 @@ type FancyNumberBox interface { ## type [NumberBox]() -NumberBox struct method set interface\. +NumberBox struct method set interface. ```go type NumberBox interface { diff --git a/go/space-age/benchstat-new.txt b/go/space-age/benchstat-new.txt index bca3f431..da622615 100644 --- a/go/space-age/benchstat-new.txt +++ b/go/space-age/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: space -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkAge-4 10363681 131.4 ns/op 0 B/op 0 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkAge +BenchmarkAge-8 15822727 77.27 ns/op 0 B/op 0 allocs/op PASS -ok space 1.516s +ok space 1.304s diff --git a/go/space-age/benchstat-old.txt b/go/space-age/benchstat-old.txt index d95dd0a2..bca3f431 100644 --- a/go/space-age/benchstat-old.txt +++ b/go/space-age/benchstat-old.txt @@ -2,6 +2,6 @@ goos: linux goarch: amd64 pkg: space cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkAge-4 10086499 118.6 ns/op 0 B/op 0 allocs/op +BenchmarkAge-4 10363681 131.4 ns/op 0 B/op 0 allocs/op PASS -ok space 1.389s +ok space 1.516s diff --git a/go/space-age/coverage-annotations.txt b/go/space-age/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/space-age/coverage.out b/go/space-age/coverage.out index 14d257fa..80a3adea 100644 --- a/go/space-age/coverage.out +++ b/go/space-age/coverage.out @@ -1,4 +1,4 @@ mode: count space/space_age.go:22.50,25.12 2 10 -space/space_age.go:29.2,31.12 2 9 space/space_age.go:25.12,27.3 1 1 +space/space_age.go:29.2,31.12 2 9 diff --git a/go/space-age/run-tests-go.txt b/go/space-age/run-tests-go.txt index 2541ef23..74d97478 100644 --- a/go/space-age/run-tests-go.txt +++ b/go/space-age/run-tests-go.txt @@ -5,15 +5,599 @@ Go packages: space =============================================================================== -golint space +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.009s +sys 0m0.007s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +space_age.go:7:20: var-declaration: should omit type map[Planet]float64 from declaration of var orbitalPeriods; it will be inferred from the right-hand side (revive) +var orbitalPeriods map[Planet]float64 = map[Planet]float64{ + ^ +space_age.go:19:24: var-declaration: should omit type float64 from declaration of var secondsInEarthYear; it will be inferred from the right-hand side (revive) +var secondsInEarthYear float64 = 365.25 * 24 * 60 * 60 + ^ +space_age_test.go:12:18: Using the variable on range scope `tc` in function literal (scopelint) + actual := Age(tc.seconds, tc.planet) + ^ +space_age_test.go:13:23: Using the variable on range scope `tc` in function literal (scopelint) + if math.Abs(actual-tc.expected) > precision { + ^ +space_age_test.go:14:44: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("Age(%f, %v) = %f, want: %f", tc.seconds, tc.planet, actual, tc.expected) + ^ +space_age_test.go:10:2: ranges should only be cuddled with assignments used in the iteration (wsl) + for _, tc := range testCases { + ^ +space_age_test.go:24:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +space_age.go:8:13: mnd: Magic number: 0.2408467, in detected (gomnd) + "Mercury": 0.2408467, + ^ +space_age.go:9:13: mnd: Magic number: 0.61519726, in detected (gomnd) + "Venus": 0.61519726, + ^ +space_age.go:11:13: mnd: Magic number: 1.8808158, in detected (gomnd) + "Mars": 1.8808158, + ^ +space_age.go:12:13: mnd: Magic number: 11.862615, in detected (gomnd) + "Jupiter": 11.862615, + ^ +space_age.go:13:13: mnd: Magic number: 29.447498, in detected (gomnd) + "Saturn": 29.447498, + ^ +space_age.go:14:13: mnd: Magic number: 84.016846, in detected (gomnd) + "Uranus": 84.016846, + ^ +space_age.go:15:13: mnd: Magic number: 164.79132, in detected (gomnd) + "Neptune": 164.79132, + ^ +space_age_test.go:8:1: Function TestAge missing the call to method parallel (paralleltest) +func TestAge(t *testing.T) { +^ +cases_test.go:1:9: package should be `space_test` instead of `space` (testpackage) +package space + ^ +space_age_examples_test.go:1:9: package should be `space_test` instead of `space` (testpackage) +package space + ^ +space_age_test.go:1:9: package should be `space_test` instead of `space` (testpackage) +package space + ^ + +real 0m0.501s +user 0m0.720s +sys 0m0.495s + + + ============================================================================== + +Exit code: -1 + +real 0m0.525s +user 0m0.734s +sys 0m0.513s + +real 0m0.527s +user 0m0.734s +sys 0m0.515s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.006s +sys 0m0.010s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +cases_test.go + (1, 1) https://revive.run/r#package-comments should have a package comment + +space_age.go + (7, 20) https://revive.run/r#var-declaration should omit type map[Planet]float64 from declaration of var orbitalPeriods; it will be inferred from the right-hand side + (19, 24) https://revive.run/r#var-declaration should omit type float64 from declaration of var secondsInEarthYear; it will be inferred from the right-hand side + + + ✖ 3 problems (0 errors) (3 warnings) + +real 0m0.041s +user 0m0.025s +sys 0m0.027s + + + ============================================================================== + +Exit code: 0 + +real 0m0.066s +user 0m0.035s +sys 0m0.048s + +real 0m0.068s +user 0m0.037s +sys 0m0.049s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... -real 0m0.137s -user 0m0.087s -sys 0m0.163s + +real 0m0.016s +user 0m0.004s +sys 0m0.016s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "space [space.test]" + +real 0m0.094s +user 0m0.126s +sys 0m0.119s + + + ============================================================================== + +Exit code: -1 + +real 0m0.121s +user 0m0.135s +sys 0m0.147s + +real 0m0.123s +user 0m0.136s +sys 0m0.148s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.004s +sys 0m0.014s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +space_age.go:1:1: at least one file in a package should have a package comment (ST1000) + +real 0m0.165s +user 0m0.186s +sys 0m0.116s + + + ============================================================================== + +Exit code: -1 + +real 0m0.193s +user 0m0.198s +sys 0m0.141s + +real 0m0.196s +user 0m0.199s +sys 0m0.144s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out space +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.007s +sys 0m0.015s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.833s +user 0m1.846s +sys 0m0.302s + + + ============================================================================== + +Exit code: 0 + +real 0m0.861s +user 0m1.858s +sys 0m0.328s + +real 0m0.863s +user 0m1.860s +sys 0m0.328s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.008s +sys 0m0.009s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.084s +user 0m0.119s +sys 0m0.121s + + + ============================================================================== + +Exit code: 0 + +real 0m0.108s +user 0m0.132s +sys 0m0.141s + +real 0m0.110s +user 0m0.133s +sys 0m0.141s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.009s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.016s +user 0m0.009s +sys 0m0.011s + + + ============================================================================== + +Exit code: 0 + +real 0m0.040s +user 0m0.022s +sys 0m0.029s + +real 0m0.042s +user 0m0.024s +sys 0m0.029s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.008s +sys 0m0.022s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.503s +user 0m1.483s +sys 0m0.293s + + + ============================================================================== + +Exit code: 0 + +real 0m0.544s +user 0m1.502s +sys 0m0.328s + +real 0m0.545s +user 0m1.502s +sys 0m0.329s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.007s +sys 0m0.007s + + + ============================================================================== + +Running: gocyclo . + +4 space BenchmarkAge space_age_test.go:20:1 +3 space TestAge space_age_test.go:8:1 +2 space Age space_age.go:22:1 +1 space ExampleAge space_age_examples_test.go:7:1 + +real 0m0.003s +user 0m0.001s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.025s +user 0m0.015s +sys 0m0.017s + +real 0m0.027s +user 0m0.016s +sys 0m0.019s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.034s +user 0m0.066s +sys 0m0.020s + + + ============================================================================== + +Exit code: 0 + +real 0m0.047s +user 0m0.073s +sys 0m0.030s + +real 0m0.049s +user 0m0.074s +sys 0m0.030s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.005s +sys 0m0.012s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:31:11 Including rules: default +[gosec] 2023/09/07 00:31:11 Excluding rules: default +[gosec] 2023/09/07 00:31:11 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/space-age +[gosec] 2023/09/07 00:31:11 Checking package: space +[gosec] 2023/09/07 00:31:11 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/space-age/space_age.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 32 + Nosec : 0 + Issues : 0 + + +real 0m0.087s +user 0m0.056s +sys 0m0.067s + + + ============================================================================== + +Exit code: 0 + +real 0m0.122s +user 0m0.075s +sys 0m0.095s + +real 0m0.124s +user 0m0.076s +sys 0m0.096s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.006s +sys 0m0.019s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestAge === RUN TestAge/age_on_Earth === RUN TestAge/age_on_Mercury @@ -38,33 +622,54 @@ go test -v -covermode=count -coverprofile coverage.out space --- PASS: ExampleAge (0.00s) PASS coverage: 100.0% of statements -ok space 0.009s coverage: 100.0% of statements +ok space 0.002s coverage: 100.0% of statements -real 0m0.650s -user 0m0.626s -sys 0m0.502s +real 0m0.173s +user 0m0.221s +sys 0m0.149s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + space/space_age.go:22: Age 100.0% total: (statements) 100.0% -real 0m0.080s -user 0m0.034s -sys 0m0.066s +real 0m0.022s +user 0m0.007s +sys 0m0.020s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.089s -user 0m0.032s -sys 0m0.083s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic space +real 0m0.022s +user 0m0.009s +sys 0m0.018s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.008s +user 0m0.001s +sys 0m0.011s + +real 0m0.008s +user 0m0.001s +sys 0m0.011s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestAge === RUN TestAge/age_on_Earth === RUN TestAge/age_on_Mercury @@ -89,108 +694,126 @@ go test -v -race -covermode=atomic space --- PASS: ExampleAge (0.00s) PASS coverage: 100.0% of statements -ok space 0.034s coverage: 100.0% of statements +ok space 1.017s coverage: 100.0% of statements + +real 0m1.249s +user 0m0.315s +sys 0m0.192s + + + ============================================================================== + +Exit code: 0 -real 0m0.634s -user 0m0.736s -sys 0m0.435s +real 0m1.509s +user 0m0.563s +sys 0m0.427s + +real 0m1.513s +user 0m0.565s +sys 0m0.430s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: space -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkAge-4 10363681 131.4 ns/op 0 B/op 0 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkAge +BenchmarkAge-8 15822727 77.27 ns/op 0 B/op 0 allocs/op PASS -ok space 1.516s +ok space 1.304s -real 0m1.975s -user 0m2.069s -sys 0m0.381s +real 0m1.459s +user 0m1.518s +sys 0m0.151s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestAge +=== RUN TestAge/age_on_Earth +=== RUN TestAge/age_on_Mercury +=== RUN TestAge/age_on_Venus +=== RUN TestAge/age_on_Mars +=== RUN TestAge/age_on_Jupiter +=== RUN TestAge/age_on_Saturn +=== RUN TestAge/age_on_Uranus +=== RUN TestAge/age_on_Neptune +=== RUN TestAge/invalid_planet_causes_error +--- PASS: TestAge (0.00s) + --- PASS: TestAge/age_on_Earth (0.00s) + --- PASS: TestAge/age_on_Mercury (0.00s) + --- PASS: TestAge/age_on_Venus (0.00s) + --- PASS: TestAge/age_on_Mars (0.00s) + --- PASS: TestAge/age_on_Jupiter (0.00s) + --- PASS: TestAge/age_on_Saturn (0.00s) + --- PASS: TestAge/age_on_Uranus (0.00s) + --- PASS: TestAge/age_on_Neptune (0.00s) + --- PASS: TestAge/invalid_planet_causes_error (0.00s) +=== RUN ExampleAge +--- PASS: ExampleAge (0.00s) PASS -ok space 0.008s +ok space 0.002s -real 0m0.541s -user 0m0.692s -sys 0m0.386s +real 0m0.129s +user 0m0.185s +sys 0m0.117s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest -go: downloading golang.org/x/perf v0.0.0-20220722155240-3d85ee92886d - -real 0m5.129s -user 0m4.124s -sys 0m1.559s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -Age-4 119ns ± 0% 131ns ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -Age-4 0.00B 0.00B ~ (all equal) - -name old allocs/op new allocs/op delta -Age-4 0.00 0.00 ~ (all equal) - -real 0m0.033s -user 0m0.021s -sys 0m0.021s - -=============================================================================== - -go vet space - -real 0m0.388s -user 0m0.463s -sys 0m0.340s - -=============================================================================== - -go fix space - -real 0m0.072s -user 0m0.035s -sys 0m0.056s - -=============================================================================== - -gosec ./space-age -[gosec] 2022/07/24 00:04:47 Including rules: default -[gosec] 2022/07/24 00:04:47 Excluding rules: default -[gosec] 2022/07/24 00:04:47 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/space-age -[gosec] 2022/07/24 00:04:47 Checking package: space -[gosec] 2022/07/24 00:04:47 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/space-age/space_age.go -Results: +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: space +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Age-8 77.27n ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Age-8 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Age-8 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Age-4 131.4n ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -Summary: - Files: 1 - Lines: 32 - Nosec: 0 - Issues: 0 + │ benchstat-old.txt │ + │ B/op │ +Age-4 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + │ benchstat-old.txt │ + │ allocs/op │ +Age-4 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.305s -user 0m0.265s -sys 0m0.223s +real 0m0.003s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output space-doc.md -real 0m0.030s -user 0m0.020s -sys 0m0.017s +real 0m0.009s +user 0m0.003s +sys 0m0.006s =============================================================================== @@ -210,9 +833,9 @@ type Planet string Planet is a string with the name of a Planet. -real 0m0.108s -user 0m0.045s -sys 0m0.096s +real 0m0.030s +user 0m0.015s +sys 0m0.022s =============================================================================== diff --git a/go/space-age/space-doc.md b/go/space-age/space-doc.md index 2bc52d93..1c0fcb32 100755 --- a/go/space-age/space-doc.md +++ b/go/space-age/space-doc.md @@ -18,7 +18,7 @@ import "space" func Age(seconds float64, planet Planet) float64 ``` -Age returns a person's age on a given planet\. +Age returns a person's age on a given planet.

Example

@@ -43,7 +43,7 @@ Age returns a person's age on a given planet\. ## type [Planet]() -Planet is a string with the name of a Planet\. +Planet is a string with the name of a Planet. ```go type Planet string diff --git a/go/strain/benchstat-new.txt b/go/strain/benchstat-new.txt index 1a9ed767..7a97512e 100644 --- a/go/strain/benchstat-new.txt +++ b/go/strain/benchstat-new.txt @@ -1,8 +1,10 @@ goos: linux goarch: amd64 pkg: strain -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkKeepInts-4 2344521 518.9 ns/op 104 B/op 7 allocs/op -BenchmarkDiscardInts-4 2192020 594.9 ns/op 120 B/op 7 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkKeepInts +BenchmarkKeepInts-8 7155639 164.2 ns/op 104 B/op 7 allocs/op +BenchmarkDiscardInts +BenchmarkDiscardInts-8 7197229 170.5 ns/op 120 B/op 7 allocs/op PASS -ok strain 3.668s +ok strain 2.748s diff --git a/go/strain/benchstat-old.txt b/go/strain/benchstat-old.txt new file mode 100644 index 00000000..1a9ed767 --- /dev/null +++ b/go/strain/benchstat-old.txt @@ -0,0 +1,8 @@ +goos: linux +goarch: amd64 +pkg: strain +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkKeepInts-4 2344521 518.9 ns/op 104 B/op 7 allocs/op +BenchmarkDiscardInts-4 2192020 594.9 ns/op 120 B/op 7 allocs/op +PASS +ok strain 3.668s diff --git a/go/strain/coverage-annotations.txt b/go/strain/coverage-annotations.txt new file mode 100644 index 00000000..3aec2b49 --- /dev/null +++ b/go/strain/coverage-annotations.txt @@ -0,0 +1,34 @@ + +48 func (l Lists) Keep(filter func([]int) bool) Lists { +49 if l == nil { +50 MISS return Lists(nil) +51 } +52 +53 list := Lists{} +54 +55 for _, subList := range l { +56 if filter(subList) { +57 list = append(list, subList) +58 } +59 } +60 +61 return list +62 } + + +65 func (s Strings) Keep(filter func(string) bool) Strings { +66 if s == nil { +67 MISS return Strings(nil) +68 } +69 +70 list := Strings{} +71 +72 for _, v := range s { +73 if filter(v) { +74 list = append(list, v) +75 } +76 } +77 +78 return list +79 } + diff --git a/go/strain/coverage.out b/go/strain/coverage.out index 050d176f..42b6e90f 100644 --- a/go/strain/coverage.out +++ b/go/strain/coverage.out @@ -1,25 +1,25 @@ mode: count strain/strain.go:14.48,15.14 1 5 -strain/strain.go:19.2,21.22 2 4 -strain/strain.go:27.2,27.13 1 4 strain/strain.go:15.14,17.3 1 1 +strain/strain.go:19.2,21.22 2 4 strain/strain.go:21.22,22.16 1 20 strain/strain.go:22.16,24.4 1 11 +strain/strain.go:27.2,27.13 1 4 strain/strain.go:31.51,32.14 1 5 -strain/strain.go:36.2,38.22 2 4 -strain/strain.go:44.2,44.13 1 4 strain/strain.go:32.14,34.3 1 1 +strain/strain.go:36.2,38.22 2 4 strain/strain.go:38.22,39.17 1 20 strain/strain.go:39.17,41.4 1 12 +strain/strain.go:44.2,44.13 1 4 strain/strain.go:48.52,49.14 1 2 -strain/strain.go:53.2,55.28 2 2 -strain/strain.go:61.2,61.13 1 2 strain/strain.go:49.14,51.3 1 0 +strain/strain.go:53.2,55.28 2 2 strain/strain.go:55.28,56.22 1 10 strain/strain.go:56.22,58.4 1 5 +strain/strain.go:61.2,61.13 1 2 strain/strain.go:65.57,66.14 1 2 -strain/strain.go:70.2,72.22 2 2 -strain/strain.go:78.2,78.13 1 2 strain/strain.go:66.14,68.3 1 0 +strain/strain.go:70.2,72.22 2 2 strain/strain.go:72.22,73.16 1 10 strain/strain.go:73.16,75.4 1 4 +strain/strain.go:78.2,78.13 1 2 diff --git a/go/strain/run-tests-go.txt b/go/strain/run-tests-go.txt index 98196d64..4237da55 100644 --- a/go/strain/run-tests-go.txt +++ b/go/strain/run-tests-go.txt @@ -5,15 +5,626 @@ Go packages: strain =============================================================================== -golint strain +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.005s +sys 0m0.011s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +strain_test.go:18: File is not `gofumpt`-ed (gofumpt) + {lt10, +strain_test.go:20: File is not `gofumpt`-ed (gofumpt) + nil}, + {lt10, +strain_test.go:23: File is not `gofumpt`-ed (gofumpt) + Ints{1, 2, 3}}, + {odd, +strain_examples_test.go:35:3: return statements should not be cuddled if block has more than two lines (wsl) + return false + ^ +strain_test.go:59:3: only one cuddle assignment allowed before switch statement (wsl) + switch res := cp.Keep(test.pred); { + ^ +strain_test.go:77:3: only one cuddle assignment allowed before switch statement (wsl) + switch res := cp.Discard(test.pred); { + ^ +strain_test.go:95:2: anonymous switch statements should never be cuddled (wsl) + switch res := cp.Keep(zword); { + ^ +strain_test.go:112:3: return statements should not be cuddled if block has more than two lines (wsl) + return false + ^ +strain_test.go:129:2: append only allowed to cuddle with appended value (wsl) + cp := append(Lists{}, list...) + ^ +strain_test.go:130:2: only one cuddle assignment allowed before switch statement (wsl) + switch res := cp.Keep(has5); { + ^ +strain_test.go:144:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +strain_test.go:155:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +strain_test.go:13:5: keepTests is a global variable (gochecknoglobals) +var keepTests = []struct { + ^ +strain_test.go:32:5: discardTests is a global variable (gochecknoglobals) +var discardTests = []struct { + ^ +strain_examples_test.go:5:6: ExampleInts_Keep contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleInts_Keep() { + ^ +strain_examples_test.go:14:6: ExampleInts_Discard contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleInts_Discard() { + ^ +strain_examples_test.go:23:6: ExampleLists_Keep contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleLists_Keep() { + ^ +strain_examples_test.go:43:6: ExampleStrings_Keep contains underscore. You should use mixedCap or MixedCap. (nosnakecase) +func ExampleStrings_Keep() { + ^ +strain_test.go:51:1: Function TestKeepInts missing the call to method parallel (paralleltest) +func TestKeepInts(t *testing.T) { +^ +strain_test.go:71:1: Function TestDiscardInts missing the call to method parallel (paralleltest) +func TestDiscardInts(t *testing.T) { +^ +strain_test.go:89:1: Function TestKeepStrings missing the call to method parallel (paralleltest) +func TestKeepStrings(t *testing.T) { +^ +strain_test.go:105:1: Function TestKeepLists missing the call to method parallel (paralleltest) +func TestKeepLists(t *testing.T) { +^ +strain_examples_test.go:1:9: package should be `strain_test` instead of `strain` (testpackage) +package strain + ^ +strain_test.go:1:9: package should be `strain_test` instead of `strain` (testpackage) +package strain + ^ +strain_test.go:55:3: variable name 'cp' is too short for the scope of its usage (varnamelen) + cp := test.list + ^ +strain_test.go:73:3: variable name 'cp' is too short for the scope of its usage (varnamelen) + cp := test.list + ^ +strain_examples_test.go:29:2: variable name 'f' is too short for the scope of its usage (varnamelen) + f := func(list []int) bool { + ^ + +real 0m0.469s +user 0m0.694s +sys 0m0.428s + + + ============================================================================== + +Exit code: -1 + +real 0m0.498s +user 0m0.709s +sys 0m0.452s + +real 0m0.500s +user 0m0.709s +sys 0m0.454s -real 0m0.130s -user 0m0.165s -sys 0m0.098s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.008s +sys 0m0.008s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.054s +user 0m0.035s +sys 0m0.034s + + + ============================================================================== + +Exit code: 0 + +real 0m0.079s +user 0m0.051s +sys 0m0.052s + +real 0m0.081s +user 0m0.052s +sys 0m0.052s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.011s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "strain [strain.test]" + +real 0m0.159s +user 0m0.161s +sys 0m0.209s + + + ============================================================================== + +Exit code: -1 + +real 0m0.182s +user 0m0.171s +sys 0m0.230s + +real 0m0.184s +user 0m0.171s +sys 0m0.232s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.008s +sys 0m0.010s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.165s +user 0m0.213s +sys 0m0.138s + + + ============================================================================== + +Exit code: 0 + +real 0m0.192s +user 0m0.225s +sys 0m0.161s + +real 0m0.194s +user 0m0.225s +sys 0m0.163s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.010s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.880s +user 0m2.108s +sys 0m0.300s + + + ============================================================================== + +Exit code: 0 + +real 0m0.906s +user 0m2.120s +sys 0m0.322s + +real 0m0.907s +user 0m2.121s +sys 0m0.322s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.010s +sys 0m0.007s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.091s +user 0m0.142s +sys 0m0.133s + + + ============================================================================== + +Exit code: 0 + +real 0m0.116s +user 0m0.159s +sys 0m0.148s + +real 0m0.118s +user 0m0.160s +sys 0m0.149s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.004s +sys 0m0.013s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.014s +user 0m0.010s +sys 0m0.006s + + + ============================================================================== + +Exit code: 0 + +real 0m0.040s +user 0m0.018s +sys 0m0.033s + +real 0m0.042s +user 0m0.018s +sys 0m0.034s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.010s +sys 0m0.017s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.481s +user 0m1.186s +sys 0m0.236s + + + ============================================================================== + +Exit code: 0 + +real 0m0.516s +user 0m1.207s +sys 0m0.260s + +real 0m0.518s +user 0m1.209s +sys 0m0.260s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.009s + + + ============================================================================== + +Running: gocyclo . + +5 strain TestKeepLists strain_test.go:105:1 +5 strain TestDiscardInts strain_test.go:71:1 +5 strain TestKeepInts strain_test.go:51:1 +4 strain BenchmarkDiscardInts strain_test.go:151:1 +4 strain BenchmarkKeepInts strain_test.go:140:1 +4 strain TestKeepStrings strain_test.go:89:1 +4 strain (Strings).Keep strain.go:65:1 +4 strain (Lists).Keep strain.go:48:1 +4 strain (Ints).Discard strain.go:31:1 +4 strain (Ints).Keep strain.go:14:1 +3 strain ExampleLists_Keep strain_examples_test.go:23:1 +1 strain even strain_test.go:11:1 +1 strain odd strain_test.go:10:1 +1 strain gt10 strain_test.go:9:1 +1 strain lt10 strain_test.go:8:1 +1 strain ExampleStrings_Keep strain_examples_test.go:43:1 +1 strain ExampleInts_Discard strain_examples_test.go:14:1 +1 strain ExampleInts_Keep strain_examples_test.go:5:1 + +real 0m0.002s +user 0m0.001s +sys 0m0.001s + + + ============================================================================== + +Exit code: 0 + +real 0m0.026s +user 0m0.015s +sys 0m0.018s + +real 0m0.028s +user 0m0.015s +sys 0m0.020s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.027s +user 0m0.033s +sys 0m0.013s + + + ============================================================================== + +Exit code: 0 + +real 0m0.040s +user 0m0.039s +sys 0m0.025s + +real 0m0.042s +user 0m0.040s +sys 0m0.025s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out strain +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.009s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:31:17 Including rules: default +[gosec] 2023/09/07 00:31:17 Excluding rules: default +[gosec] 2023/09/07 00:31:17 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/strain +[gosec] 2023/09/07 00:31:17 Checking package: strain +[gosec] 2023/09/07 00:31:17 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/strain/strain.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 79 + Nosec : 0 + Issues : 0 + + +real 0m0.085s +user 0m0.078s +sys 0m0.050s + + + ============================================================================== + +Exit code: 0 + +real 0m0.110s +user 0m0.089s +sys 0m0.070s + +real 0m0.112s +user 0m0.090s +sys 0m0.071s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.005s +sys 0m0.011s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestKeepInts --- PASS: TestKeepInts (0.00s) === RUN TestDiscardInts @@ -32,36 +643,91 @@ go test -v -covermode=count -coverprofile coverage.out strain --- PASS: ExampleStrings_Keep (0.00s) PASS coverage: 92.9% of statements -ok strain 0.015s coverage: 92.9% of statements +ok strain 0.002s coverage: 92.9% of statements -real 0m0.641s -user 0m0.784s -sys 0m0.545s +real 0m0.174s +user 0m0.227s +sys 0m0.147s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + strain/strain.go:14: Keep 100.0% strain/strain.go:31: Discard 100.0% strain/strain.go:48: Keep 85.7% strain/strain.go:65: Keep 85.7% total: (statements) 92.9% -real 0m0.112s -user 0m0.080s -sys 0m0.097s +real 0m0.024s +user 0m0.007s +sys 0m0.022s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.082s -user 0m0.040s -sys 0m0.069s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic strain +real 0m0.020s +user 0m0.011s +sys 0m0.015s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +48 func (l Lists) Keep(filter func([]int) bool) Lists { +49 if l == nil { +50 MISS return Lists(nil) +51 } +52 +53 list := Lists{} +54 +55 for _, subList := range l { +56 if filter(subList) { +57 list = append(list, subList) +58 } +59 } +60 +61 return list +62 } + + +65 func (s Strings) Keep(filter func(string) bool) Strings { +66 if s == nil { +67 MISS return Strings(nil) +68 } +69 +70 list := Strings{} +71 +72 for _, v := range s { +73 if filter(v) { +74 list = append(list, v) +75 } +76 } +77 +78 return list +79 } + + +real 0m0.010s +user 0m0.004s +sys 0m0.009s + +real 0m0.010s +user 0m0.004s +sys 0m0.009s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestKeepInts --- PASS: TestKeepInts (0.00s) === RUN TestDiscardInts @@ -80,87 +746,135 @@ go test -v -race -covermode=atomic strain --- PASS: ExampleStrings_Keep (0.00s) PASS coverage: 92.9% of statements -ok strain 0.060s coverage: 92.9% of statements +ok strain 1.013s coverage: 92.9% of statements -real 0m1.028s -user 0m0.874s -sys 0m0.580s +real 0m1.250s +user 0m0.285s +sys 0m0.162s -=============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -goos: linux -goarch: amd64 -pkg: strain -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkKeepInts-4 2344521 518.9 ns/op 104 B/op 7 allocs/op -BenchmarkDiscardInts-4 2192020 594.9 ns/op 120 B/op 7 allocs/op -PASS -ok strain 3.668s + ============================================================================== -real 0m4.229s -user 0m6.126s -sys 0m0.990s +Exit code: 0 -=============================================================================== +real 0m1.507s +user 0m0.544s +sys 0m0.380s -go test -tags bonus -PASS -ok strain 0.009s - -real 0m0.509s -user 0m0.660s -sys 0m0.440s +real 0m1.509s +user 0m0.545s +sys 0m0.382s =============================================================================== -No old benchmarks to run benchstat against. +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -=============================================================================== - -go vet strain +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +goos: linux +goarch: amd64 +pkg: strain +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkKeepInts +BenchmarkKeepInts-8 7155639 164.2 ns/op 104 B/op 7 allocs/op +BenchmarkDiscardInts +BenchmarkDiscardInts-8 7197229 170.5 ns/op 120 B/op 7 allocs/op +PASS +ok strain 2.748s -real 0m0.383s -user 0m0.399s -sys 0m0.348s +real 0m2.910s +user 0m3.035s +sys 0m0.185s =============================================================================== -go fix strain +gotest -v -tags bonus +=== RUN TestKeepInts +--- PASS: TestKeepInts (0.00s) +=== RUN TestDiscardInts +--- PASS: TestDiscardInts (0.00s) +=== RUN TestKeepStrings +--- PASS: TestKeepStrings (0.00s) +=== RUN TestKeepLists +--- PASS: TestKeepLists (0.00s) +=== RUN ExampleInts_Keep +--- PASS: ExampleInts_Keep (0.00s) +=== RUN ExampleInts_Discard +--- PASS: ExampleInts_Discard (0.00s) +=== RUN ExampleLists_Keep +--- PASS: ExampleLists_Keep (0.00s) +=== RUN ExampleStrings_Keep +--- PASS: ExampleStrings_Keep (0.00s) +PASS +ok strain 0.002s -real 0m0.066s -user 0m0.033s -sys 0m0.055s +real 0m0.125s +user 0m0.156s +sys 0m0.097s =============================================================================== -gosec ./strain -[gosec] 2022/07/03 20:53:22 Including rules: default -[gosec] 2022/07/03 20:53:22 Excluding rules: default -[gosec] 2022/07/03 20:53:22 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/strain -[gosec] 2022/07/03 20:53:22 Checking package: strain -[gosec] 2022/07/03 20:53:22 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/strain/strain.go -Results: - - -Summary: - Files: 1 - Lines: 79 - Nosec: 0 - Issues: 0 - +benchstat benchstat-old.txt benchstat-new.txt +benchstat-new.txt:5: missing iteration count +benchstat-new.txt:7: missing iteration count +goos: linux +goarch: amd64 +pkg: strain +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +KeepInts-8 164.2n ± ∞ ¹ +DiscardInts-8 170.5n ± ∞ ¹ +geomean 167.3n +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +KeepInts-8 104.0 ± ∞ ¹ +DiscardInts-8 120.0 ± ∞ ¹ +geomean 111.7 +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +KeepInts-8 7.000 ± ∞ ¹ +DiscardInts-8 7.000 ± ∞ ¹ +geomean 7.000 +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.285s -user 0m0.298s -sys 0m0.198s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +KeepInts-4 518.9n ± ∞ ¹ +DiscardInts-4 594.9n ± ∞ ¹ +geomean 555.6n +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ B/op │ +KeepInts-4 104.0 ± ∞ ¹ +DiscardInts-4 120.0 ± ∞ ¹ +geomean 111.7 +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ allocs/op │ +KeepInts-4 7.000 ± ∞ ¹ +DiscardInts-4 7.000 ± ∞ ¹ +geomean 7.000 +¹ need >= 6 samples for confidence interval at level 0.95 + +real 0m0.002s +user 0m0.001s +sys 0m0.001s =============================================================================== gomarkdoc --output strain-doc.md -real 0m0.029s -user 0m0.026s -sys 0m0.025s +real 0m0.020s +user 0m0.013s +sys 0m0.008s =============================================================================== @@ -197,9 +911,9 @@ func (s Strings) Keep(filter func(string) bool) Strings is true. -real 0m0.137s -user 0m0.055s -sys 0m0.153s +real 0m0.030s +user 0m0.012s +sys 0m0.023s =============================================================================== diff --git a/go/strain/strain-doc.md b/go/strain/strain-doc.md index 22399fbb..15e8ce40 100755 --- a/go/strain/strain-doc.md +++ b/go/strain/strain-doc.md @@ -6,7 +6,7 @@ import "strain" ``` -Package strain implements collection keep and discard functions\. +Package strain implements collection keep and discard functions. ## Index @@ -21,7 +21,7 @@ Package strain implements collection keep and discard functions\. ## type [Ints]() -Ints integer collection\. +Ints integer collection. ```go type Ints []int @@ -33,7 +33,7 @@ type Ints []int func (i Ints) Discard(filter func(int) bool) Ints ``` -Discard returns a new collection containing those elements where the predicate is false\. +Discard returns a new collection containing those elements where the predicate is false.

Example

@@ -63,7 +63,7 @@ Discard returns a new collection containing those elements where the predicate i func (i Ints) Keep(filter func(int) bool) Ints ``` -Keep returns a new collection containing those elements where the predicate is true\. +Keep returns a new collection containing those elements where the predicate is true.

Example

@@ -89,7 +89,7 @@ Keep returns a new collection containing those elements where the predicate is t ## type [Lists]() -Lists slice integer collection\. +Lists slice integer collection. ```go type Lists [][]int @@ -101,7 +101,7 @@ type Lists [][]int func (l Lists) Keep(filter func([]int) bool) Lists ``` -Keep returns a new collection containing those elements where the predicate is true\. +Keep returns a new collection containing those elements where the predicate is true.

Example

@@ -138,7 +138,7 @@ Keep returns a new collection containing those elements where the predicate is t ## type [Strings]() -Strings string collection\. +Strings string collection. ```go type Strings []string @@ -150,7 +150,7 @@ type Strings []string func (s Strings) Keep(filter func(string) bool) Strings ``` -Keep returns a new collection containing those elements where the predicate is true\. +Keep returns a new collection containing those elements where the predicate is true.

Example

diff --git a/go/sublist/benchstat-new.txt b/go/sublist/benchstat-new.txt index 6778065a..9c016ab0 100644 --- a/go/sublist/benchstat-new.txt +++ b/go/sublist/benchstat-new.txt @@ -3,6 +3,6 @@ goarch: amd64 pkg: sublist cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkSublist -BenchmarkSublist-16 108157 10211 ns/op 2401 B/op 217 allocs/op +BenchmarkSublist-8 97245 10959 ns/op 2400 B/op 217 allocs/op PASS -ok sublist 1.222s +ok sublist 1.195s diff --git a/go/sublist/benchstat-old.txt b/go/sublist/benchstat-old.txt index 074b73e8..6778065a 100644 --- a/go/sublist/benchstat-old.txt +++ b/go/sublist/benchstat-old.txt @@ -3,6 +3,6 @@ goarch: amd64 pkg: sublist cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkSublist -BenchmarkSublist-16 113762 10324 ns/op 2401 B/op 217 allocs/op +BenchmarkSublist-16 108157 10211 ns/op 2401 B/op 217 allocs/op PASS -ok sublist 1.286s +ok sublist 1.222s diff --git a/go/sublist/run-tests-go.txt b/go/sublist/run-tests-go.txt index 23babaf6..8ea1687d 100644 --- a/go/sublist/run-tests-go.txt +++ b/go/sublist/run-tests-go.txt @@ -5,114 +5,587 @@ Go packages: sublist =============================================================================== -golangci-lint run ./... +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.263s -user 0m0.404s -sys 0m0.249s +Running GoLangCi-Lint -=============================================================================== +Go version: -golint ./... + go version go1.21.0 linux/amd64 -real 0m0.010s -user 0m0.007s -sys 0m0.011s + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.021s +sys 0m0.019s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +relations.go:3:44: Comment should end in a period (godot) +// Relation is the comparison between lists + ^ +relations.go:6:22: Comment should end in a period (godot) +// Possible relations + ^ +sublist.go:20: File is not `gofumpt`-ed (gofumpt) + +sublist_test.go:10:25: Using the variable on range scope `tc` in function literal (scopelint) + if actual := Sublist(tc.listOne, tc.listTwo); actual != tc.expected { + ^ +sublist_test.go:11:49: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("Sublist(%#v,%#v) = %v, want: %v", tc.listOne, tc.listTwo, actual, tc.expected) + ^ +sublist.go:12:27: unnecessary conversion (unconvert) + str = strings.Trim(string(str), "[]") + ^ +sublist.go:19: unnecessary leading newline (whitespace) +func Sublist(l1, l2 []int) Relation { + +sublist_test.go:21:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:8:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +sublist_test.go:7:1: Function TestSublist missing the call to method parallel (paralleltest) +func TestSublist(t *testing.T) { +^ +sublist_test.go:8:2: Range statement for test TestSublist missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +cases_test.go:1:9: package should be `sublist_test` instead of `sublist` (testpackage) +package sublist + ^ +sublist_examples_test.go:1:9: package should be `sublist_test` instead of `sublist` (testpackage) +package sublist + ^ +sublist_test.go:1:9: package should be `sublist_test` instead of `sublist` (testpackage) +package sublist + ^ +sublist_examples_test.go:9:2: variable name 'l2' is too short for the scope of its usage (varnamelen) + l2 := []int{1, 2, 3} + ^ +sublist.go:26:2: variable name 's2' is too short for the scope of its usage (varnamelen) + s2 := ListToString(l2) + ^ +sublist_examples_test.go:8:2: variable name 'l1' is too short for the scope of its usage (varnamelen) + l1 := []int{1, 2, 3} + ^ +sublist.go:25:2: variable name 's1' is too short for the scope of its usage (varnamelen) + s1 := ListToString(l1) + ^ + +real 0m0.500s +user 0m0.710s +sys 0m0.475s + + + ============================================================================== + +Exit code: -1 + +real 0m0.537s +user 0m0.736s +sys 0m0.505s + +real 0m0.540s +user 0m0.738s +sys 0m0.506s =============================================================================== -revive -formatter=stylish ./... +Running: ../../.github/citools/go/go-lint-revive -real 0m0.007s -user 0m0.004s -sys 0m0.004s +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.016s +sys 0m0.016s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.054s +user 0m0.028s +sys 0m0.042s + + + ============================================================================== + +Exit code: 0 + +real 0m0.082s +user 0m0.049s +sys 0m0.067s + +real 0m0.084s +user 0m0.050s +sys 0m0.068s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.081s -user 0m0.138s -sys 0m0.115s +real 0m0.000s +user 0m0.000s +sys 0m0.000s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.020s +sys 0m0.023s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." internal error: package "fmt" without types was imported from "sublist" -real 0m0.102s -user 0m0.174s -sys 0m0.167s +real 0m0.084s +user 0m0.116s +sys 0m0.091s + + + ============================================================================== + +Exit code: -1 + +real 0m0.120s +user 0m0.141s +sys 0m0.125s + +real 0m0.121s +user 0m0.143s +sys 0m0.126s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.024s +sys 0m0.025s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.185s +user 0m0.218s +sys 0m0.139s + + + ============================================================================== + +Exit code: 0 -real 0m0.182s -user 0m0.316s -sys 0m0.174s +real 0m0.221s +user 0m0.248s +sys 0m0.173s + +real 0m0.222s +user 0m0.249s +sys 0m0.173s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.015s +sys 0m0.029s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.892s +user 0m2.227s +sys 0m0.374s -real 0m0.763s -user 0m2.607s -sys 0m0.384s + + ============================================================================== + +Exit code: 0 + +real 0m0.925s +user 0m2.248s +sys 0m0.411s + +real 0m0.927s +user 0m2.250s +sys 0m0.411s =============================================================================== -go vet ./... +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.018s +sys 0m0.033s + + + ============================================================================== -real 0m0.092s -user 0m0.150s -sys 0m0.133s +Running: go vet ./... + + +real 0m0.083s +user 0m0.112s +sys 0m0.074s + + + ============================================================================== + +Exit code: 0 + +real 0m0.122s +user 0m0.135s +sys 0m0.119s + +real 0m0.124s +user 0m0.135s +sys 0m0.120s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.027s +sys 0m0.023s + + + ============================================================================== + +Running: go fix ./... + real 0m0.025s -user 0m0.024s -sys 0m0.026s +user 0m0.022s +sys 0m0.029s + + + ============================================================================== + +Exit code: 0 + +real 0m0.066s +user 0m0.055s +sys 0m0.065s + +real 0m0.069s +user 0m0.056s +sys 0m0.067s =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.026s +sys 0m0.021s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.429s +user 0m1.292s +sys 0m0.260s + + + ============================================================================== + +Exit code: 0 + +real 0m0.464s +user 0m1.323s +sys 0m0.291s + +real 0m0.466s +user 0m1.324s +sys 0m0.291s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.026s +sys 0m0.025s + + + ============================================================================== + +Running: gocyclo . + 9 sublist Sublist sublist.go:19:1 4 sublist BenchmarkSublist sublist_test.go:17:1 3 sublist TestSublist sublist_test.go:7:1 1 sublist ExampleSublist sublist_examples_test.go:7:1 1 sublist ListToString sublist.go:10:1 -real 0m0.002s +real 0m0.003s user 0m0.001s sys 0m0.001s + + ============================================================================== + +Exit code: 0 + +real 0m0.038s +user 0m0.036s +sys 0m0.031s + +real 0m0.040s +user 0m0.036s +sys 0m0.032s + =============================================================================== -misspell . +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . -real 0m0.022s -user 0m0.029s -sys 0m0.009s + +real 0m0.021s +user 0m0.024s +sys 0m0.011s + + + ============================================================================== + +Exit code: 0 + +real 0m0.031s +user 0m0.032s +sys 0m0.016s + +real 0m0.033s +user 0m0.033s +sys 0m0.017s =============================================================================== -gosec ./... -[gosec] 2023/03/04 20:43:59 Including rules: default -[gosec] 2023/03/04 20:43:59 Excluding rules: default -[gosec] 2023/03/04 20:43:59 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/sublist -2023/03/04 20:43:59 internal error: package "fmt" without types was imported from "command-line-arguments" +Running: ../../.github/citools/go/go-lint-gosec -real 0m0.118s -user 0m0.148s -sys 0m0.102s +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.034s +user 0m0.029s +sys 0m0.026s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:31:24 Including rules: default +[gosec] 2023/09/07 00:31:24 Excluding rules: default +[gosec] 2023/09/07 00:31:24 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/sublist +[gosec] 2023/09/07 00:31:24 Checking package: sublist +[gosec] 2023/09/07 00:31:24 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/sublist/relations.go +[gosec] 2023/09/07 00:31:24 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/sublist/sublist.go +Results: + + +Summary: + Gosec : dev + Files : 2 + Lines : 53 + Nosec : 0 + Issues : 0 + + +real 0m0.119s +user 0m0.130s +sys 0m0.105s + + + ============================================================================== + +Exit code: 0 + +real 0m0.164s +user 0m0.167s +sys 0m0.138s + +real 0m0.167s +user 0m0.168s +sys 0m0.139s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.026s +sys 0m0.031s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestSublist === RUN TestSublist/empty_lists === RUN TestSublist/empty_list_within_non_empty_list @@ -154,43 +627,56 @@ gotest -v -covermode=count -coverprofile coverage.out ./... === RUN ExampleSublist --- PASS: ExampleSublist (0.00s) PASS - sublist coverage: 100.0% of statements -ok sublist 0.003s coverage: 100.0% of statements +coverage: 100.0% of statements +ok sublist 0.002s coverage: 100.0% of statements -real 0m0.190s -user 0m0.342s -sys 0m0.229s +real 0m0.193s +user 0m0.238s +sys 0m0.158s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + sublist/sublist.go:10: ListToString 100.0% sublist/sublist.go:19: Sublist 100.0% total: (statements) 100.0% -real 0m0.061s -user 0m0.111s -sys 0m0.098s +real 0m0.052s +user 0m0.061s +sys 0m0.079s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.066s -user 0m0.089s -sys 0m0.112s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +real 0m0.054s +user 0m0.081s +sys 0m0.071s -real 0m0.026s -user 0m0.045s -sys 0m0.061s -=============================================================================== + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.018s +user 0m0.016s +sys 0m0.030s + +real 0m0.018s +user 0m0.016s +sys 0m0.030s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestSublist === RUN TestSublist/empty_lists === RUN TestSublist/empty_list_within_non_empty_list @@ -232,12 +718,25 @@ gotest -v -race -covermode=atomic ./... === RUN ExampleSublist --- PASS: ExampleSublist (0.00s) PASS - sublist coverage: 100.0% of statements -ok sublist 0.021s coverage: 100.0% of statements +coverage: 100.0% of statements +ok sublist 1.014s coverage: 100.0% of statements + +real 0m1.255s +user 0m0.299s +sys 0m0.188s + -real 0m0.250s -user 0m0.354s -sys 0m0.236s + ============================================================================== + +Exit code: 0 + +real 0m1.615s +user 0m0.728s +sys 0m0.570s + +real 0m1.617s +user 0m0.728s +sys 0m0.571s =============================================================================== @@ -250,13 +749,13 @@ goarch: amd64 pkg: sublist cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkSublist -BenchmarkSublist-16 108157 10211 ns/op 2401 B/op 217 allocs/op +BenchmarkSublist-8 97245 10959 ns/op 2400 B/op 217 allocs/op PASS -ok sublist 1.222s +ok sublist 1.195s -real 0m1.384s -user 0m1.568s -sys 0m0.218s +real 0m1.361s +user 0m1.424s +sys 0m0.178s =============================================================================== @@ -304,33 +803,57 @@ gotest -v -tags bonus PASS ok sublist 0.002s -real 0m0.145s -user 0m0.265s -sys 0m0.208s +real 0m0.126s +user 0m0.177s +sys 0m0.122s =============================================================================== benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -Sublist-16 10.3µs ± 0% 10.2µs ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -Sublist-16 2.40kB ± 0% 2.40kB ± 0% ~ (all equal) - -name old allocs/op new allocs/op delta -Sublist-16 217 ± 0% 217 ± 0% ~ (all equal) - -real 0m0.004s -user 0m0.002s -sys 0m0.005s +benchstat-old.txt:5: missing iteration count +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: sublist +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-old.txt │ benchstat-new.txt │ + │ sec/op │ sec/op vs base │ +Sublist-16 10.21µ ± ∞ ¹ +Sublist-8 10.96µ ± ∞ ¹ +geomean 10.21µ 10.96µ ? ² ³ +¹ need >= 6 samples for confidence interval at level 0.95 +² benchmark set differs from baseline; geomeans may not be comparable +³ ratios must be >0 to compute geomean + + │ benchstat-old.txt │ benchstat-new.txt │ + │ B/op │ B/op vs base │ +Sublist-16 2.345Ki ± ∞ ¹ +Sublist-8 2.344Ki ± ∞ ¹ +geomean 2.345Ki 2.344Ki ? ² ³ +¹ need >= 6 samples for confidence interval at level 0.95 +² benchmark set differs from baseline; geomeans may not be comparable +³ ratios must be >0 to compute geomean + + │ benchstat-old.txt │ benchstat-new.txt │ + │ allocs/op │ allocs/op vs base │ +Sublist-16 217.0 ± ∞ ¹ +Sublist-8 217.0 ± ∞ ¹ +geomean 217.0 217.0 ? ² ³ +¹ need >= 6 samples for confidence interval at level 0.95 +² benchmark set differs from baseline; geomeans may not be comparable +³ ratios must be >0 to compute geomean + +real 0m0.003s +user 0m0.001s +sys 0m0.002s =============================================================================== gomarkdoc --output sublist-doc.md -real 0m0.009s -user 0m0.007s -sys 0m0.003s +real 0m0.011s +user 0m0.004s +sys 0m0.008s =============================================================================== @@ -362,9 +885,9 @@ func Sublist(l1, l2 []int) Relation Sublist returns the relationship between two lists. -real 0m0.038s -user 0m0.038s -sys 0m0.030s +real 0m0.044s +user 0m0.028s +sys 0m0.040s =============================================================================== diff --git a/go/sum-of-multiples/benchstat-new.txt b/go/sum-of-multiples/benchstat-new.txt index 3d1544a5..f93197a3 100644 --- a/go/sum-of-multiples/benchstat-new.txt +++ b/go/sum-of-multiples/benchstat-new.txt @@ -1,8 +1,8 @@ goos: linux goarch: amd64 pkg: summultiples -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkSumMultiples -BenchmarkSumMultiples-4 351 3102438 ns/op 444764 B/op 472 allocs/op +BenchmarkSumMultiples-8 1333 910157 ns/op 439389 B/op 364 allocs/op PASS -ok summultiples 1.477s +ok summultiples 1.308s diff --git a/go/sum-of-multiples/benchstat-old.txt b/go/sum-of-multiples/benchstat-old.txt new file mode 100644 index 00000000..3d1544a5 --- /dev/null +++ b/go/sum-of-multiples/benchstat-old.txt @@ -0,0 +1,8 @@ +goos: linux +goarch: amd64 +pkg: summultiples +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkSumMultiples +BenchmarkSumMultiples-4 351 3102438 ns/op 444764 B/op 472 allocs/op +PASS +ok summultiples 1.477s diff --git a/go/sum-of-multiples/coverage.out b/go/sum-of-multiples/coverage.out index 5f80f9e0..8f44ac42 100644 --- a/go/sum-of-multiples/coverage.out +++ b/go/sum-of-multiples/coverage.out @@ -1,23 +1,23 @@ mode: count summultiples/sum_of_multiples.go:5.51,6.38 1 17 -summultiples/sum_of_multiples.go:10.2,17.29 5 16 -summultiples/sum_of_multiples.go:25.2,28.31 2 16 -summultiples/sum_of_multiples.go:32.2,32.12 1 16 summultiples/sum_of_multiples.go:6.38,8.3 1 1 +summultiples/sum_of_multiples.go:10.2,17.29 5 16 summultiples/sum_of_multiples.go:17.29,18.30 1 32 summultiples/sum_of_multiples.go:18.30,19.16 1 72991 summultiples/sum_of_multiples.go:19.16,21.5 1 13904 +summultiples/sum_of_multiples.go:25.2,28.31 2 16 summultiples/sum_of_multiples.go:28.31,30.3 1 9066 +summultiples/sum_of_multiples.go:32.2,32.12 1 16 summultiples/sum_of_multiples.go:36.36,37.21 1 17 -summultiples/sum_of_multiples.go:41.2,47.26 4 17 -summultiples/sum_of_multiples.go:51.2,51.24 1 17 -summultiples/sum_of_multiples.go:55.2,55.17 1 17 summultiples/sum_of_multiples.go:37.21,39.3 1 0 +summultiples/sum_of_multiples.go:41.2,47.26 4 17 summultiples/sum_of_multiples.go:47.26,49.3 1 61 +summultiples/sum_of_multiples.go:51.2,51.24 1 17 summultiples/sum_of_multiples.go:51.24,53.3 1 44 +summultiples/sum_of_multiples.go:55.2,55.17 1 17 summultiples/sum_of_multiples.go:59.37,60.21 1 17 -summultiples/sum_of_multiples.go:64.2,66.26 2 17 -summultiples/sum_of_multiples.go:72.2,72.17 1 17 summultiples/sum_of_multiples.go:60.21,62.3 1 0 +summultiples/sum_of_multiples.go:64.2,66.26 2 17 summultiples/sum_of_multiples.go:66.26,67.12 1 61 summultiples/sum_of_multiples.go:67.12,69.4 1 55 +summultiples/sum_of_multiples.go:72.2,72.17 1 17 diff --git a/go/sum-of-multiples/run-tests-go.txt b/go/sum-of-multiples/run-tests-go.txt index 468c56dc..987ee24c 100644 --- a/go/sum-of-multiples/run-tests-go.txt +++ b/go/sum-of-multiples/run-tests-go.txt @@ -5,56 +5,566 @@ Go packages: summultiples =============================================================================== -golint ./... +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.041s -user 0m0.020s -sys 0m0.044s +Running GoLangCi-Lint -=============================================================================== +Go version: -revive -formatter=stylish ./... + go version go1.21.0 linux/amd64 -real 0m0.020s -user 0m0.008s + + ============================================================================== + +Running: go clean ./... + + +real 0m0.014s +user 0m0.002s sys 0m0.015s + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +sum_of_multiples_test.go:8:27: Using the variable on range scope `tc` in function literal (scopelint) + actual := SumMultiples(tc.limit, tc.divisors...) + ^ +sum_of_multiples_test.go:9:17: Using the variable on range scope `tc` in function literal (scopelint) + if actual != tc.expected { + ^ +sum_of_multiples_test.go:10:54: Using the variable on range scope `tc` in function literal (scopelint) + t.Errorf("SumMultiples(%d, %#v) = %d, want: %d", tc.limit, tc.divisors, actual, tc.expected) + ^ +sum_of_multiples_test.go:20:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:8:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +sum_of_multiples_test.go:5:1: Function TestSumMultiples missing the call to method parallel (paralleltest) +func TestSumMultiples(t *testing.T) { +^ +sum_of_multiples_test.go:6:2: Range statement for test TestSumMultiples missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +cases_test.go:1:9: package should be `summultiples_test` instead of `summultiples` (testpackage) +package summultiples + ^ +sum_of_multiples_examples_test.go:1:9: package should be `summultiples_test` instead of `summultiples` (testpackage) +package summultiples + ^ +sum_of_multiples_test.go:1:9: package should be `summultiples_test` instead of `summultiples` (testpackage) +package summultiples + ^ + +real 0m0.509s +user 0m0.750s +sys 0m0.465s + + + ============================================================================== + +Exit code: -1 + +real 0m0.544s +user 0m0.764s +sys 0m0.496s + +real 0m0.547s +user 0m0.765s +sys 0m0.498s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.007s +sys 0m0.007s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.052s +user 0m0.022s +sys 0m0.045s + + + ============================================================================== + +Exit code: 0 + +real 0m0.076s +user 0m0.037s +sys 0m0.062s + +real 0m0.079s +user 0m0.038s +sys 0m0.065s + =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.264s -user 0m0.260s -sys 0m0.258s +real 0m0.001s +user 0m0.000s +sys 0m0.001s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.009s +sys 0m0.016s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." +internal error: package "fmt" without types was imported from "summultiples [summultiples.test]" + +real 0m0.095s +user 0m0.119s +sys 0m0.125s + + + ============================================================================== + +Exit code: -1 + +real 0m0.131s +user 0m0.137s +sys 0m0.156s + +real 0m0.133s +user 0m0.139s +sys 0m0.156s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.006s +sys 0m0.012s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.180s +user 0m0.211s +sys 0m0.122s + + + ============================================================================== + +Exit code: 0 + +real 0m0.207s +user 0m0.222s +sys 0m0.146s + +real 0m0.209s +user 0m0.222s +sys 0m0.148s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: -real 0m0.317s -user 0m0.300s -sys 0m0.396s + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.004s +sys 0m0.015s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.873s +user 0m2.110s +sys 0m0.306s + + + ============================================================================== + +Exit code: 0 + +real 0m0.901s +user 0m2.121s +sys 0m0.331s + +real 0m0.902s +user 0m2.122s +sys 0m0.332s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.006s +sys 0m0.011s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.094s +user 0m0.099s +sys 0m0.107s + + + ============================================================================== + +Exit code: 0 + +real 0m0.119s +user 0m0.111s +sys 0m0.127s + +real 0m0.121s +user 0m0.111s +sys 0m0.128s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix -real 0m0.421s -user 0m0.363s -sys 0m0.437s +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.008s +sys 0m0.008s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.016s +user 0m0.008s +sys 0m0.012s + + + ============================================================================== + +Exit code: 0 + +real 0m0.040s +user 0m0.022s +sys 0m0.027s + +real 0m0.042s +user 0m0.023s +sys 0m0.028s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-errcheck -real 0m2.555s -user 0m4.086s -sys 0m1.405s +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.005s +sys 0m0.011s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.442s +user 0m1.319s +sys 0m0.277s + + + ============================================================================== + +Exit code: 0 + +real 0m0.467s +user 0m1.331s +sys 0m0.296s + +real 0m0.469s +user 0m1.331s +sys 0m0.298s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.008s +sys 0m0.007s + + + ============================================================================== + +Running: gocyclo . + +7 summultiples SumMultiples sum_of_multiples.go:5:1 +4 summultiples BenchmarkSumMultiples sum_of_multiples_test.go:16:1 +4 summultiples RemoveZeros sum_of_multiples.go:59:1 +4 summultiples DedupSlice sum_of_multiples.go:36:1 +3 summultiples TestSumMultiples sum_of_multiples_test.go:5:1 +1 summultiples ExampleRemoveZeros sum_of_multiples_examples_test.go:29:1 +1 summultiples ExampleDedupSlice sum_of_multiples_examples_test.go:17:1 +1 summultiples ExampleSumMultiples sum_of_multiples_examples_test.go:8:1 + +real 0m0.002s +user 0m0.000s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.024s +user 0m0.012s +sys 0m0.020s + +real 0m0.026s +user 0m0.012s +sys 0m0.021s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.028s +user 0m0.032s +sys 0m0.013s + + + ============================================================================== + +Exit code: 0 + +real 0m0.037s +user 0m0.036s +sys 0m0.021s + +real 0m0.039s +user 0m0.037s +sys 0m0.022s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.007s +sys 0m0.024s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:31:30 Including rules: default +[gosec] 2023/09/07 00:31:30 Excluding rules: default +[gosec] 2023/09/07 00:31:30 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/sum-of-multiples +[gosec] 2023/09/07 00:31:30 Checking package: summultiples +[gosec] 2023/09/07 00:31:30 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/sum-of-multiples/sum_of_multiples.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 73 + Nosec : 0 + Issues : 0 + + +real 0m0.092s +user 0m0.082s +sys 0m0.052s + + + ============================================================================== + +Exit code: 0 + +real 0m0.136s +user 0m0.097s +sys 0m0.095s + +real 0m0.138s +user 0m0.097s +sys 0m0.096s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.010s +sys 0m0.009s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestSumMultiples === RUN TestSumMultiples/no_multiples_within_limit === RUN TestSumMultiples/one_factor_has_multiples_within_limit @@ -72,7 +582,7 @@ gotest -v -covermode=count -coverprofile coverage.out ./... === RUN TestSumMultiples/the_only_multiple_of_0_is_0 === RUN TestSumMultiples/the_factor_0_does_not_affect_the_sum_of_multiples_of_other_factors === RUN TestSumMultiples/solutions_using_include-exclude_must_extend_to_cardinality_greater_than_3 ---- PASS: TestSumMultiples (0.01s) +--- PASS: TestSumMultiples (0.00s) --- PASS: TestSumMultiples/no_multiples_within_limit (0.00s) --- PASS: TestSumMultiples/one_factor_has_multiples_within_limit (0.00s) --- PASS: TestSumMultiples/more_than_one_multiple_within_limit (0.00s) @@ -97,35 +607,42 @@ gotest -v -covermode=count -coverprofile coverage.out ./... --- PASS: ExampleRemoveZeros (0.00s) PASS coverage: 93.5% of statements -ok summultiples 0.014s coverage: 93.5% of statements +ok summultiples 0.004s coverage: 93.5% of statements -real 0m0.595s -user 0m0.627s -sys 0m0.471s +real 0m0.197s +user 0m0.251s +sys 0m0.169s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + summultiples/sum_of_multiples.go:5: SumMultiples 100.0% summultiples/sum_of_multiples.go:36: DedupSlice 90.0% summultiples/sum_of_multiples.go:59: RemoveZeros 85.7% total: (statements) 93.5% -real 0m0.084s -user 0m0.050s -sys 0m0.068s +real 0m0.020s +user 0m0.012s +sys 0m0.014s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.078s -user 0m0.043s -sys 0m0.077s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +real 0m0.025s +user 0m0.015s +sys 0m0.018s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt 36 func DedupSlice(slice []int) []int { 37 if len(slice) == 0 { @@ -167,13 +684,19 @@ gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annota 73 } -real 0m0.037s -user 0m0.017s -sys 0m0.037s +real 0m0.011s +user 0m0.004s +sys 0m0.012s -=============================================================================== +real 0m0.011s +user 0m0.004s +sys 0m0.012s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestSumMultiples === RUN TestSumMultiples/no_multiples_within_limit === RUN TestSumMultiples/one_factor_has_multiples_within_limit @@ -191,23 +714,23 @@ gotest -v -race -covermode=atomic ./... === RUN TestSumMultiples/the_only_multiple_of_0_is_0 === RUN TestSumMultiples/the_factor_0_does_not_affect_the_sum_of_multiples_of_other_factors === RUN TestSumMultiples/solutions_using_include-exclude_must_extend_to_cardinality_greater_than_3 ---- PASS: TestSumMultiples (0.04s) +--- PASS: TestSumMultiples (0.01s) --- PASS: TestSumMultiples/no_multiples_within_limit (0.00s) --- PASS: TestSumMultiples/one_factor_has_multiples_within_limit (0.00s) --- PASS: TestSumMultiples/more_than_one_multiple_within_limit (0.00s) --- PASS: TestSumMultiples/more_than_one_factor_with_multiples_within_limit (0.00s) --- PASS: TestSumMultiples/each_multiple_is_only_counted_once (0.00s) - --- PASS: TestSumMultiples/a_much_larger_limit (0.01s) + --- PASS: TestSumMultiples/a_much_larger_limit (0.00s) --- PASS: TestSumMultiples/three_factors (0.00s) --- PASS: TestSumMultiples/factors_not_relatively_prime (0.00s) --- PASS: TestSumMultiples/some_pairs_of_factors_relatively_prime_and_some_not (0.00s) --- PASS: TestSumMultiples/one_factor_is_a_multiple_of_another (0.00s) - --- PASS: TestSumMultiples/much_larger_factors (0.01s) + --- PASS: TestSumMultiples/much_larger_factors (0.00s) --- PASS: TestSumMultiples/all_numbers_are_multiples_of_1 (0.00s) --- PASS: TestSumMultiples/no_factors_means_an_empty_sum (0.00s) --- PASS: TestSumMultiples/the_only_multiple_of_0_is_0 (0.00s) --- PASS: TestSumMultiples/the_factor_0_does_not_affect_the_sum_of_multiples_of_other_factors (0.00s) - --- PASS: TestSumMultiples/solutions_using_include-exclude_must_extend_to_cardinality_greater_than_3 (0.02s) + --- PASS: TestSumMultiples/solutions_using_include-exclude_must_extend_to_cardinality_greater_than_3 (0.01s) === RUN ExampleSumMultiples --- PASS: ExampleSumMultiples (0.00s) === RUN ExampleDedupSlice @@ -216,27 +739,43 @@ gotest -v -race -covermode=atomic ./... --- PASS: ExampleRemoveZeros (0.00s) PASS coverage: 93.5% of statements -ok summultiples (cached) coverage: 93.5% of statements +ok summultiples 1.029s coverage: 93.5% of statements + +real 0m1.264s +user 0m0.282s +sys 0m0.181s + -real 0m0.385s -user 0m0.433s -sys 0m0.373s + ============================================================================== + +Exit code: 0 + +real 0m1.548s +user 0m0.583s +sys 0m0.416s + +real 0m1.551s +user 0m0.585s +sys 0m0.417s =============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: summultiples -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkSumMultiples -BenchmarkSumMultiples-4 351 3102438 ns/op 444764 B/op 472 allocs/op +BenchmarkSumMultiples-8 1333 910157 ns/op 439389 B/op 364 allocs/op PASS -ok summultiples 1.477s +ok summultiples 1.308s -real 0m2.294s -user 0m2.854s -sys 0m0.966s +real 0m1.464s +user 0m1.510s +sys 0m0.185s =============================================================================== @@ -258,7 +797,7 @@ gotest -v -tags bonus === RUN TestSumMultiples/the_only_multiple_of_0_is_0 === RUN TestSumMultiples/the_factor_0_does_not_affect_the_sum_of_multiples_of_other_factors === RUN TestSumMultiples/solutions_using_include-exclude_must_extend_to_cardinality_greater_than_3 ---- PASS: TestSumMultiples (0.01s) +--- PASS: TestSumMultiples (0.00s) --- PASS: TestSumMultiples/no_multiples_within_limit (0.00s) --- PASS: TestSumMultiples/one_factor_has_multiples_within_limit (0.00s) --- PASS: TestSumMultiples/more_than_one_multiple_within_limit (0.00s) @@ -274,7 +813,7 @@ gotest -v -tags bonus --- PASS: TestSumMultiples/no_factors_means_an_empty_sum (0.00s) --- PASS: TestSumMultiples/the_only_multiple_of_0_is_0 (0.00s) --- PASS: TestSumMultiples/the_factor_0_does_not_affect_the_sum_of_multiples_of_other_factors (0.00s) - --- PASS: TestSumMultiples/solutions_using_include-exclude_must_extend_to_cardinality_greater_than_3 (0.01s) + --- PASS: TestSumMultiples/solutions_using_include-exclude_must_extend_to_cardinality_greater_than_3 (0.00s) === RUN ExampleSumMultiples --- PASS: ExampleSumMultiples (0.00s) === RUN ExampleDedupSlice @@ -282,85 +821,63 @@ gotest -v -tags bonus === RUN ExampleRemoveZeros --- PASS: ExampleRemoveZeros (0.00s) PASS -ok summultiples 0.033s +ok summultiples 0.004s -real 0m0.630s -user 0m0.772s -sys 0m0.530s +real 0m0.138s +user 0m0.206s +sys 0m0.137s =============================================================================== -No old benchmarks to run benchstat against. - -=============================================================================== - -go vet ./... - -real 0m0.439s -user 0m0.589s -sys 0m0.312s - -=============================================================================== - -go fix ./... - -real 0m0.059s -user 0m0.040s -sys 0m0.041s - -=============================================================================== - -gocyclo . -7 summultiples SumMultiples sum_of_multiples.go:5:1 -4 summultiples BenchmarkSumMultiples sum_of_multiples_test.go:16:1 -4 summultiples RemoveZeros sum_of_multiples.go:59:1 -4 summultiples DedupSlice sum_of_multiples.go:36:1 -3 summultiples TestSumMultiples sum_of_multiples_test.go:5:1 -1 summultiples ExampleRemoveZeros sum_of_multiples_examples_test.go:29:1 -1 summultiples ExampleDedupSlice sum_of_multiples_examples_test.go:17:1 -1 summultiples ExampleSumMultiples sum_of_multiples_examples_test.go:8:1 - -real 0m0.004s -user 0m0.003s -sys 0m0.003s - -=============================================================================== - -misspell . - -real 0m0.101s -user 0m0.113s -sys 0m0.068s - -=============================================================================== - -gosec ./... -[gosec] 2022/08/28 14:52:53 Including rules: default -[gosec] 2022/08/28 14:52:53 Excluding rules: default -[gosec] 2022/08/28 14:52:53 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/sum-of-multiples -[gosec] 2022/08/28 14:52:53 Checking package: summultiples -[gosec] 2022/08/28 14:52:53 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/sum-of-multiples/sum_of_multiples.go -Results: +benchstat benchstat-old.txt benchstat-new.txt +benchstat-old.txt:5: missing iteration count +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: summultiples +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +SumMultiples-8 910.2µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +SumMultiples-8 429.1Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +SumMultiples-8 364.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +SumMultiples-4 3.102m ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -Summary: - Files: 1 - Lines: 73 - Nosec: 0 - Issues: 0 + │ benchstat-old.txt │ + │ B/op │ +SumMultiples-4 434.3Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + │ benchstat-old.txt │ + │ allocs/op │ +SumMultiples-4 472.0 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.278s -user 0m0.289s -sys 0m0.188s +real 0m0.007s +user 0m0.000s +sys 0m0.004s =============================================================================== gomarkdoc --output summultiples-doc.md -real 0m0.036s -user 0m0.022s -sys 0m0.018s +real 0m0.011s +user 0m0.008s +sys 0m0.003s =============================================================================== @@ -382,9 +899,9 @@ func SumMultiples(limit int, divisors ...int) int below limit. -real 0m0.167s -user 0m0.086s -sys 0m0.146s +real 0m0.033s +user 0m0.015s +sys 0m0.025s =============================================================================== diff --git a/go/the-farm/benchstat-old.txt b/go/the-farm/benchstat-old.txt index 5e74a313..d51c7d1f 100644 --- a/go/the-farm/benchstat-old.txt +++ b/go/the-farm/benchstat-old.txt @@ -1,2 +1,2 @@ PASS -ok thefarm 0.002s +ok thefarm 0.003s diff --git a/go/the-farm/run-tests-go.txt b/go/the-farm/run-tests-go.txt index 3e3d446f..4ca70dce 100644 --- a/go/the-farm/run-tests-go.txt +++ b/go/the-farm/run-tests-go.txt @@ -5,81 +5,459 @@ Go packages: thefarm =============================================================================== -golangci-lint run ./... - -real 0m0.187s -user 0m0.264s -sys 0m0.185s +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.033s +sys 0m0.029s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +the_farm_test.go:17: Function 'TestDivideFood' is too long (145 > 60) (funlen) +func TestDivideFood(t *testing.T) { +the_farm_test.go:126:36: Using the variable on range scope `test` in function literal (scopelint) + gotAmount, gotErr := DivideFood(test.weightFodder, test.cows) + ^ +the_farm_test.go:128:22: Using the variable on range scope `test` in function literal (scopelint) + case gotAmount != test.wantAmount: + ^ +the_farm_test.go:131:6: Using the variable on range scope `test` in function literal (scopelint) + test.weightFodderDescription, + ^ +the_farm.go:29:2: declarations should never be cuddled (wsl) + var retVal float64 + ^ +the_farm.go:30:2: declarations should never be cuddled (wsl) + var retErr error + ^ +the_farm.go:38:3: assignments should only be cuddled with other assignments (wsl) + retVal, retErr = 0, e + ^ +the_farm_test.go:124:2: only one cuddle assignment allowed before range statement (wsl) + for _, test := range tests { + ^ +the_farm.go:35:6: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if e == ErrScaleMalfunction || e == nil { + ^ +the_farm.go:65:5: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint) + if e == ErrScaleMalfunction { + ^ +the_farm_test.go:18:19: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"non-scale error\")" (goerr113) + nonScaleError := errors.New("non-scale error") + ^ +the_farm_test.go:105:29: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"negative fodder\")" (goerr113) + wantErr: errors.New("negative fodder"), + ^ +the_farm_test.go:113:29: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"negative fodder\")" (goerr113) + wantErr: errors.New("negative fodder"), + ^ +the_farm_test.go:121:29: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"division by zero\")" (goerr113) + wantErr: errors.New("division by zero"), + ^ +the_farm_test.go:220:29: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"negative fodder\")" (goerr113) + wantErr: errors.New("negative fodder"), + ^ +the_farm.go:66:27: mnd: Magic number: 2.0, in detected (gomnd) + retVal, retErr = retVal*2.0, nil + ^ +the_farm_test.go:165:1: Function TestDivideFoodSillyNephewError missing the call to method parallel (paralleltest) +func TestDivideFoodSillyNephewError(t *testing.T) { +^ +the_farm_test.go:182:2: Range statement for test TestDivideFoodSillyNephewError missing the call to method parallel in test Run (paralleltest) + for _, test := range tests { + ^ +the_farm_test.go:207:1: Function TestDivideFoodNegativeFodderErrorPrecedence missing the call to method parallel (paralleltest) +func TestDivideFoodNegativeFodderErrorPrecedence(t *testing.T) { +^ +the_farm_test.go:225:2: Range statement for test TestDivideFoodNegativeFodderErrorPrecedence missing the call to method parallel in test Run (paralleltest) + for _, test := range tests { + ^ +the_farm_test.go:1:9: package should be `thefarm_test` instead of `thefarm` (testpackage) +package thefarm + ^ +the_farm.go:28:2: variable name 'e' is too short for the scope of its usage (varnamelen) + fodder, e := weightFodder.FodderAmount() + ^ + +real 0m0.488s +user 0m0.650s +sys 0m0.396s + + + ============================================================================== + +Exit code: -1 + +real 0m0.529s +user 0m0.689s +sys 0m0.436s + +real 0m0.531s +user 0m0.689s +sys 0m0.438s =============================================================================== -golint ./... +Running: ../../.github/citools/go/go-lint-revive -real 0m0.010s -user 0m0.010s -sys 0m0.006s +Running Go Lint Revive -=============================================================================== +Go version: -revive -formatter=stylish ./... + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.026s +sys 0m0.019s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.040s +user 0m0.020s +sys 0m0.029s -real 0m0.009s -user 0m0.002s -sys 0m0.009s + + ============================================================================== + +Exit code: 0 + +real 0m0.077s +user 0m0.058s +sys 0m0.050s + +real 0m0.079s +user 0m0.058s +sys 0m0.052s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.083s -user 0m0.158s -sys 0m0.087s +real 0m0.001s +user 0m0.000s +sys 0m0.001s =============================================================================== -go-consistent -v ./... +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.024s +sys 0m0.017s + + + ============================================================================== + +Running: go-consistent -v ./... + info: check "./." internal error: package "errors" without types was imported from "thefarm" -real 0m0.095s -user 0m0.188s -sys 0m0.166s +real 0m0.100s +user 0m0.151s +sys 0m0.125s + + + ============================================================================== + +Exit code: -1 + +real 0m0.131s +user 0m0.181s +sys 0m0.149s + +real 0m0.133s +user 0m0.183s +sys 0m0.149s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... -real 0m0.148s -user 0m0.224s -sys 0m0.178s + +real 0m0.022s +user 0m0.016s +sys 0m0.028s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.208s +user 0m0.214s +sys 0m0.165s + + + ============================================================================== + +Exit code: 0 + +real 0m0.242s +user 0m0.235s +sys 0m0.203s + +real 0m0.243s +user 0m0.237s +sys 0m0.203s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gocritic -real 0m0.766s -user 0m2.873s -sys 0m0.474s +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.020s +sys 0m0.028s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.812s +user 0m1.688s +sys 0m0.295s + + + ============================================================================== + +Exit code: 0 + +real 0m0.847s +user 0m1.716s +sys 0m0.332s + +real 0m0.849s +user 0m1.716s +sys 0m0.334s =============================================================================== -go vet ./... +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.024s +sys 0m0.024s + + + ============================================================================== + +Running: go vet ./... -real 0m0.089s -user 0m0.229s -sys 0m0.167s + +real 0m0.076s +user 0m0.108s +sys 0m0.081s + + + ============================================================================== + +Exit code: 0 + +real 0m0.115s +user 0m0.139s +sys 0m0.113s + +real 0m0.118s +user 0m0.140s +sys 0m0.114s =============================================================================== -go fix ./... +Running: ../../.github/citools/go/go-fixer-go_fix -real 0m0.026s +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s user 0m0.020s -sys 0m0.038s +sys 0m0.022s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.028s +user 0m0.024s +sys 0m0.027s + + + ============================================================================== + +Exit code: 0 + +real 0m0.061s +user 0m0.050s +sys 0m0.060s + +real 0m0.063s +user 0m0.051s +sys 0m0.061s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.020s +sys 0m0.021s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.455s +user 0m1.317s +sys 0m0.247s + + + ============================================================================== + +Exit code: 0 + +real 0m0.488s +user 0m1.339s +sys 0m0.282s + +real 0m0.490s +user 0m1.341s +sys 0m0.283s =============================================================================== -gocyclo . +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.020s +sys 0m0.024s + + + ============================================================================== + +Running: gocyclo . + 9 thefarm TestDivideFood the_farm_test.go:17:1 9 thefarm DivideFood the_farm.go:27:1 4 thefarm TestDivideFoodNegativeFodderErrorPrecedence the_farm_test.go:207:1 @@ -88,32 +466,139 @@ gocyclo . 1 thefarm (*SillyNephewError).Error the_farm.go:16:1 real 0m0.002s -user 0m0.001s -sys 0m0.001s +user 0m0.002s +sys 0m0.000s + + + ============================================================================== + +Exit code: 0 + +real 0m0.034s +user 0m0.027s +sys 0m0.034s + +real 0m0.036s +user 0m0.028s +sys 0m0.035s =============================================================================== -misspell . +Running: ../../.github/citools/go/go-lint-misspell -real 0m0.022s -user 0m0.020s -sys 0m0.015s +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.034s +user 0m0.050s +sys 0m0.014s + + + ============================================================================== + +Exit code: 0 + +real 0m0.045s +user 0m0.054s +sys 0m0.027s + +real 0m0.047s +user 0m0.054s +sys 0m0.029s =============================================================================== -gosec ./... -[gosec] 2023/03/04 21:11:44 Including rules: default -[gosec] 2023/03/04 21:11:44 Excluding rules: default -[gosec] 2023/03/04 21:11:44 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/the-farm -2023/03/04 21:11:44 internal error: package "errors" without types was imported from "command-line-arguments" +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 -real 0m0.120s -user 0m0.158s -sys 0m0.099s + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.024s +sys 0m0.026s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:31:36 Including rules: default +[gosec] 2023/09/07 00:31:36 Excluding rules: default +[gosec] 2023/09/07 00:31:36 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/the-farm +[gosec] 2023/09/07 00:31:36 Checking package: thefarm +[gosec] 2023/09/07 00:31:36 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/the-farm/the_farm.go +[gosec] 2023/09/07 00:31:36 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/the-farm/types.go +Results: + + +Summary: + Gosec : dev + Files : 2 + Lines : 94 + Nosec : 0 + Issues : 0 + + +real 0m0.151s +user 0m0.153s +sys 0m0.132s + + + ============================================================================== + +Exit code: 0 + +real 0m0.188s +user 0m0.185s +sys 0m0.168s + +real 0m0.189s +user 0m0.187s +sys 0m0.168s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.020s +sys 0m0.021s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestDivideFood === RUN TestDivideFood/100_fodder_for_10_cows === RUN TestDivideFood/10_fodder_for_10_cows @@ -151,43 +636,56 @@ gotest -v -covermode=count -coverprofile coverage.out ./... --- PASS: TestDivideFoodNegativeFodderErrorPrecedence (0.00s) --- PASS: TestDivideFoodNegativeFodderErrorPrecedence/Negative_fodder_and_negative_cows (0.00s) PASS - thefarm coverage: 100.0% of statements -ok thefarm 0.004s coverage: 100.0% of statements +coverage: 100.0% of statements +ok thefarm 0.003s coverage: 100.0% of statements -real 0m0.156s -user 0m0.286s -sys 0m0.204s +real 0m0.194s +user 0m0.287s +sys 0m0.122s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + thefarm/the_farm.go:16: Error 100.0% thefarm/the_farm.go:27: DivideFood 100.0% total: (statements) 100.0% -real 0m0.074s -user 0m0.131s -sys 0m0.147s +real 0m0.051s +user 0m0.058s +sys 0m0.057s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.061s -user 0m0.104s -sys 0m0.096s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt +real 0m0.070s +user 0m0.076s +sys 0m0.072s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt real 0m0.020s -user 0m0.020s -sys 0m0.026s +user 0m0.025s +sys 0m0.020s -=============================================================================== +real 0m0.021s +user 0m0.025s +sys 0m0.020s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... -gotest -v -race -covermode=atomic ./... === RUN TestDivideFood === RUN TestDivideFood/100_fodder_for_10_cows === RUN TestDivideFood/10_fodder_for_10_cows @@ -225,12 +723,25 @@ gotest -v -race -covermode=atomic ./... --- PASS: TestDivideFoodNegativeFodderErrorPrecedence (0.00s) --- PASS: TestDivideFoodNegativeFodderErrorPrecedence/Negative_fodder_and_negative_cows (0.00s) PASS - thefarm coverage: 100.0% of statements -ok thefarm (cached) coverage: 100.0% of statements +coverage: 100.0% of statements +ok thefarm 1.012s coverage: 100.0% of statements -real 0m0.104s -user 0m0.284s -sys 0m0.203s +real 0m1.256s +user 0m0.282s +sys 0m0.146s + + + ============================================================================== + +Exit code: 0 + +real 0m1.628s +user 0m0.757s +sys 0m0.446s + +real 0m1.630s +user 0m0.757s +sys 0m0.447s =============================================================================== @@ -241,9 +752,9 @@ gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt PASS ok thefarm 0.003s -real 0m0.156s -user 0m0.255s -sys 0m0.199s +real 0m0.147s +user 0m0.176s +sys 0m0.116s =============================================================================== @@ -287,25 +798,25 @@ gotest -v -tags bonus PASS ok thefarm 0.002s -real 0m0.152s -user 0m0.272s -sys 0m0.225s +real 0m0.149s +user 0m0.198s +sys 0m0.157s =============================================================================== benchstat benchstat-old.txt benchstat-new.txt -real 0m0.005s -user 0m0.002s -sys 0m0.006s +real 0m0.002s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output thefarm-doc.md -real 0m0.011s -user 0m0.007s -sys 0m0.005s +real 0m0.022s +user 0m0.016s +sys 0m0.007s =============================================================================== @@ -347,9 +858,9 @@ type WeightFodder interface { WeightFodder returns the amount of available fodder. -real 0m0.230s -user 0m0.078s -sys 0m0.066s +real 0m0.403s +user 0m0.039s +sys 0m0.038s =============================================================================== diff --git a/go/tournament/benchstat-new.txt b/go/tournament/benchstat-new.txt index 6a7b9ccf..9e5baf07 100644 --- a/go/tournament/benchstat-new.txt +++ b/go/tournament/benchstat-new.txt @@ -1,3 +1,149389 @@ +goos: linux +goarch: amd64 +pkg: tournament +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkTally + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -20,11 +149406,6 @@ -goos: linux -goarch: amd64 -pkg: tournament -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkTally-4 @@ -29636,6 +179017,6 @@ BenchmarkTally-4 - 1246 967021 ns/op 54938 B/op 4822 allocs/op +BenchmarkTally-8 5833 205345 ns/op 54497 B/op 4822 allocs/op PASS -ok tournament 1.370s +ok tournament 1.710s diff --git a/go/tournament/benchstat-old.txt b/go/tournament/benchstat-old.txt index 5b15eb3e..6a7b9ccf 100644 --- a/go/tournament/benchstat-old.txt +++ b/go/tournament/benchstat-old.txt @@ -29636,12612 +29636,6 @@ BenchmarkTally-4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1819 925656 ns/op 54936 B/op 4822 allocs/op + 1246 967021 ns/op 54938 B/op 4822 allocs/op PASS -ok tournament 1.813s +ok tournament 1.370s diff --git a/go/tournament/coverage-annotations.txt b/go/tournament/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/tournament/coverage.html b/go/tournament/coverage.html index 9f4cccf3..0c032231 100644 --- a/go/tournament/coverage.html +++ b/go/tournament/coverage.html @@ -236,11 +236,11 @@ } // fmt.Printf("rows: %#v\n", rows) - sort.Slice(rows, func(i, j int) bool { + sort.Slice(rows, func(i, j int) bool { if rows[i].points == rows[j].points { return rows[i].name < rows[j].name } - return rows[i].points > rows[j].points + return rows[i].points > rows[j].points }) // fmt.Printf("rows: %#v\n", rows) diff --git a/go/tournament/coverage.out b/go/tournament/coverage.out index b6bd347b..28e0c183 100644 --- a/go/tournament/coverage.out +++ b/go/tournament/coverage.out @@ -1,37 +1,37 @@ mode: count tournament/tournament.go:28.54,39.18 8 9 -tournament/tournament.go:60.2,60.21 1 9 -tournament/tournament.go:64.2,64.29 1 5 -tournament/tournament.go:148.2,154.26 5 5 -tournament/tournament.go:159.2,159.39 1 5 -tournament/tournament.go:167.2,167.25 1 5 -tournament/tournament.go:171.2,171.11 1 5 -tournament/tournament.go:176.2,176.30 1 5 -tournament/tournament.go:181.2,181.30 1 5 -tournament/tournament.go:186.2,186.12 1 5 tournament/tournament.go:39.18,45.15 3 1491 tournament/tournament.go:45.15,50.20 2 1482 -tournament/tournament.go:56.4,56.24 1 1445 tournament/tournament.go:50.20,53.13 3 37 +tournament/tournament.go:56.4,56.24 1 1445 +tournament/tournament.go:60.2,60.21 1 9 tournament/tournament.go:60.21,62.3 1 4 +tournament/tournament.go:64.2,64.29 1 5 tournament/tournament.go:64.29,73.23 2 37 -tournament/tournament.go:77.3,82.38 4 28 -tournament/tournament.go:90.3,90.38 1 28 -tournament/tournament.go:111.3,111.17 1 28 -tournament/tournament.go:138.3,145.23 5 28 tournament/tournament.go:73.23,74.12 1 9 +tournament/tournament.go:77.3,82.38 4 28 tournament/tournament.go:82.38,84.4 1 16 tournament/tournament.go:84.9,87.4 2 12 +tournament/tournament.go:90.3,90.38 1 28 tournament/tournament.go:90.38,92.4 1 20 tournament/tournament.go:92.9,95.4 2 8 +tournament/tournament.go:111.3,111.17 1 28 tournament/tournament.go:112.14,119.16 3 15 tournament/tournament.go:120.15,127.21 3 8 tournament/tournament.go:128.15,136.18 4 5 +tournament/tournament.go:138.3,145.23 5 28 +tournament/tournament.go:148.2,154.26 5 5 tournament/tournament.go:154.26,156.3 1 20 -tournament/tournament.go:159.39,160.39 1 26 -tournament/tournament.go:163.3,163.41 1 23 +tournament/tournament.go:159.2,159.39 1 5 +tournament/tournament.go:159.39,160.39 1 25 tournament/tournament.go:160.39,162.4 1 3 +tournament/tournament.go:163.3,163.41 1 22 +tournament/tournament.go:167.2,167.25 1 5 tournament/tournament.go:167.25,169.3 1 20 +tournament/tournament.go:171.2,171.11 1 5 tournament/tournament.go:171.11,174.3 2 1 +tournament/tournament.go:176.2,176.30 1 5 tournament/tournament.go:176.30,179.3 2 280 +tournament/tournament.go:181.2,181.30 1 5 tournament/tournament.go:181.30,184.3 2 1120 +tournament/tournament.go:186.2,186.12 1 5 diff --git a/go/tournament/run-tests-go.txt b/go/tournament/run-tests-go.txt index 3399d0bd..5d917e3b 100644 --- a/go/tournament/run-tests-go.txt +++ b/go/tournament/run-tests-go.txt @@ -5,72 +5,661 @@ Go packages: tournament =============================================================================== -golint tournament +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.044s +user 0m0.039s +sys 0m0.071s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +tournament_examples_test.go:23:7: Error return value is not checked (errcheck) + Tally(reader, &buffer) + ^ +tournament_test.go:145:9: Error return value is not checked (errcheck) + Tally(strings.NewReader(tt.input), &buffer) + ^ +tournament_test.go:149:9: Error return value is not checked (errcheck) + Tally(strings.NewReader(s), &buffer) + ^ +tournament.go:138:3: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo) + fmt.Println() + ^ +tournament.go:172:3: use of `fmt.Print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo) + fmt.Print(header) + ^ +tournament.go:173:3: use of `fmt.Print` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo) + fmt.Print(output) + ^ +tournament.go:28: Function 'Tally' has too many statements (68 > 40) (funlen) +func Tally(reader io.Reader, writer io.Writer) error { +tournament.go:153:2: Consider pre-allocating `rows` (prealloc) + var rows []Team = []Team{} + ^ +tournament_examples_test.go:8:11: var-declaration: should omit type string from declaration of var input; it will be inferred from the right-hand side (revive) +var input string = ` + ^ +tournament.go:12:11: var-declaration: should omit type bool from declaration of var debug; it will be inferred from the right-hand side (revive) +var debug bool = false + ^ +tournament.go:31:12: var-declaration: should omit type []string from declaration of var lines; it will be inferred from the right-hand side (revive) + var lines []string = []string{} + ^ +tournament.go:39: unnecessary leading newline (whitespace) + for e != io.EOF { + +tournament.go:32:2: declarations should never be cuddled (wsl) + var line string + ^ +tournament.go:33:2: declarations should never be cuddled (wsl) + var size int + ^ +tournament.go:34:2: declarations should never be cuddled (wsl) + var e error + ^ +tournament.go:53:5: branch statements should not be cuddled if block has more than two lines (wsl) + continue + ^ +tournament_test.go:119:3: if statements should only be cuddled with assignments (wsl) + if actual != tt.expected { + ^ +tournament_test.go:131:3: only one cuddle assignment allowed before if statement (wsl) + if err == nil { + ^ +tournament_test.go:147:3: ranges should only be cuddled with assignments used in the iteration (wsl) + for _, s := range errorTestCases { + ^ +tournament_test.go:142:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +tournament.go:85:12: name, played, won, drawn, lost, points are missing in Team (exhaustivestruct) + team1 = Team{} + ^ +tournament.go:93:12: name, played, won, drawn, lost, points are missing in Team (exhaustivestruct) + team2 = Team{} + ^ +tournament_test.go:18:5: happyTestCases is a global variable (gochecknoglobals) +var happyTestCases = []struct { + ^ +tournament_test.go:101:5: errorTestCases is a global variable (gochecknoglobals) +var errorTestCases = []string{ + ^ +tournament.go:61:10: err113: do not define dynamic errors, use wrapped static errors instead: "errors.New(\"blank line\")" (goerr113) + return errors.New("blank line") + ^ +tournament.go:73:21: mnd: Magic number: 3, in detected (gomnd) + if len(fields) != 3 { + ^ +tournament.go:178:3: ineffectual assignment to size (ineffassign) + size, _ = writer.Write(b) + ^ +tournament.go:183:3: ineffectual assignment to size (ineffassign) + size, _ = writer.Write(b) + ^ +tournament.go:163:3: return with no blank line before (nlreturn) + return rows[i].points > rows[j].points + ^ +tournament_test.go:108:1: Function TestTallyHappy missing the call to method parallel (paralleltest) +func TestTallyHappy(t *testing.T) { +^ +tournament_test.go:126:1: Function TestTallyError missing the call to method parallel (paralleltest) +func TestTallyError(t *testing.T) { +^ +tournament_examples_test.go:1:9: package should be `tournament_test` instead of `tournament` (testpackage) +package tournament + ^ +tournament_test.go:1:9: package should be `tournament_test` instead of `tournament` (testpackage) +package tournament + ^ +tournament_test.go:109:6: variable name 'tt' is too short for the scope of its usage (varnamelen) + for _, tt := range happyTestCases { + ^ + +real 0m1.025s +user 0m1.266s +sys 0m1.785s + + + ============================================================================== + +Exit code: -1 + +real 0m1.095s +user 0m1.319s +sys 0m1.888s + +real 0m1.097s +user 0m1.320s +sys 0m1.889s -real 0m0.233s -user 0m0.244s -sys 0m0.226s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.015s +sys 0m0.028s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +tournament_examples_test.go + (8, 11) https://revive.run/r#var-declaration should omit type string from declaration of var input; it will be inferred from the right-hand side + +tournament.go + (12, 11) https://revive.run/r#var-declaration should omit type bool from declaration of var debug; it will be inferred from the right-hand side + (31, 12) https://revive.run/r#var-declaration should omit type []string from declaration of var lines; it will be inferred from the right-hand side + (153, 11) https://revive.run/r#var-declaration should omit type []Team from declaration of var rows; it will be inferred from the right-hand side + (1, 1) https://revive.run/r#package-comments should have a package comment + + + ✖ 5 problems (0 errors) (5 warnings) + +real 0m0.082s +user 0m0.040s +sys 0m0.064s + + + ============================================================================== + +Exit code: 0 + +real 0m0.115s +user 0m0.061s +sys 0m0.101s + +real 0m0.117s +user 0m0.062s +sys 0m0.103s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out tournament -=== RUN TestTallyHappy +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory +real 0m0.001s +user 0m0.000s +sys 0m0.001s +=============================================================================== +Running: ../../.github/citools/go/go-lint-go-consistent +Running Go go-consistent +Go version: + go version go1.21.0 linux/amd64 + ============================================================================== +Running: go clean ./... +real 0m0.019s +user 0m0.018s +sys 0m0.023s + ============================================================================== +Running: go-consistent -v ./... + info: check "./." +internal error: package "errors" without types was imported from "tournament" +real 0m0.095s +user 0m0.121s +sys 0m0.108s + ============================================================================== +Exit code: -1 +real 0m0.126s +user 0m0.143s +sys 0m0.143s +real 0m0.127s +user 0m0.143s +sys 0m0.145s ---- PASS: TestTallyHappy (0.00s) -=== RUN TestTallyError ---- PASS: TestTallyError (0.00s) -=== RUN ExampleTally ---- PASS: ExampleTally (0.00s) -PASS -coverage: 100.0% of statements -ok tournament 0.014s coverage: 100.0% of statements +=============================================================================== -real 0m0.679s -user 0m0.738s -sys 0m0.602s +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.027s +sys 0m0.023s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +tournament.go:1:1: at least one file in a package should have a package comment (ST1000) +tournament.go:31:12: should omit type []string from declaration; it will be inferred from the right-hand side (ST1023) +tournament.go:153:11: should omit type []Team from declaration; it will be inferred from the right-hand side (ST1023) +tournament.go:178:3: this value of size is never used (SA4006) +tournament.go:183:3: this value of size is never used (SA4006) + +real 0m0.185s +user 0m0.253s +sys 0m0.143s + + + ============================================================================== + +Exit code: -1 + +real 0m0.230s +user 0m0.281s +sys 0m0.182s + +real 0m0.232s +user 0m0.283s +sys 0m0.182s =============================================================================== -go tool cover -func=coverage.out -tournament/tournament.go:28: Tally 100.0% -total: (statements) 100.0% +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.027s +sys 0m0.032s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./tournament.go:48:4: commentedOutCode: may want to remove commented-out code +./tournament.go:67:3: commentedOutCode: may want to remove commented-out code +./tournament.go:97:3: commentedOutCode: may want to remove commented-out code +./tournament.go:113:4: commentedOutCode: may want to remove commented-out code +./tournament.go:121:4: commentedOutCode: may want to remove commented-out code +./tournament.go:129:4: commentedOutCode: may want to remove commented-out code +./tournament.go:158:2: commentedOutCode: may want to remove commented-out code +./tournament.go:165:2: commentedOutCode: may want to remove commented-out code -real 0m0.271s -user 0m0.343s -sys 0m0.259s +real 0m1.031s +user 0m1.822s +sys 0m0.785s + + + ============================================================================== + +Exit code: -1 + +real 0m1.075s +user 0m1.855s +sys 0m0.827s + +real 0m1.077s +user 0m1.855s +sys 0m0.829s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.012s +sys 0m0.032s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.095s +user 0m0.119s +sys 0m0.088s + + + ============================================================================== + +Exit code: 0 + +real 0m0.130s +user 0m0.135s +sys 0m0.132s + +real 0m0.133s +user 0m0.136s +sys 0m0.134s =============================================================================== -go tool cover -html coverage.out -o coverage.html +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... -real 0m0.285s -user 0m0.263s -sys 0m0.305s + +real 0m0.022s +user 0m0.018s +sys 0m0.024s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.023s +user 0m0.021s +sys 0m0.020s + + + ============================================================================== + +Exit code: 0 + +real 0m0.057s +user 0m0.044s +sys 0m0.055s + +real 0m0.059s +user 0m0.044s +sys 0m0.057s =============================================================================== -go test -v -race -covermode=atomic tournament +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.020s +sys 0m0.024s + + + ============================================================================== + +Running: errcheck ./... + +tournament_examples_test.go:23:7: Tally(reader, &buffer) +tournament_test.go:145:9: Tally(strings.NewReader(tt.input), &buffer) +tournament_test.go:149:9: Tally(strings.NewReader(s), &buffer) + +real 0m0.566s +user 0m1.380s +sys 0m0.393s + + + ============================================================================== + +Exit code: -1 + +real 0m0.599s +user 0m1.408s +sys 0m0.422s + +real 0m0.601s +user 0m1.408s +sys 0m0.424s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.023s +sys 0m0.032s + + + ============================================================================== + +Running: gocyclo . + +18 tournament Tally tournament.go:28:1 +5 tournament BenchmarkTally tournament_test.go:138:1 +4 tournament TestTallyHappy tournament_test.go:108:1 +3 tournament TestTallyError tournament_test.go:126:1 +1 tournament ExampleTally tournament_examples_test.go:17:1 + +real 0m0.004s +user 0m0.002s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.048s +user 0m0.028s +sys 0m0.046s + +real 0m0.050s +user 0m0.029s +sys 0m0.048s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.033s +user 0m0.026s +sys 0m0.021s + + + ============================================================================== + +Exit code: 0 + +real 0m0.046s +user 0m0.033s +sys 0m0.032s + +real 0m0.048s +user 0m0.034s +sys 0m0.033s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.022s +sys 0m0.022s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:31:42 Including rules: default +[gosec] 2023/09/07 00:31:42 Excluding rules: default +[gosec] 2023/09/07 00:31:42 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/tournament +[gosec] 2023/09/07 00:31:42 Checking package: tournament +[gosec] 2023/09/07 00:31:42 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/tournament/tournament.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 187 + Nosec : 0 + Issues : 0 + + +real 0m0.142s +user 0m0.153s +sys 0m0.095s + + + ============================================================================== + +Exit code: 0 + +real 0m0.178s +user 0m0.181s +sys 0m0.128s + +real 0m0.180s +user 0m0.182s +sys 0m0.129s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.022s +sys 0m0.025s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestTallyHappy @@ -94,25 +683,68 @@ go test -v -race -covermode=atomic tournament ---- PASS: TestTallyHappy (0.01s) +--- PASS: TestTallyHappy (0.00s) === RUN TestTallyError --- PASS: TestTallyError (0.00s) === RUN ExampleTally --- PASS: ExampleTally (0.00s) PASS coverage: 100.0% of statements -ok tournament 0.060s coverage: 100.0% of statements +ok tournament 0.002s coverage: 100.0% of statements + +real 0m0.185s +user 0m0.225s +sys 0m0.169s + + + ============================================================================== + +Running: go tool cover -func=coverage.out + +tournament/tournament.go:28: Tally 100.0% +total: (statements) 100.0% + +real 0m0.055s +user 0m0.060s +sys 0m0.063s + + + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.047s +user 0m0.051s +sys 0m0.058s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.019s +user 0m0.018s +sys 0m0.021s + +real 0m0.019s +user 0m0.018s +sys 0m0.021s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + +=== RUN TestTallyHappy + + -real 0m0.808s -user 0m0.921s -sys 0m0.484s -=============================================================================== -mv -v benchstat-new.txt benchstat-old.txt -renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt @@ -129,17 +761,52 @@ go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +--- PASS: TestTallyHappy (0.00s) +=== RUN TestTallyError +--- PASS: TestTallyError (0.00s) +=== RUN ExampleTally +--- PASS: ExampleTally (0.00s) +PASS +coverage: 100.0% of statements +ok tournament 1.018s coverage: 100.0% of statements + +real 0m1.341s +user 0m0.364s +sys 0m0.181s + + + ============================================================================== +Exit code: 0 +real 0m1.683s +user 0m0.749s +sys 0m0.527s +real 0m1.686s +user 0m0.750s +sys 0m0.529s +=============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: tournament -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkTally-4 +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkTally + + + + + + + + + @@ -29751,17 +30418,9 @@ BenchmarkTally-4 - 1246 967021 ns/op 54938 B/op 4822 allocs/op -PASS -ok tournament 1.370s -real 0m2.072s -user 0m2.141s -sys 0m1.089s -=============================================================================== -go test -tags bonus @@ -29784,62 +30443,149456 @@ go test -tags bonus + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +BenchmarkTally-8 5833 205345 ns/op 54497 B/op 4822 allocs/op PASS -ok tournament 0.014s +ok tournament 1.710s -real 0m0.662s -user 0m0.737s -sys 0m0.642s +real 0m1.853s +user 0m2.157s +sys 0m1.311s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest +gotest -v -tags bonus +=== RUN TestTallyHappy + + + + + + + + -real 0m0.695s -user 0m0.804s -sys 0m0.340s -benchstat benchstat-old.txt benchstat-new.txt -real 0m0.022s -user 0m0.013s -sys 0m0.019s -=============================================================================== -go vet tournament -real 0m0.480s -user 0m0.549s -sys 0m0.490s -=============================================================================== -go fix tournament -real 0m0.163s -user 0m0.211s -sys 0m0.174s -=============================================================================== -gosec ./tournament -[gosec] 2022/06/27 07:14:40 Including rules: default -[gosec] 2022/06/27 07:14:40 Excluding rules: default -[gosec] 2022/06/27 07:14:40 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/tournament -2022/06/27 07:14:41 internal error: package "errors" without types was imported from "command-line-arguments" -real 0m0.560s -user 0m0.613s -sys 0m0.402s + + +--- PASS: TestTallyHappy (0.00s) +=== RUN TestTallyError +--- PASS: TestTallyError (0.00s) +=== RUN ExampleTally +--- PASS: ExampleTally (0.00s) +PASS +ok tournament 0.003s + +real 0m0.164s +user 0m0.233s +sys 0m0.159s + +=============================================================================== + +benchstat benchstat-old.txt benchstat-new.txt +benchstat-old.txt:27: missing iteration count +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: tournament +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Tally-8 205.3µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Tally-8 53.22Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Tally-8 4.822k ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + +real 0m0.007s +user 0m0.004s +sys 0m0.002s =============================================================================== gomarkdoc --output tournament-doc.md -real 0m0.034s -user 0m0.024s -sys 0m0.012s +real 0m0.012s +user 0m0.009s +sys 0m0.003s =============================================================================== @@ -29864,9 +179917,9 @@ type Teams map[string]Team Teams map holds a collection of Team structs for a single tournament. -real 0m0.344s -user 0m0.329s -sys 0m0.367s +real 0m0.040s +user 0m0.034s +sys 0m0.035s =============================================================================== diff --git a/go/tournament/tournament-doc.md b/go/tournament/tournament-doc.md index 1a3a36c8..0a12d7da 100755 --- a/go/tournament/tournament-doc.md +++ b/go/tournament/tournament-doc.md @@ -19,7 +19,7 @@ import "tournament" func Tally(reader io.Reader, writer io.Writer) error ``` -Tally returns the results of a small football competition\. +Tally returns the results of a small football competition.

Example

@@ -66,7 +66,7 @@ Courageous Californians | 3 | 0 | 1 | 2 | 1 ## type [Team]() -Team struct holds a team's tournament information\. +Team struct holds a team's tournament information. ```go type Team struct { @@ -76,7 +76,7 @@ type Team struct { ## type [Teams]() -Teams map holds a collection of Team structs for a single tournament\. +Teams map holds a collection of Team structs for a single tournament. ```go type Teams map[string]Team diff --git a/go/triangle/benchstat-new.txt b/go/triangle/benchstat-new.txt index 9fe898a3..94e7763f 100644 --- a/go/triangle/benchstat-new.txt +++ b/go/triangle/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: triangle -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkKind-4 6604374 169.2 ns/op 0 B/op 0 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkKind +BenchmarkKind-8 11657188 88.33 ns/op 0 B/op 0 allocs/op PASS -ok triangle 1.374s +ok triangle 1.138s diff --git a/go/triangle/benchstat-old.txt b/go/triangle/benchstat-old.txt index 005e33ad..9fe898a3 100644 --- a/go/triangle/benchstat-old.txt +++ b/go/triangle/benchstat-old.txt @@ -2,6 +2,6 @@ goos: linux goarch: amd64 pkg: triangle cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkKind-4 7243879 155.2 ns/op 0 B/op 0 allocs/op +BenchmarkKind-4 6604374 169.2 ns/op 0 B/op 0 allocs/op PASS -ok triangle 1.353s +ok triangle 1.374s diff --git a/go/triangle/coverage-annotations.txt b/go/triangle/coverage-annotations.txt new file mode 100644 index 00000000..9630fdf3 --- /dev/null +++ b/go/triangle/coverage-annotations.txt @@ -0,0 +1,13 @@ + +55 func isScalene(a, b, c float64) bool { +56 if !isTriangle(a, b, c) { +57 return false +58 } +59 +60 if a != b && a != c && b != c { +61 return true +62 } +63 +64 MISS return false +65 } + diff --git a/go/triangle/coverage.out b/go/triangle/coverage.out index a4e48ddb..32d36a18 100644 --- a/go/triangle/coverage.out +++ b/go/triangle/coverage.out @@ -1,24 +1,24 @@ mode: count triangle/triangle.go:16.39,17.32 1 52 -triangle/triangle.go:21.2,21.38 1 43 -triangle/triangle.go:25.2,25.14 1 9 triangle/triangle.go:17.32,19.3 1 9 +triangle/triangle.go:21.2,21.38 1 43 triangle/triangle.go:21.38,23.3 1 34 +triangle/triangle.go:25.2,25.14 1 9 triangle/triangle.go:29.42,30.26 1 21 -triangle/triangle.go:34.2,34.22 1 15 -triangle/triangle.go:38.2,38.14 1 12 triangle/triangle.go:30.26,32.3 1 6 +triangle/triangle.go:34.2,34.22 1 15 triangle/triangle.go:34.22,36.3 1 3 +triangle/triangle.go:38.2,38.14 1 12 triangle/triangle.go:42.40,43.26 1 18 -triangle/triangle.go:47.2,47.62 1 12 -triangle/triangle.go:51.2,51.14 1 7 triangle/triangle.go:43.26,45.3 1 6 +triangle/triangle.go:47.2,47.62 1 12 triangle/triangle.go:47.62,49.3 1 5 +triangle/triangle.go:51.2,51.14 1 7 triangle/triangle.go:55.38,56.26 1 13 -triangle/triangle.go:60.2,60.32 1 7 -triangle/triangle.go:64.2,64.14 1 0 triangle/triangle.go:56.26,58.3 1 6 +triangle/triangle.go:60.2,60.32 1 7 triangle/triangle.go:60.32,62.3 1 7 +triangle/triangle.go:64.2,64.14 1 0 triangle/triangle.go:68.42,69.9 1 21 triangle/triangle.go:70.30,71.13 1 3 triangle/triangle.go:72.28,73.13 1 5 diff --git a/go/triangle/run-tests-go.txt b/go/triangle/run-tests-go.txt index 479e1d30..888c62af 100644 --- a/go/triangle/run-tests-go.txt +++ b/go/triangle/run-tests-go.txt @@ -5,15 +5,565 @@ Go packages: triangle =============================================================================== -golint triangle +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.006s +sys 0m0.008s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +triangle.go:34:5: badCond: `a == b && a == c` condition is suspicious (gocritic) + if a == b && a == c { + ^ +triangle_test.go:12:20: Comment should end in a period (godot) +// basic test cases + ^ +triangle_test.go:70:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +triangle_test.go:13:5: testData is a global variable (gochecknoglobals) +var testData = []testCase{ + ^ +triangle_test.go:35:1: Function TestKindsNotEqual missing the call to method parallel (paralleltest) +func TestKindsNotEqual(t *testing.T) { +^ +triangle_test.go:56:1: Function TestKind missing the call to method parallel (paralleltest) +func TestKind(t *testing.T) { +^ +triangle_examples_test.go:1:9: package should be `triangle_test` instead of `triangle` (testpackage) +package triangle + ^ +triangle_test.go:1:9: package should be `triangle_test` instead of `triangle` (testpackage) +package triangle + ^ +triangle.go:68:20: parameter name 'c' is too short for the scope of its usage (varnamelen) +func KindFromSides(a, b, c float64) Kind { + ^ + +real 0m0.501s +user 0m0.702s +sys 0m0.467s + + + ============================================================================== + +Exit code: -1 + +real 0m0.525s +user 0m0.715s +sys 0m0.484s + +real 0m0.527s +user 0m0.716s +sys 0m0.486s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.004s +sys 0m0.010s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.033s +user 0m0.021s +sys 0m0.021s + + + ============================================================================== + +Exit code: 0 + +real 0m0.056s +user 0m0.030s +sys 0m0.042s + +real 0m0.058s +user 0m0.032s +sys 0m0.042s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.008s +sys 0m0.023s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "triangle [triangle.test]" + +real 0m0.089s +user 0m0.115s +sys 0m0.111s + + + ============================================================================== + +Exit code: -1 + +real 0m0.132s +user 0m0.133s +sys 0m0.150s + +real 0m0.134s +user 0m0.134s +sys 0m0.150s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.009s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.176s +user 0m0.211s +sys 0m0.128s + + + ============================================================================== + +Exit code: 0 + +real 0m0.199s +user 0m0.226s +sys 0m0.145s + +real 0m0.202s +user 0m0.227s +sys 0m0.146s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.004s +sys 0m0.010s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./triangle.go:34:5: badCond: `a == b && a == c` condition is suspicious + +real 0m0.847s +user 0m2.124s +sys 0m0.284s + + + ============================================================================== + +Exit code: -1 + +real 0m0.871s +user 0m2.132s +sys 0m0.306s + +real 0m0.873s +user 0m2.133s +sys 0m0.307s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.004s +sys 0m0.011s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.069s +user 0m0.116s +sys 0m0.088s + + + ============================================================================== + +Exit code: 0 + +real 0m0.091s +user 0m0.124s +sys 0m0.108s + +real 0m0.094s +user 0m0.126s +sys 0m0.108s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.006s +sys 0m0.009s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.017s +user 0m0.008s +sys 0m0.012s + + + ============================================================================== + +Exit code: 0 + +real 0m0.037s +user 0m0.019s +sys 0m0.029s + +real 0m0.039s +user 0m0.019s +sys 0m0.031s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== -real 0m0.106s -user 0m0.062s -sys 0m0.087s +Running: go clean ./... + + +real 0m0.018s +user 0m0.006s +sys 0m0.017s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.529s +user 0m1.667s +sys 0m0.368s + + + ============================================================================== + +Exit code: 0 + +real 0m0.563s +user 0m1.683s +sys 0m0.397s + +real 0m0.566s +user 0m1.685s +sys 0m0.398s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.007s +sys 0m0.009s + + + ============================================================================== + +Running: gocyclo . + +8 triangle isIsosceles triangle.go:42:1 +7 triangle isTriangle triangle.go:16:1 +5 triangle isScalene triangle.go:55:1 +4 triangle BenchmarkKind triangle_test.go:66:1 +4 triangle TestKindsNotEqual triangle_test.go:35:1 +4 triangle KindFromSides triangle.go:68:1 +4 triangle isEquilateral triangle.go:29:1 +3 triangle TestKind triangle_test.go:56:1 +1 triangle ExampleKindFromSides triangle_examples_test.go:7:1 + +real 0m0.003s +user 0m0.001s +sys 0m0.002s + + + ============================================================================== + +Exit code: 0 + +real 0m0.028s +user 0m0.013s +sys 0m0.022s + +real 0m0.030s +user 0m0.014s +sys 0m0.024s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.025s +user 0m0.029s +sys 0m0.007s + + + ============================================================================== + +Exit code: 0 + +real 0m0.037s +user 0m0.035s +sys 0m0.019s + +real 0m0.040s +user 0m0.035s +sys 0m0.022s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.010s +sys 0m0.015s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:31:49 Including rules: default +[gosec] 2023/09/07 00:31:49 Excluding rules: default +[gosec] 2023/09/07 00:31:49 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/triangle +[gosec] 2023/09/07 00:31:49 Checking package: triangle +[gosec] 2023/09/07 00:31:49 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/triangle/triangle.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 79 + Nosec : 0 + Issues : 0 + + +real 0m0.086s +user 0m0.075s +sys 0m0.045s + + + ============================================================================== + +Exit code: 0 + +real 0m0.116s +user 0m0.091s +sys 0m0.068s + +real 0m0.118s +user 0m0.091s +sys 0m0.069s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out triangle +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.012s +sys 0m0.011s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestKindsNotEqual --- PASS: TestKindsNotEqual (0.00s) === RUN TestKind @@ -22,15 +572,17 @@ go test -v -covermode=count -coverprofile coverage.out triangle --- PASS: ExampleKindFromSides (0.00s) PASS coverage: 96.0% of statements -ok triangle 0.010s coverage: 96.0% of statements +ok triangle 0.004s coverage: 96.0% of statements -real 0m0.668s -user 0m0.747s -sys 0m0.467s +real 0m0.186s +user 0m0.223s +sys 0m0.158s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + triangle/triangle.go:16: isTriangle 100.0% triangle/triangle.go:29: isEquilateral 100.0% triangle/triangle.go:42: isIsosceles 100.0% @@ -38,21 +590,53 @@ triangle/triangle.go:55: isScalene 80.0% triangle/triangle.go:68: KindFromSides 100.0% total: (statements) 96.0% -real 0m0.125s -user 0m0.065s -sys 0m0.109s +real 0m0.026s +user 0m0.012s +sys 0m0.020s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.067s -user 0m0.032s -sys 0m0.067s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic triangle +real 0m0.025s +user 0m0.009s +sys 0m0.023s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +55 func isScalene(a, b, c float64) bool { +56 if !isTriangle(a, b, c) { +57 return false +58 } +59 +60 if a != b && a != c && b != c { +61 return true +62 } +63 +64 MISS return false +65 } + + +real 0m0.010s +user 0m0.004s +sys 0m0.011s + +real 0m0.010s +user 0m0.004s +sys 0m0.011s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestKindsNotEqual --- PASS: TestKindsNotEqual (0.00s) === RUN TestKind @@ -61,115 +645,117 @@ go test -v -race -covermode=atomic triangle --- PASS: ExampleKindFromSides (0.00s) PASS coverage: 96.0% of statements -ok triangle 0.046s coverage: 96.0% of statements +ok triangle 1.012s coverage: 96.0% of statements + +real 0m1.247s +user 0m0.275s +sys 0m0.179s + + + ============================================================================== -real 0m0.688s -user 0m0.759s -sys 0m0.489s +Exit code: 0 + +real 0m1.528s +user 0m0.547s +sys 0m0.415s + +real 0m1.531s +user 0m0.548s +sys 0m0.416s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: triangle -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkKind-4 6604374 169.2 ns/op 0 B/op 0 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkKind +BenchmarkKind-8 11657188 88.33 ns/op 0 B/op 0 allocs/op PASS -ok triangle 1.374s +ok triangle 1.138s -real 0m1.898s -user 0m2.055s -sys 0m0.436s +real 0m1.284s +user 0m1.339s +sys 0m0.169s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestKindsNotEqual +--- PASS: TestKindsNotEqual (0.00s) +=== RUN TestKind +--- PASS: TestKind (0.00s) +=== RUN ExampleKindFromSides +--- PASS: ExampleKindFromSides (0.00s) PASS -ok triangle 0.014s +ok triangle 0.002s -real 0m0.512s -user 0m0.583s -sys 0m0.389s +real 0m0.121s +user 0m0.154s +sys 0m0.110s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m0.787s -user 0m0.798s -sys 0m0.377s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -Kind-4 155ns ± 0% 169ns ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -Kind-4 0.00B 0.00B ~ (all equal) - -name old allocs/op new allocs/op delta -Kind-4 0.00 0.00 ~ (all equal) - -real 0m0.026s -user 0m0.011s -sys 0m0.018s - -=============================================================================== - -go vet triangle - -real 0m0.286s -user 0m0.384s -sys 0m0.284s - -=============================================================================== - -go fix triangle - -real 0m0.054s -user 0m0.027s -sys 0m0.049s - -=============================================================================== - -gosec ./triangle -[gosec] 2022/06/27 19:57:19 Including rules: default -[gosec] 2022/06/27 19:57:19 Excluding rules: default -[gosec] 2022/06/27 19:57:19 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/triangle -[gosec] 2022/06/27 19:57:19 Checking package: triangle -[gosec] 2022/06/27 19:57:19 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/triangle/triangle.go -Results: +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: triangle +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Kind-8 88.33n ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Kind-8 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Kind-8 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Kind-4 169.2n ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -Summary: - Files: 1 - Lines: 79 - Nosec: 0 - Issues: 0 + │ benchstat-old.txt │ + │ B/op │ +Kind-4 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + │ benchstat-old.txt │ + │ allocs/op │ +Kind-4 0.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.243s -user 0m0.253s -sys 0m0.147s +real 0m0.004s +user 0m0.002s +sys 0m0.001s =============================================================================== gomarkdoc --output triangle-doc.md -real 0m0.027s -user 0m0.014s -sys 0m0.016s +real 0m0.011s +user 0m0.011s +sys 0m0.001s =============================================================================== go doc -all triangle package triangle // import "triangle" -Package triangle determines if a triangle is equilateral, isosceles, or -scalene. +Package triangle determines if a triangle is equilateral, isosceles, or scalene. CONSTANTS @@ -191,9 +777,9 @@ func KindFromSides(a, b, c float64) Kind KindFromSides returns the kind of triangle being tested. -real 0m0.120s -user 0m0.060s -sys 0m0.114s +real 0m0.033s +user 0m0.014s +sys 0m0.029s =============================================================================== diff --git a/go/triangle/triangle-doc.md b/go/triangle/triangle-doc.md index 979a7c78..a96a21ef 100755 --- a/go/triangle/triangle-doc.md +++ b/go/triangle/triangle-doc.md @@ -6,7 +6,7 @@ import "triangle" ``` -Package triangle determines if a triangle is equilateral\, isosceles\, or scalene\. +Package triangle determines if a triangle is equilateral, isosceles, or scalene. ## Index @@ -17,7 +17,7 @@ Package triangle determines if a triangle is equilateral\, isosceles\, or scalen ## Constants -Triangle types\. +Triangle types. ```go const ( @@ -30,7 +30,7 @@ const ( ## type [Kind]() -Kind is an int used to describe a triangle\. +Kind is an int used to describe a triangle. ```go type Kind int @@ -42,7 +42,7 @@ type Kind int func KindFromSides(a, b, c float64) Kind ``` -KindFromSides returns the kind of triangle being tested\. +KindFromSides returns the kind of triangle being tested.

Example

diff --git a/go/triangle/triangle-doc.txt b/go/triangle/triangle-doc.txt index 4a433a97..7cb70f82 100644 --- a/go/triangle/triangle-doc.txt +++ b/go/triangle/triangle-doc.txt @@ -1,7 +1,6 @@ package triangle // import "triangle" -Package triangle determines if a triangle is equilateral, isosceles, or -scalene. +Package triangle determines if a triangle is equilateral, isosceles, or scalene. CONSTANTS diff --git a/go/twelve-days/benchstat-new.txt b/go/twelve-days/benchstat-new.txt index 7285faa0..17e2366b 100644 --- a/go/twelve-days/benchstat-new.txt +++ b/go/twelve-days/benchstat-new.txt @@ -1,10 +1,10 @@ goos: linux goarch: amd64 pkg: twelve -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkVerse -BenchmarkVerse-4 54613 26142 ns/op 11475 B/op 113 allocs/op +BenchmarkVerse-8 178758 6561 ns/op 11476 B/op 113 allocs/op BenchmarkSong -BenchmarkSong-4 37423 39293 ns/op 18485 B/op 120 allocs/op +BenchmarkSong-8 125301 8618 ns/op 18487 B/op 120 allocs/op PASS -ok twelve 5.607s +ok twelve 3.353s diff --git a/go/twelve-days/benchstat-old.txt b/go/twelve-days/benchstat-old.txt new file mode 100644 index 00000000..7285faa0 --- /dev/null +++ b/go/twelve-days/benchstat-old.txt @@ -0,0 +1,10 @@ +goos: linux +goarch: amd64 +pkg: twelve +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkVerse +BenchmarkVerse-4 54613 26142 ns/op 11475 B/op 113 allocs/op +BenchmarkSong +BenchmarkSong-4 37423 39293 ns/op 18485 B/op 120 allocs/op +PASS +ok twelve 5.607s diff --git a/go/twelve-days/coverage.out b/go/twelve-days/coverage.out index b6e6f3f7..44a9046b 100644 --- a/go/twelve-days/coverage.out +++ b/go/twelve-days/coverage.out @@ -1,12 +1,12 @@ mode: count twelve/twelve_days.go:10.33,12.35 2 38 -twelve/twelve_days.go:16.2,52.13 7 38 -twelve/twelve_days.go:61.2,63.14 2 38 twelve/twelve_days.go:12.35,14.3 1 0 +twelve/twelve_days.go:16.2,52.13 7 38 twelve/twelve_days.go:52.13,53.13 1 247 -twelve/twelve_days.go:57.3,58.6 2 247 twelve/twelve_days.go:53.13,55.4 1 34 +twelve/twelve_days.go:57.3,58.6 2 247 +twelve/twelve_days.go:61.2,63.14 2 38 twelve/twelve_days.go:67.20,70.27 2 2 -twelve/twelve_days.go:77.2,77.22 1 2 twelve/twelve_days.go:70.27,72.22 2 24 twelve/twelve_days.go:72.22,74.4 1 22 +twelve/twelve_days.go:77.2,77.22 1 2 diff --git a/go/twelve-days/run-tests-go.txt b/go/twelve-days/run-tests-go.txt index 21233c02..15cf4714 100644 --- a/go/twelve-days/run-tests-go.txt +++ b/go/twelve-days/run-tests-go.txt @@ -5,56 +5,635 @@ Go packages: twelve =============================================================================== -golint ./... +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.037s +sys 0m0.024s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +twelve_days_test.go:29:70: Comment should end in a period (godot) +// diff compares two multi-line strings and returns a helpful comment + ^ +twelve_days_test.go:67: File is not `gofumpt`-ed (gofumpt) + var expected = strings.Join(verses, "\n") +twelve_days_examples_test.go:10: line is 323 characters (lll) + // On the twelfth day of Christmas my true love gave to me: twelve Drummers Drumming, eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. +twelve_days_examples_test.go:19: line is 127 characters (lll) + // On the third day of Christmas my true love gave to me: three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. +twelve_days_examples_test.go:20: line is 148 characters (lll) + // On the fourth day of Christmas my true love gave to me: four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. +twelve_days_examples_test.go:21: line is 164 characters (lll) + // On the fifth day of Christmas my true love gave to me: five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. +twelve_days_examples_test.go:22: line is 184 characters (lll) + // On the sixth day of Christmas my true love gave to me: six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. +twelve_days_examples_test.go:23: line is 210 characters (lll) + // On the seventh day of Christmas my true love gave to me: seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. +twelve_days_examples_test.go:24: line is 232 characters (lll) + // On the eighth day of Christmas my true love gave to me: eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. +twelve_days_examples_test.go:25: line is 252 characters (lll) + // On the ninth day of Christmas my true love gave to me: nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. +twelve_days_examples_test.go:26: line is 273 characters (lll) + // On the tenth day of Christmas my true love gave to me: ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. +twelve_days_examples_test.go:27: line is 298 characters (lll) + // On the eleventh day of Christmas my true love gave to me: eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. +twelve_days_examples_test.go:28: line is 323 characters (lll) + // On the twelfth day of Christmas my true love gave to me: twelve Drummers Drumming, eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree. +twelve_days_test.go:17: line is 132 characters (lll) + {3, "On the third day of Christmas my true love gave to me: three French Hens, two Turtle Doves, and a Partridge in a Pear Tree."}, +twelve_days_test.go:18: line is 153 characters (lll) + {4, "On the fourth day of Christmas my true love gave to me: four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree."}, +twelve_days_test.go:19: line is 169 characters (lll) + {5, "On the fifth day of Christmas my true love gave to me: five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree."}, +twelve_days_test.go:20: line is 189 characters (lll) + {6, "On the sixth day of Christmas my true love gave to me: six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree."}, +twelve_days_test.go:21: line is 215 characters (lll) + {7, "On the seventh day of Christmas my true love gave to me: seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree."}, +twelve_days_test.go:22: line is 237 characters (lll) + {8, "On the eighth day of Christmas my true love gave to me: eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree."}, +twelve_days_test.go:23: line is 257 characters (lll) + {9, "On the ninth day of Christmas my true love gave to me: nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree."}, +twelve_days_test.go:24: line is 279 characters (lll) + {10, "On the tenth day of Christmas my true love gave to me: ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree."}, +twelve_days_test.go:25: line is 304 characters (lll) + {11, "On the eleventh day of Christmas my true love gave to me: eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree."}, +twelve_days_test.go:26: line is 329 characters (lll) + {12, "On the twelfth day of Christmas my true love gave to me: twelve Drummers Drumming, eleven Pipers Piping, ten Lords-a-Leaping, nine Ladies Dancing, eight Maids-a-Milking, seven Swans-a-Swimming, six Geese-a-Laying, five Gold Rings, four Calling Birds, three French Hens, two Turtle Doves, and a Partridge in a Pear Tree."}, +twelve_days_test.go:63:2: Consider pre-allocating `verses` (prealloc) + var verses []string + ^ +twelve_days.go:49:2: assignments should only be cuddled with other assignments (wsl) + i := verseNum + ^ +twelve_days.go:72:3: if statements should only be cuddled with assignments (wsl) + if i > 0 && i < 12 { + ^ +twelve_days_test.go:39:4: return statements should not be cuddled if block has more than two lines (wsl) + return fmt.Sprintf("-- first difference in line %d:\n"+ + ^ +twelve_days_test.go:33:2: for statement without condition should never be cuddled (wsl) + for i := 0; ; i++ { + ^ +twelve_days_test.go:68:2: assignments should only be cuddled with other assignments (wsl) + actual := Song() + ^ +twelve_days_test.go:69:2: only one cuddle assignment allowed before if statement (wsl) + if expected != actual { + ^ +twelve_days_test.go:78:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +twelve_days_test.go:89:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +twelve_days_test.go:14:5: testCases is a global variable (gochecknoglobals) +var testCases = []testCase{ + ^ +twelve_days_test.go:53:1: Function TestVerse missing the call to method parallel (paralleltest) +func TestVerse(t *testing.T) { +^ +twelve_days_test.go:62:1: Function TestSong missing the call to method parallel (paralleltest) +func TestSong(t *testing.T) { +^ +twelve_days_examples_test.go:1:9: package should be `twelve_test` instead of `twelve` (testpackage) +package twelve + ^ +twelve_days_test.go:1:9: package should be `twelve_test` instead of `twelve` (testpackage) +package twelve + ^ +twelve_days.go:50:2: variable name 'j' is too short for the scope of its usage (varnamelen) + j := 0 + ^ +twelve_days_test.go:31:2: variable name 'g' is too short for the scope of its usage (varnamelen) + g := strings.Split(got, "\n") + ^ +twelve_days_test.go:32:2: variable name 'w' is too short for the scope of its usage (varnamelen) + w := strings.Split(want, "\n") + ^ + +real 0m0.517s +user 0m0.826s +sys 0m0.431s + + + ============================================================================== + +Exit code: -1 + +real 0m0.555s +user 0m0.868s +sys 0m0.466s + +real 0m0.557s +user 0m0.869s +sys 0m0.466s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.018s +sys 0m0.021s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.041s +user 0m0.019s +sys 0m0.032s + + + ============================================================================== + +Exit code: 0 + +real 0m0.072s +user 0m0.043s +sys 0m0.062s + +real 0m0.074s +user 0m0.043s +sys 0m0.065s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.019s +sys 0m0.025s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "twelve" + +real 0m0.104s +user 0m0.130s +sys 0m0.164s + + + ============================================================================== + +Exit code: -1 + +real 0m0.141s +user 0m0.159s +sys 0m0.200s + +real 0m0.143s +user 0m0.160s +sys 0m0.201s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.014s +sys 0m0.020s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.186s +user 0m0.240s +sys 0m0.136s + + + ============================================================================== + +Exit code: 0 + +real 0m0.219s +user 0m0.258s +sys 0m0.167s + +real 0m0.221s +user 0m0.258s +sys 0m0.168s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.024s +sys 0m0.031s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.807s +user 0m1.938s +sys 0m0.310s + + + ============================================================================== + +Exit code: 0 + +real 0m0.858s +user 0m1.974s +sys 0m0.356s + +real 0m0.862s +user 0m1.976s +sys 0m0.358s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.022s +sys 0m0.022s + + + ============================================================================== + +Running: go vet ./... + real 0m0.077s -user 0m0.078s -sys 0m0.069s +user 0m0.112s +sys 0m0.117s + + + ============================================================================== + +Exit code: 0 + +real 0m0.106s +user 0m0.140s +sys 0m0.144s + +real 0m0.107s +user 0m0.141s +sys 0m0.145s =============================================================================== -revive ./... +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.024s +sys 0m0.024s + -real 0m0.030s -user 0m0.020s -sys 0m0.011s + ============================================================================== + +Running: go fix ./... + + +real 0m0.029s +user 0m0.021s +sys 0m0.036s + + + ============================================================================== + +Exit code: 0 + +real 0m0.071s +user 0m0.051s +sys 0m0.071s + +real 0m0.072s +user 0m0.052s +sys 0m0.072s =============================================================================== -ineffassign ./... +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.036s +user 0m0.031s +sys 0m0.033s -real 0m0.321s -user 0m0.375s -sys 0m0.312s + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.485s +user 0m1.364s +sys 0m0.279s + + + ============================================================================== + +Exit code: 0 + +real 0m0.535s +user 0m1.405s +sys 0m0.321s + +real 0m0.538s +user 0m1.406s +sys 0m0.322s =============================================================================== -go-consistent -v ./... - info: check "./." +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.023s +sys 0m0.021s + + + ============================================================================== + +Running: gocyclo . + +7 twelve diff twelve_days_test.go:30:1 +5 twelve Verse twelve_days.go:10:1 +4 twelve BenchmarkVerse twelve_days_test.go:74:1 +4 twelve Song twelve_days.go:67:1 +3 twelve BenchmarkSong twelve_days_test.go:85:1 +3 twelve TestSong twelve_days_test.go:62:1 +3 twelve TestVerse twelve_days_test.go:53:1 +1 twelve ExampleSong twelve_days_examples_test.go:13:1 +1 twelve ExampleVerse twelve_days_examples_test.go:5:1 + +real 0m0.003s +user 0m0.000s +sys 0m0.003s + -real 0m0.348s -user 0m0.409s -sys 0m0.355s + ============================================================================== + +Exit code: 0 + +real 0m0.037s +user 0m0.030s +sys 0m0.032s + +real 0m0.038s +user 0m0.030s +sys 0m0.033s =============================================================================== -staticcheck ./... +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . -real 0m0.531s -user 0m0.540s -sys 0m0.517s + +real 0m0.027s +user 0m0.027s +sys 0m0.017s + + + ============================================================================== + +Exit code: 0 + +real 0m0.037s +user 0m0.030s +sys 0m0.028s + +real 0m0.039s +user 0m0.031s +sys 0m0.028s =============================================================================== -gocritic check -enableAll ./... +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.037s +user 0m0.034s +sys 0m0.028s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:31:55 Including rules: default +[gosec] 2023/09/07 00:31:55 Excluding rules: default +[gosec] 2023/09/07 00:31:55 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/twelve-days +[gosec] 2023/09/07 00:31:55 Checking package: twelve +[gosec] 2023/09/07 00:31:55 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/twelve-days/twelve_days.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 78 + Nosec : 0 + Issues : 0 + + +real 0m0.159s +user 0m0.164s +sys 0m0.145s + + + ============================================================================== -real 0m2.217s -user 0m3.797s -sys 0m1.007s +Exit code: 0 + +real 0m0.211s +user 0m0.206s +sys 0m0.187s + +real 0m0.214s +user 0m0.207s +sys 0m0.188s =============================================================================== -gotest -v -covermode=count -coverprofile coverage.out ./... +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.015s +sys 0m0.025s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestVerse --- PASS: TestVerse (0.00s) === RUN TestSong @@ -65,34 +644,41 @@ gotest -v -covermode=count -coverprofile coverage.out ./... --- PASS: ExampleSong (0.00s) PASS coverage: 95.5% of statements -ok twelve 0.017s coverage: 95.5% of statements +ok twelve 0.002s coverage: 95.5% of statements -real 0m0.429s -user 0m0.521s -sys 0m0.322s +real 0m0.182s +user 0m0.246s +sys 0m0.140s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + twelve/twelve_days.go:10: Verse 93.8% twelve/twelve_days.go:67: Song 100.0% total: (statements) 95.5% -real 0m0.275s -user 0m0.262s -sys 0m0.269s +real 0m0.060s +user 0m0.076s +sys 0m0.078s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.184s -user 0m0.165s -sys 0m0.215s +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.049s +user 0m0.050s +sys 0m0.067s -=============================================================================== -gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt 10 func Verse(verseNum int) string { 11 verseNum-- @@ -151,13 +737,19 @@ gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annota 64 } -real 0m0.070s -user 0m0.071s -sys 0m0.075s +real 0m0.016s +user 0m0.017s +sys 0m0.022s + +real 0m0.016s +user 0m0.017s +sys 0m0.022s -=============================================================================== -gotest -v -race -covermode=atomic ./... + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestVerse --- PASS: TestVerse (0.00s) === RUN TestSong @@ -168,29 +760,45 @@ gotest -v -race -covermode=atomic ./... --- PASS: ExampleSong (0.00s) PASS coverage: 95.5% of statements -ok twelve (cached) coverage: 95.5% of statements +ok twelve 1.018s coverage: 95.5% of statements + +real 0m1.243s +user 0m0.254s +sys 0m0.185s + -real 0m0.332s -user 0m0.363s -sys 0m0.344s + ============================================================================== + +Exit code: 0 + +real 0m1.598s +user 0m0.668s +sys 0m0.533s + +real 0m1.601s +user 0m0.669s +sys 0m0.534s =============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: twelve -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +cpu: 12th Gen Intel(R) Core(TM) i5-1240P BenchmarkVerse -BenchmarkVerse-4 54613 26142 ns/op 11475 B/op 113 allocs/op +BenchmarkVerse-8 178758 6561 ns/op 11476 B/op 113 allocs/op BenchmarkSong -BenchmarkSong-4 37423 39293 ns/op 18485 B/op 120 allocs/op +BenchmarkSong-8 125301 8618 ns/op 18487 B/op 120 allocs/op PASS -ok twelve 5.607s +ok twelve 3.353s -real 0m6.178s -user 0m9.212s -sys 0m2.094s +real 0m3.511s +user 0m3.853s +sys 0m0.406s =============================================================================== @@ -204,76 +812,77 @@ gotest -v -tags bonus === RUN ExampleSong --- PASS: ExampleSong (0.00s) PASS -ok twelve 0.015s +ok twelve 0.001s -real 0m0.523s -user 0m0.543s -sys 0m0.401s +real 0m0.129s +user 0m0.172s +sys 0m0.138s =============================================================================== -No old benchmarks to run benchstat against. - -=============================================================================== - -go vet ./... - -real 0m0.248s -user 0m0.262s -sys 0m0.316s - -=============================================================================== - -go fix ./... - -real 0m0.122s -user 0m0.093s -sys 0m0.148s - -=============================================================================== - -gocyclo . -7 twelve diff twelve_days_test.go:30:1 -5 twelve Verse twelve_days.go:10:1 -4 twelve BenchmarkVerse twelve_days_test.go:74:1 -4 twelve Song twelve_days.go:67:1 -3 twelve BenchmarkSong twelve_days_test.go:85:1 -3 twelve TestSong twelve_days_test.go:62:1 -3 twelve TestVerse twelve_days_test.go:53:1 -1 twelve ExampleSong twelve_days_examples_test.go:13:1 -1 twelve ExampleVerse twelve_days_examples_test.go:5:1 - -real 0m0.017s -user 0m0.003s -sys 0m0.009s - -=============================================================================== - -misspell . - -real 0m0.101s -user 0m0.091s -sys 0m0.068s - -=============================================================================== - -gosec ./... -[gosec] 2022/08/23 22:05:44 Including rules: default -[gosec] 2022/08/23 22:05:44 Excluding rules: default -[gosec] 2022/08/23 22:05:44 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/twelve-days -2022/08/23 22:05:44 internal error: package "fmt" without types was imported from "command-line-arguments" +benchstat benchstat-old.txt benchstat-new.txt +benchstat-old.txt:5: missing iteration count +benchstat-old.txt:7: missing iteration count +benchstat-new.txt:5: missing iteration count +benchstat-new.txt:7: missing iteration count +goos: linux +goarch: amd64 +pkg: twelve +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Verse-8 6.561µ ± ∞ ¹ +Song-8 8.618µ ± ∞ ¹ +geomean 7.519µ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +Verse-8 11.21Ki ± ∞ ¹ +Song-8 18.05Ki ± ∞ ¹ +geomean 14.22Ki +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +Verse-8 113.0 ± ∞ ¹ +Song-8 120.0 ± ∞ ¹ +geomean 116.4 +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.431s -user 0m0.442s -sys 0m0.344s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Verse-4 26.14µ ± ∞ ¹ +Song-4 39.29µ ± ∞ ¹ +geomean 32.05µ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ B/op │ +Verse-4 11.21Ki ± ∞ ¹ +Song-4 18.05Ki ± ∞ ¹ +geomean 14.22Ki +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-old.txt │ + │ allocs/op │ +Verse-4 113.0 ± ∞ ¹ +Song-4 120.0 ± ∞ ¹ +geomean 116.4 +¹ need >= 6 samples for confidence interval at level 0.95 + +real 0m0.003s +user 0m0.001s +sys 0m0.002s =============================================================================== gomarkdoc --output twelve-doc.md -real 0m0.044s -user 0m0.029s -sys 0m0.023s +real 0m0.009s +user 0m0.004s +sys 0m0.005s =============================================================================== @@ -291,9 +900,9 @@ func Verse(verseNum int) string Verse returns the specific verse/line from the song. -real 0m0.139s -user 0m0.101s -sys 0m0.147s +real 0m0.036s +user 0m0.030s +sys 0m0.030s =============================================================================== diff --git a/go/two-fer/benchstat-new.txt b/go/two-fer/benchstat-new.txt index 935b2649..90665863 100644 --- a/go/two-fer/benchstat-new.txt +++ b/go/two-fer/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: twofer -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkShareWith-4 2535352 531.3 ns/op 88 B/op 4 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkShareWith +BenchmarkShareWith-8 5915740 196.3 ns/op 88 B/op 4 allocs/op PASS -ok twofer 1.873s +ok twofer 1.372s diff --git a/go/two-fer/benchstat-old.txt b/go/two-fer/benchstat-old.txt new file mode 100644 index 00000000..935b2649 --- /dev/null +++ b/go/two-fer/benchstat-old.txt @@ -0,0 +1,7 @@ +goos: linux +goarch: amd64 +pkg: twofer +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz +BenchmarkShareWith-4 2535352 531.3 ns/op 88 B/op 4 allocs/op +PASS +ok twofer 1.873s diff --git a/go/two-fer/coverage-annotations.txt b/go/two-fer/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/two-fer/coverage.out b/go/two-fer/coverage.out index aaac59f9..03c88e67 100644 --- a/go/two-fer/coverage.out +++ b/go/two-fer/coverage.out @@ -1,4 +1,4 @@ mode: count twofer/two_fer.go:9.36,10.16 1 6 -twofer/two_fer.go:14.2,14.53 1 4 twofer/two_fer.go:10.16,12.3 1 2 +twofer/two_fer.go:14.2,14.53 1 4 diff --git a/go/two-fer/run-tests-go.txt b/go/two-fer/run-tests-go.txt index 4c9f1f27..c83106fb 100644 --- a/go/two-fer/run-tests-go.txt +++ b/go/two-fer/run-tests-go.txt @@ -5,124 +5,716 @@ Go packages: twofer =============================================================================== -golint twofer +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.164s -user 0m0.142s -sys 0m0.144s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.031s +sys 0m0.052s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +two_fer_test.go:28: File is not `gofumpt`-ed (gofumpt) + +two_fer_test.go:32: File is not `gofumpt`-ed (gofumpt) + +two_fer_test.go:27: unnecessary leading newline (whitespace) + for i := 0; i < b.N; i++ { + +two_fer_test.go:33:2: block should not end with a whitespace (or comment) (wsl) + } + ^ +two_fer_test.go:7:5: tests is a global variable (gochecknoglobals) +var tests = []struct { + ^ +two_fer_test.go:15:1: Function TestShareWith missing the call to method parallel (paralleltest) +func TestShareWith(t *testing.T) { +^ +two_fer_examples_test.go:1:9: package should be `twofer_test` instead of `twofer` (testpackage) +package twofer + ^ +two_fer_test.go:1:9: package should be `twofer_test` instead of `twofer` (testpackage) +package twofer + ^ + +real 0m0.442s +user 0m0.552s +sys 0m0.384s + + + ============================================================================== + +Exit code: -1 + +real 0m0.486s +user 0m0.591s +sys 0m0.445s + +real 0m0.488s +user 0m0.594s +sys 0m0.445s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.044s +user 0m0.032s +sys 0m0.034s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.044s +user 0m0.022s +sys 0m0.034s + + + ============================================================================== + +Exit code: 0 + +real 0m0.119s +user 0m0.065s +sys 0m0.100s + +real 0m0.123s +user 0m0.067s +sys 0m0.101s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.024s +sys 0m0.027s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "twofer" + +real 0m0.133s +user 0m0.164s +sys 0m0.137s + + + ============================================================================== + +Exit code: -1 + +real 0m0.186s +user 0m0.206s +sys 0m0.194s + +real 0m0.188s +user 0m0.207s +sys 0m0.195s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.048s +user 0m0.054s +sys 0m0.060s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.232s +user 0m0.288s +sys 0m0.158s + + + ============================================================================== + +Exit code: 0 + +real 0m0.298s +user 0m0.348s +sys 0m0.236s + +real 0m0.301s +user 0m0.350s +sys 0m0.237s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.028s +sys 0m0.028s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.859s +user 0m2.146s +sys 0m0.337s + + + ============================================================================== + +Exit code: 0 + +real 0m0.905s +user 0m2.181s +sys 0m0.379s + +real 0m0.907s +user 0m2.182s +sys 0m0.380s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.018s +sys 0m0.028s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.081s +user 0m0.097s +sys 0m0.072s + + + ============================================================================== + +Exit code: 0 + +real 0m0.123s +user 0m0.118s +sys 0m0.113s + +real 0m0.125s +user 0m0.119s +sys 0m0.114s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.016s +sys 0m0.024s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.022s +user 0m0.025s +sys 0m0.020s + + + ============================================================================== + +Exit code: 0 + +real 0m0.056s +user 0m0.044s +sys 0m0.055s + +real 0m0.058s +user 0m0.044s +sys 0m0.057s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out twofer +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.028s +sys 0m0.027s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.504s +user 0m1.602s +sys 0m0.295s + + + ============================================================================== + +Exit code: 0 + +real 0m0.548s +user 0m1.636s +sys 0m0.331s + +real 0m0.550s +user 0m1.637s +sys 0m0.332s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.015s +sys 0m0.028s + + + ============================================================================== + +Running: gocyclo . + +4 twofer BenchmarkShareWith two_fer_test.go:23:1 +3 twofer TestShareWith two_fer_test.go:15:1 +2 twofer ShareWith two_fer.go:9:1 +1 twofer ExampleShareWith two_fer_examples_test.go:7:1 + +real 0m0.003s +user 0m0.000s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.040s +user 0m0.022s +sys 0m0.039s + +real 0m0.041s +user 0m0.022s +sys 0m0.040s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.040s +user 0m0.034s +sys 0m0.020s + + + ============================================================================== + +Exit code: 0 + +real 0m0.054s +user 0m0.040s +sys 0m0.033s + +real 0m0.056s +user 0m0.041s +sys 0m0.035s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.016s +sys 0m0.036s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:32:03 Including rules: default +[gosec] 2023/09/07 00:32:03 Excluding rules: default +[gosec] 2023/09/07 00:32:03 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/two-fer +[gosec] 2023/09/07 00:32:03 Checking package: twofer +[gosec] 2023/09/07 00:32:03 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/two-fer/two_fer.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 15 + Nosec : 0 + Issues : 0 + + +real 0m0.124s +user 0m0.126s +sys 0m0.109s + + + ============================================================================== + +Exit code: 0 + +real 0m0.171s +user 0m0.147s +sys 0m0.157s + +real 0m0.174s +user 0m0.147s +sys 0m0.160s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.021s +sys 0m0.031s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestShareWith --- PASS: TestShareWith (0.00s) === RUN ExampleShareWith --- PASS: ExampleShareWith (0.00s) PASS coverage: 100.0% of statements -ok twofer 0.011s coverage: 100.0% of statements +ok twofer 0.002s coverage: 100.0% of statements -real 0m0.570s -user 0m0.660s -sys 0m0.360s +real 0m0.177s +user 0m0.210s +sys 0m0.130s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + twofer/two_fer.go:9: ShareWith 100.0% total: (statements) 100.0% -real 0m0.269s -user 0m0.212s -sys 0m0.246s +real 0m0.052s +user 0m0.058s +sys 0m0.087s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.228s -user 0m0.188s -sys 0m0.216s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic twofer +real 0m0.049s +user 0m0.068s +sys 0m0.078s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.020s +user 0m0.020s +sys 0m0.020s + +real 0m0.020s +user 0m0.020s +sys 0m0.020s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestShareWith --- PASS: TestShareWith (0.00s) === RUN ExampleShareWith --- PASS: ExampleShareWith (0.00s) PASS coverage: 100.0% of statements -ok twofer 0.034s coverage: 100.0% of statements +ok twofer 1.014s coverage: 100.0% of statements + +real 0m1.240s +user 0m0.260s +sys 0m0.205s + + + ============================================================================== -real 0m0.616s -user 0m0.666s -sys 0m0.426s +Exit code: 0 + +real 0m1.577s +user 0m0.640s +sys 0m0.565s + +real 0m1.579s +user 0m0.641s +sys 0m0.566s =============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: twofer -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkShareWith-4 2535352 531.3 ns/op 88 B/op 4 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkShareWith +BenchmarkShareWith-8 5915740 196.3 ns/op 88 B/op 4 allocs/op PASS -ok twofer 1.873s +ok twofer 1.372s -real 0m2.386s -user 0m2.904s -sys 0m0.477s +real 0m1.513s +user 0m1.597s +sys 0m0.159s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestShareWith +--- PASS: TestShareWith (0.00s) +=== RUN ExampleShareWith +--- PASS: ExampleShareWith (0.00s) PASS -ok twofer 0.004s - -real 0m0.495s -user 0m0.555s -sys 0m0.428s - -=============================================================================== - -No old benchmarks to run benchstat against. - -=============================================================================== - -go vet twofer +ok twofer 0.001s -real 0m0.357s -user 0m0.342s -sys 0m0.312s +real 0m0.144s +user 0m0.185s +sys 0m0.140s =============================================================================== -go fix twofer +benchstat benchstat-old.txt benchstat-new.txt +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: twofer +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +ShareWith-8 196.3n ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +ShareWith-8 88.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +ShareWith-8 4.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.154s -user 0m0.136s -sys 0m0.153s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +ShareWith-4 531.3n ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +ShareWith-4 88.00 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./two-fer -[gosec] 2022/07/24 00:43:51 Including rules: default -[gosec] 2022/07/24 00:43:51 Excluding rules: default -[gosec] 2022/07/24 00:43:51 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/two-fer -2022/07/24 00:43:51 internal error: package "fmt" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +ShareWith-4 4.000 ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.474s -user 0m0.524s -sys 0m0.369s +real 0m0.002s +user 0m0.001s +sys 0m0.002s =============================================================================== gomarkdoc --output twofer-doc.md -real 0m0.047s -user 0m0.020s -sys 0m0.020s +real 0m0.015s +user 0m0.008s +sys 0m0.007s =============================================================================== @@ -137,9 +729,9 @@ func ShareWith(name string) string ShareWith returns a string with the sharing instructions. -real 0m0.249s -user 0m0.186s -sys 0m0.211s +real 0m0.068s +user 0m0.047s +sys 0m0.052s =============================================================================== diff --git a/go/two-fer/twofer-doc.md b/go/two-fer/twofer-doc.md index 047f336f..b5b7e898 100755 --- a/go/two-fer/twofer-doc.md +++ b/go/two-fer/twofer-doc.md @@ -19,7 +19,7 @@ Package twofer for https://exercism.org/tracks/go/exercises/two-fer func ShareWith(name string) string ``` -ShareWith returns a string with the sharing instructions\. +ShareWith returns a string with the sharing instructions.

Example

diff --git a/go/vehicle-purchase/benchstat-new.txt b/go/vehicle-purchase/benchstat-new.txt index 6ffc9b4a..fe79f69e 100644 --- a/go/vehicle-purchase/benchstat-new.txt +++ b/go/vehicle-purchase/benchstat-new.txt @@ -1,2 +1,2 @@ PASS -ok purchase 0.015s +ok purchase 0.002s diff --git a/go/vehicle-purchase/benchstat-old.txt b/go/vehicle-purchase/benchstat-old.txt new file mode 100644 index 00000000..6ffc9b4a --- /dev/null +++ b/go/vehicle-purchase/benchstat-old.txt @@ -0,0 +1,2 @@ +PASS +ok purchase 0.015s diff --git a/go/vehicle-purchase/coverage-annotations.txt b/go/vehicle-purchase/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/vehicle-purchase/coverage.out b/go/vehicle-purchase/coverage.out index b4487671..bfac1659 100644 --- a/go/vehicle-purchase/coverage.out +++ b/go/vehicle-purchase/coverage.out @@ -1,15 +1,15 @@ mode: count purchase/vehicle_purchase.go:8.37,11.14 2 7 -purchase/vehicle_purchase.go:18.2,18.15 1 7 purchase/vehicle_purchase.go:12.22,13.16 1 3 purchase/vehicle_purchase.go:14.10,15.17 1 4 +purchase/vehicle_purchase.go:18.2,18.15 1 7 purchase/vehicle_purchase.go:22.52,25.23 2 12 -purchase/vehicle_purchase.go:31.2,31.64 1 12 purchase/vehicle_purchase.go:25.23,27.3 1 6 purchase/vehicle_purchase.go:27.8,29.3 1 6 +purchase/vehicle_purchase.go:31.2,31.64 1 12 purchase/vehicle_purchase.go:35.63,38.13 2 9 -purchase/vehicle_purchase.go:46.2,46.31 1 9 purchase/vehicle_purchase.go:38.13,40.3 1 3 purchase/vehicle_purchase.go:40.8,40.33 1 6 purchase/vehicle_purchase.go:40.33,42.3 1 3 purchase/vehicle_purchase.go:42.8,44.3 1 3 +purchase/vehicle_purchase.go:46.2,46.31 1 9 diff --git a/go/vehicle-purchase/purchase-doc.md b/go/vehicle-purchase/purchase-doc.md index 394189f4..90ed5a30 100755 --- a/go/vehicle-purchase/purchase-doc.md +++ b/go/vehicle-purchase/purchase-doc.md @@ -19,7 +19,7 @@ import "purchase" func CalculateResellPrice(originalPrice, age float64) float64 ``` -CalculateResellPrice calculates how much a vehicle can resell for at a certain age\. +CalculateResellPrice calculates how much a vehicle can resell for at a certain age.

Example

@@ -50,7 +50,7 @@ CalculateResellPrice calculates how much a vehicle can resell for at a certain a func ChooseVehicle(option1, option2 string) string ``` -ChooseVehicle recommends a vehicle for selection\. It always recommends the vehicle that comes first in lexicographical order\. +ChooseVehicle recommends a vehicle for selection. It always recommends the vehicle that comes first in lexicographical order.

Example

@@ -79,7 +79,7 @@ Volkswagen Beetle is clearly the better choice. func NeedsLicense(kind string) bool ``` -NeedsLicense determines whether a license is needed to drive a type of vehicle\. Only "car" and "truck" require a license\. +NeedsLicense determines whether a license is needed to drive a type of vehicle. Only "car" and "truck" require a license.

Example

diff --git a/go/vehicle-purchase/run-tests-go.txt b/go/vehicle-purchase/run-tests-go.txt index 95c12315..2acc689e 100644 --- a/go/vehicle-purchase/run-tests-go.txt +++ b/go/vehicle-purchase/run-tests-go.txt @@ -5,22 +5,607 @@ Go packages: purchase =============================================================================== -golint purchase +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.248s -user 0m0.220s -sys 0m0.238s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.035s +user 0m0.026s +sys 0m0.035s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +vehicle_purchase.go:38:2: ifElseChain: rewrite if-else to switch statement (gocritic) + if age < 3 { + ^ +vehicle_purchase.go:7: line is 124 characters (lll) +// NeedsLicense determines whether a license is needed to drive a type of vehicle. Only "car" and "truck" require a license. +vehicle_purchase.go:21: line is 128 characters (lll) +// ChooseVehicle recommends a vehicle for selection. It always recommends the vehicle that comes first in lexicographical order. +vehicle_purchase_test.go:81:20: `Bergamont` is a misspelling of `Bergamot` (misspell) + choice1: "2018 Bergamont City", + ^ +vehicle_purchase_test.go:83:20: `Bergamont` is a misspelling of `Bergamot` (misspell) + expected: "2018 Bergamont City is clearly the better choice.", + ^ +vehicle_purchase_test.go:45:27: Using the variable on range scope `test` in function literal (scopelint) + actual := NeedsLicense(test.kind) + ^ +vehicle_purchase_test.go:46:17: Using the variable on range scope `test` in function literal (scopelint) + if actual != test.expected { + ^ +vehicle_purchase_test.go:49:6: Using the variable on range scope `test` in function literal (scopelint) + test.kind, + ^ +vehicle_purchase_test.go:181:2: return statements should not be cuddled if block has more than two lines (wsl) + return absoluteDifferenceBelowThreshold || relativeDifferenceBelowThreshold + ^ +vehicle_purchase_test.go:10:1: Function TestNeedsLicense missing the call to method parallel (paralleltest) +func TestNeedsLicense(t *testing.T) { +^ +vehicle_purchase_test.go:43:2: Range statement for test TestNeedsLicense missing the call to method parallel in test Run (paralleltest) + for _, test := range tests { + ^ +vehicle_purchase_test.go:57:1: Function TestChooseVehicle missing the call to method parallel (paralleltest) +func TestChooseVehicle(t *testing.T) { +^ +vehicle_purchase_test.go:92:2: Range statement for test TestChooseVehicle missing the call to method parallel in test Run (paralleltest) + for _, test := range tests { + ^ +vehicle_purchase_test.go:118:1: Function TestCalculateResellPrice missing the call to method parallel (paralleltest) +func TestCalculateResellPrice(t *testing.T) { +^ +vehicle_purchase_test.go:163:2: Range statement for test TestCalculateResellPrice missing the call to method parallel in test Run (paralleltest) + for _, test := range tests { + ^ +vehicle_purchase_examples_test.go:1:9: package should be `purchase_test` instead of `purchase` (testpackage) +package purchase + ^ +vehicle_purchase_test.go:1:9: package should be `purchase_test` instead of `purchase` (testpackage) +package purchase + ^ + +real 0m0.473s +user 0m0.662s +sys 0m0.428s + + + ============================================================================== + +Exit code: -1 + +real 0m0.529s +user 0m0.696s +sys 0m0.482s + +real 0m0.533s +user 0m0.698s +sys 0m0.485s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.021s +sys 0m0.023s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +vehicle_purchase.go + (1, 1) https://revive.run/r#package-comments should have a package comment + + + ✖ 1 problem (0 errors) (1 warnings) + +real 0m0.039s +user 0m0.022s +sys 0m0.027s + + + ============================================================================== + +Exit code: 0 + +real 0m0.087s +user 0m0.053s +sys 0m0.067s + +real 0m0.089s +user 0m0.053s +sys 0m0.069s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.001s +sys 0m0.000s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.024s +sys 0m0.013s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "purchase" + +real 0m0.087s +user 0m0.117s +sys 0m0.121s + + + ============================================================================== + +Exit code: -1 + +real 0m0.120s +user 0m0.149s +sys 0m0.141s + +real 0m0.122s +user 0m0.151s +sys 0m0.141s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.020s +sys 0m0.018s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +vehicle_purchase.go:1:1: at least one file in a package should have a package comment (ST1000) + +real 0m0.175s +user 0m0.206s +sys 0m0.115s + + + ============================================================================== + +Exit code: -1 + +real 0m0.208s +user 0m0.232s +sys 0m0.143s + +real 0m0.211s +user 0m0.234s +sys 0m0.144s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.020s +sys 0m0.031s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + +./vehicle_purchase.go:38:2: ifElseChain: rewrite if-else to switch statement + +real 0m0.818s +user 0m1.922s +sys 0m0.316s + + + ============================================================================== + +Exit code: -1 + +real 0m0.857s +user 0m1.948s +sys 0m0.357s + +real 0m0.860s +user 0m1.949s +sys 0m0.358s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.021s +sys 0m0.019s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.084s +user 0m0.136s +sys 0m0.117s + + + ============================================================================== + +Exit code: 0 + +real 0m0.118s +user 0m0.162s +sys 0m0.146s + +real 0m0.121s +user 0m0.163s +sys 0m0.148s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.020s +sys 0m0.020s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.028s +user 0m0.028s +sys 0m0.017s + + + ============================================================================== + +Exit code: 0 + +real 0m0.064s +user 0m0.051s +sys 0m0.049s + +real 0m0.066s +user 0m0.051s +sys 0m0.051s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.015s +sys 0m0.031s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.500s +user 0m1.441s +sys 0m0.301s + + + ============================================================================== + +Exit code: 0 + +real 0m0.543s +user 0m1.467s +sys 0m0.343s + +real 0m0.545s +user 0m1.468s +sys 0m0.344s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.014s +sys 0m0.026s + + + ============================================================================== + +Running: gocyclo . + +4 purchase TestChooseVehicle vehicle_purchase_test.go:57:1 +4 purchase CalculateResellPrice vehicle_purchase.go:35:1 +3 purchase TestCalculateResellPrice vehicle_purchase_test.go:118:1 +3 purchase TestNeedsLicense vehicle_purchase_test.go:10:1 +2 purchase floatingPointEquals vehicle_purchase_test.go:178:1 +2 purchase ChooseVehicle vehicle_purchase.go:22:1 +2 purchase NeedsLicense vehicle_purchase.go:8:1 +1 purchase ExampleCalculateResellPrice vehicle_purchase_examples_test.go:23:1 +1 purchase ExampleChooseVehicle vehicle_purchase_examples_test.go:15:1 +1 purchase ExampleNeedsLicense vehicle_purchase_examples_test.go:7:1 + +real 0m0.003s +user 0m0.000s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.039s +user 0m0.023s +sys 0m0.038s + +real 0m0.041s +user 0m0.023s +sys 0m0.040s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + +vehicle_purchase_test.go:81:19: "Bergamont" is a misspelling of "Bergamot" +vehicle_purchase_test.go:83:19: "Bergamont" is a misspelling of "Bergamot" +run-tests-go.txt:48:33: "Bergamont" is a misspelling of "Bergamot" +run-tests-go.txt:49:19: "Bergamont" is a misspelling of "Bergamot" +run-tests-go.txt:51:33: "Bergamont" is a misspelling of "Bergamot" +run-tests-go.txt:52:19: "Bergamont" is a misspelling of "Bergamot" + +real 0m0.028s +user 0m0.029s +sys 0m0.014s + + + ============================================================================== + +Exit code: 0 + +real 0m0.040s +user 0m0.031s +sys 0m0.028s + +real 0m0.042s +user 0m0.032s +sys 0m0.029s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out purchase +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.018s +sys 0m0.030s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:32:09 Including rules: default +[gosec] 2023/09/07 00:32:09 Excluding rules: default +[gosec] 2023/09/07 00:32:09 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/vehicle-purchase +[gosec] 2023/09/07 00:32:09 Checking package: purchase +[gosec] 2023/09/07 00:32:09 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/vehicle-purchase/vehicle_purchase.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 47 + Nosec : 0 + Issues : 0 + + +real 0m0.126s +user 0m0.150s +sys 0m0.122s + + + ============================================================================== + +Exit code: 0 + +real 0m0.165s +user 0m0.171s +sys 0m0.167s + +real 0m0.168s +user 0m0.173s +sys 0m0.169s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.034s +sys 0m0.027s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestNeedsLicense === RUN TestNeedsLicense/need_a_license_for_a_car === RUN TestNeedsLicense/need_a_license_for_a_truck === RUN TestNeedsLicense/does_not_need_a_license_for_a_bike === RUN TestNeedsLicense/does_not_need_a_license_for_a_stroller === RUN TestNeedsLicense/does_not_need_a_license_for_a_e-scooter ---- PASS: TestNeedsLicense (0.02s) +--- PASS: TestNeedsLicense (0.00s) --- PASS: TestNeedsLicense/need_a_license_for_a_car (0.00s) --- PASS: TestNeedsLicense/need_a_license_for_a_truck (0.00s) --- PASS: TestNeedsLicense/does_not_need_a_license_for_a_bike (0.00s) @@ -60,42 +645,63 @@ go test -v -covermode=count -coverprofile coverage.out purchase --- PASS: ExampleCalculateResellPrice (0.00s) PASS coverage: 100.0% of statements -ok purchase 0.028s coverage: 100.0% of statements +ok purchase 0.002s coverage: 100.0% of statements -real 0m0.638s -user 0m0.702s -sys 0m0.500s +real 0m0.187s +user 0m0.244s +sys 0m0.159s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + purchase/vehicle_purchase.go:8: NeedsLicense 100.0% purchase/vehicle_purchase.go:22: ChooseVehicle 100.0% purchase/vehicle_purchase.go:35: CalculateResellPrice 100.0% total: (statements) 100.0% -real 0m0.230s -user 0m0.241s -sys 0m0.186s +real 0m0.049s +user 0m0.052s +sys 0m0.065s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.239s -user 0m0.217s -sys 0m0.213s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic purchase +real 0m0.061s +user 0m0.074s +sys 0m0.084s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.028s +user 0m0.021s +sys 0m0.034s + +real 0m0.028s +user 0m0.021s +sys 0m0.034s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestNeedsLicense === RUN TestNeedsLicense/need_a_license_for_a_car === RUN TestNeedsLicense/need_a_license_for_a_truck === RUN TestNeedsLicense/does_not_need_a_license_for_a_bike === RUN TestNeedsLicense/does_not_need_a_license_for_a_stroller === RUN TestNeedsLicense/does_not_need_a_license_for_a_e-scooter ---- PASS: TestNeedsLicense (0.01s) +--- PASS: TestNeedsLicense (0.00s) --- PASS: TestNeedsLicense/need_a_license_for_a_car (0.00s) --- PASS: TestNeedsLicense/need_a_license_for_a_truck (0.00s) --- PASS: TestNeedsLicense/does_not_need_a_license_for_a_bike (0.00s) @@ -135,71 +741,107 @@ go test -v -race -covermode=atomic purchase --- PASS: ExampleCalculateResellPrice (0.00s) PASS coverage: 100.0% of statements -ok purchase 0.055s coverage: 100.0% of statements +ok purchase 1.020s coverage: 100.0% of statements -real 0m0.685s -user 0m0.673s -sys 0m0.456s - -=============================================================================== +real 0m1.279s +user 0m0.320s +sys 0m0.182s -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -PASS -ok purchase 0.015s -real 0m0.517s -user 0m0.524s -sys 0m0.384s + ============================================================================== -=============================================================================== +Exit code: 0 -go test -tags bonus -PASS -ok purchase 0.006s +real 0m1.649s +user 0m0.757s +sys 0m0.556s -real 0m0.511s -user 0m0.553s -sys 0m0.404s +real 0m1.651s +user 0m0.757s +sys 0m0.557s =============================================================================== -No old benchmarks to run benchstat against. - -=============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go vet purchase +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok purchase 0.002s -real 0m0.367s -user 0m0.388s -sys 0m0.313s +real 0m0.199s +user 0m0.250s +sys 0m0.181s =============================================================================== -go fix purchase +gotest -v -tags bonus +=== RUN TestNeedsLicense +=== RUN TestNeedsLicense/need_a_license_for_a_car +=== RUN TestNeedsLicense/need_a_license_for_a_truck +=== RUN TestNeedsLicense/does_not_need_a_license_for_a_bike +=== RUN TestNeedsLicense/does_not_need_a_license_for_a_stroller +=== RUN TestNeedsLicense/does_not_need_a_license_for_a_e-scooter +--- PASS: TestNeedsLicense (0.00s) + --- PASS: TestNeedsLicense/need_a_license_for_a_car (0.00s) + --- PASS: TestNeedsLicense/need_a_license_for_a_truck (0.00s) + --- PASS: TestNeedsLicense/does_not_need_a_license_for_a_bike (0.00s) + --- PASS: TestNeedsLicense/does_not_need_a_license_for_a_stroller (0.00s) + --- PASS: TestNeedsLicense/does_not_need_a_license_for_a_e-scooter (0.00s) +=== RUN TestChooseVehicle +=== RUN TestChooseVehicle/chooses_Bugatti_over_Ford +=== RUN TestChooseVehicle/chooses_Chery_over_Kia +=== RUN TestChooseVehicle/chooses_Ford_Focus_over_Ford_Pinto +=== RUN TestChooseVehicle/chooses_2018_over_2020 +=== RUN TestChooseVehicle/chooses_Bugatti_over_ford +--- PASS: TestChooseVehicle (0.00s) + --- PASS: TestChooseVehicle/chooses_Bugatti_over_Ford (0.00s) + --- PASS: TestChooseVehicle/chooses_Chery_over_Kia (0.00s) + --- PASS: TestChooseVehicle/chooses_Ford_Focus_over_Ford_Pinto (0.00s) + --- PASS: TestChooseVehicle/chooses_2018_over_2020 (0.00s) + --- PASS: TestChooseVehicle/chooses_Bugatti_over_ford (0.00s) +=== RUN TestCalculateResellPrice +=== RUN TestCalculateResellPrice/price_is_reduced_to_80%%_for_age_below_3 +=== RUN TestCalculateResellPrice/price_is_reduced_to_80%%_for_age_below_3#01 +=== RUN TestCalculateResellPrice/price_is_reduced_to_70%%_for_age_7 +=== RUN TestCalculateResellPrice/price_is_reduced_to_50%%_for_age_10 +=== RUN TestCalculateResellPrice/price_is_reduced_to_50%%_for_age_11 +=== RUN TestCalculateResellPrice/float_price_is_reduced_to_70%%_for_age_8, +--- PASS: TestCalculateResellPrice (0.00s) + --- PASS: TestCalculateResellPrice/price_is_reduced_to_80%%_for_age_below_3 (0.00s) + --- PASS: TestCalculateResellPrice/price_is_reduced_to_80%%_for_age_below_3#01 (0.00s) + --- PASS: TestCalculateResellPrice/price_is_reduced_to_70%%_for_age_7 (0.00s) + --- PASS: TestCalculateResellPrice/price_is_reduced_to_50%%_for_age_10 (0.00s) + --- PASS: TestCalculateResellPrice/price_is_reduced_to_50%%_for_age_11 (0.00s) + --- PASS: TestCalculateResellPrice/float_price_is_reduced_to_70%%_for_age_8, (0.00s) +=== RUN ExampleNeedsLicense +--- PASS: ExampleNeedsLicense (0.00s) +=== RUN ExampleChooseVehicle +--- PASS: ExampleChooseVehicle (0.00s) +=== RUN ExampleCalculateResellPrice +--- PASS: ExampleCalculateResellPrice (0.00s) +PASS +ok purchase 0.003s -real 0m0.177s -user 0m0.149s -sys 0m0.145s +real 0m0.125s +user 0m0.154s +sys 0m0.141s =============================================================================== -gosec ./vehicle-purchase -[gosec] 2022/07/24 00:43:07 Including rules: default -[gosec] 2022/07/24 00:43:07 Excluding rules: default -[gosec] 2022/07/24 00:43:07 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/vehicle-purchase -2022/07/24 00:43:07 internal error: package "fmt" without types was imported from "command-line-arguments" +benchstat benchstat-old.txt benchstat-new.txt -real 0m0.473s -user 0m0.490s -sys 0m0.329s +real 0m0.002s +user 0m0.001s +sys 0m0.002s =============================================================================== gomarkdoc --output purchase-doc.md -real 0m0.037s -user 0m0.026s -sys 0m0.015s +real 0m0.010s +user 0m0.002s +sys 0m0.008s =============================================================================== @@ -222,9 +864,9 @@ func NeedsLicense(kind string) bool vehicle. Only "car" and "truck" require a license. -real 0m0.256s -user 0m0.179s -sys 0m0.221s +real 0m0.035s +user 0m0.017s +sys 0m0.036s =============================================================================== diff --git a/go/weather-forecast/benchstat-new.txt b/go/weather-forecast/benchstat-new.txt index f4985da3..a3289edc 100644 --- a/go/weather-forecast/benchstat-new.txt +++ b/go/weather-forecast/benchstat-new.txt @@ -1,2 +1,2 @@ PASS -ok weather 0.025s +ok weather 0.002s diff --git a/go/weather-forecast/benchstat-old.txt b/go/weather-forecast/benchstat-old.txt new file mode 100644 index 00000000..f4985da3 --- /dev/null +++ b/go/weather-forecast/benchstat-old.txt @@ -0,0 +1,2 @@ +PASS +ok weather 0.025s diff --git a/go/weather-forecast/coverage-annotations.txt b/go/weather-forecast/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/weather-forecast/run-tests-go.txt b/go/weather-forecast/run-tests-go.txt index c86e1c13..5a88f2d8 100644 --- a/go/weather-forecast/run-tests-go.txt +++ b/go/weather-forecast/run-tests-go.txt @@ -5,137 +5,740 @@ Go packages: weather =============================================================================== -golint weather +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.016s +user 0m0.007s +sys 0m0.014s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +weather_forecast_test.go:58: File is not `gofumpt`-ed (gofumpt) + } +weather_forecast_test.go:60: File is not `gofumpt`-ed (gofumpt) +} +weather_forecast_test.go:91: File is not `gofumpt`-ed (gofumpt) + +weather_forecast_test.go:59: unnecessary trailing newline (whitespace) + +} +weather_forecast_test.go:109: unnecessary leading newline (whitespace) +func testComment(entityKind, entityName, comment, wantedPrefix string) (ok bool, errString string) { + +weather_forecast_test.go:17:2: only one cuddle assignment allowed before if statement (wsl) + if err != nil { + ^ +weather_forecast_test.go:23:2: only one cuddle assignment allowed before if statement (wsl) + if got != wantedComments { + ^ +weather_forecast_test.go:48:2: if statements should only be cuddled with assignments (wsl) + if node.Doc == nil { + ^ +weather_forecast_test.go:92:1: block should not end with a whitespace (or comment) (wsl) +} +^ +weather_forecast_test.go:96:2: assignments should only be cuddled with other assignments (wsl) + funcName := node.Name.Name + ^ +weather_forecast_test.go:97:2: only one cuddle assignment allowed before if statement (wsl) + if node.Doc == nil { + ^ +weather_forecast_test.go:130:3: return statements should not be cuddled if block has more than two lines (wsl) + return false, errorString + ^ +weather_forecast_test.go:34:36: type assertion must be checked (forcetypeassert) + testBlockIdentifierComment(t, v.(*ast.ValueSpec)) + ^ +weather_forecast_test.go:64:2: type assertion must be checked (forcetypeassert) + identifierName := node.Specs[0].(*ast.ValueSpec).Names[0].Name + ^ +weather_forecast.go:5:5: CurrentCondition is a global variable (gochecknoglobals) +var CurrentCondition string + ^ +weather_forecast.go:8:5: CurrentLocation is a global variable (gochecknoglobals) +var CurrentLocation string + ^ +weather_forecast_test.go:21:2: variable 'wantedComments' is only used in the if-statement (weather_forecast_test.go:23:2); consider using short syntax (ifshort) + wantedComments := 4 + ^ +weather_forecast_test.go:22:2: variable 'got' is only used in the if-statement (weather_forecast_test.go:23:2); consider using short syntax (ifshort) + got := len(f.Comments) + ^ +weather_forecast.go:13:2: return with no blank line before (nlreturn) + return CurrentLocation + " - current weather condition: " + CurrentCondition + ^ +weather_forecast_test.go:42:3: return with no blank line before (nlreturn) + return true + ^ +weather_forecast_test.go:118:3: return with no blank line before (nlreturn) + return false, errorString + ^ +weather_forecast_test.go:12:1: Function TestComments missing the call to method parallel (paralleltest) +func TestComments(t *testing.T) { +^ +weather_forecast_examples_test.go:1:9: package should be `weather_test` instead of `weather` (testpackage) +package weather + ^ +weather_forecast_test.go:1:9: package should be `weather_test` instead of `weather` (testpackage) +package weather + ^ +weather_forecast_test.go:30:10: variable name 'n' is too short for the scope of its usage (varnamelen) + switch n := node.(type) { + ^ +weather_forecast_test.go:16:2: variable name 'f' is too short for the scope of its usage (varnamelen) + f, err := parser.ParseFile(fs, filename, nil, parser.ParseComments) + ^ + +real 0m0.841s +user 0m1.382s +sys 0m0.679s + + + ============================================================================== + +Exit code: -1 + +real 0m0.871s +user 0m1.396s +sys 0m0.703s + +real 0m0.873s +user 0m1.397s +sys 0m0.705s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.011s +user 0m0.002s +sys 0m0.012s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + -real 0m0.160s -user 0m0.099s -sys 0m0.116s +real 0m0.107s +user 0m0.044s +sys 0m0.072s + + + ============================================================================== + +Exit code: 0 + +real 0m0.128s +user 0m0.053s +sys 0m0.091s + +real 0m0.130s +user 0m0.055s +sys 0m0.092s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out weather -=== RUN TestComments ---- PASS: TestComments (0.00s) -=== RUN ExampleForecast ---- PASS: ExampleForecast (0.00s) -PASS -coverage: 100.0% of statements -ok weather 0.018s coverage: 100.0% of statements +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory -real 0m0.665s -user 0m0.653s -sys 0m0.583s +real 0m0.001s +user 0m0.001s +sys 0m0.000s =============================================================================== -go tool cover -func=coverage.out -weather/weather_forecast.go:11: Forecast 100.0% -total: (statements) 100.0% +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.008s +sys 0m0.017s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "weather [weather.test]" + +real 0m0.096s +user 0m0.122s +sys 0m0.114s + + + ============================================================================== + +Exit code: -1 + +real 0m0.131s +user 0m0.133s +sys 0m0.148s + +real 0m0.133s +user 0m0.134s +sys 0m0.149s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.003s +sys 0m0.017s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.163s +user 0m0.187s +sys 0m0.120s + + + ============================================================================== + +Exit code: 0 + +real 0m0.191s +user 0m0.197s +sys 0m0.147s + +real 0m0.194s +user 0m0.197s +sys 0m0.149s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.009s +sys 0m0.006s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.841s +user 0m2.049s +sys 0m0.286s + + + ============================================================================== + +Exit code: 0 + +real 0m0.864s +user 0m2.065s +sys 0m0.302s + +real 0m0.866s +user 0m2.065s +sys 0m0.302s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.015s +user 0m0.004s +sys 0m0.015s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.150s +user 0m0.222s +sys 0m0.142s + + + ============================================================================== + +Exit code: 0 + +real 0m0.175s +user 0m0.230s +sys 0m0.166s + +real 0m0.177s +user 0m0.231s +sys 0m0.167s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.017s +user 0m0.005s +sys 0m0.015s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.020s +user 0m0.009s +sys 0m0.016s + + + ============================================================================== + +Exit code: 0 + +real 0m0.051s +user 0m0.023s +sys 0m0.041s -real 0m0.079s +real 0m0.053s +user 0m0.025s +sys 0m0.041s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.013s +user 0m0.008s +sys 0m0.008s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.452s +user 0m1.271s +sys 0m0.253s + + + ============================================================================== + +Exit code: 0 + +real 0m0.476s +user 0m1.284s +sys 0m0.272s + +real 0m0.478s +user 0m1.284s +sys 0m0.274s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.007s +sys 0m0.015s + + + ============================================================================== + +Running: gocyclo . + +7 weather TestComments weather_forecast_test.go:12:1 +4 weather testComment weather_forecast_test.go:109:1 +3 weather testFunctionComment weather_forecast_test.go:94:1 +3 weather testBlockIdentifierComment weather_forecast_test.go:77:1 +3 weather testIdentifierComment weather_forecast_test.go:61:1 +3 weather testPackageComment weather_forecast_test.go:46:1 +1 weather ExampleForecast weather_forecast_examples_test.go:7:1 +1 weather Forecast weather_forecast.go:11:1 + +real 0m0.004s +user 0m0.001s +sys 0m0.003s + + + ============================================================================== + +Exit code: 0 + +real 0m0.033s +user 0m0.016s +sys 0m0.025s + +real 0m0.036s +user 0m0.017s +sys 0m0.026s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.028s +user 0m0.029s +sys 0m0.018s + + + ============================================================================== + +Exit code: 0 + +real 0m0.044s user 0m0.037s -sys 0m0.087s +sys 0m0.034s + +real 0m0.046s +user 0m0.039s +sys 0m0.034s =============================================================================== -go tool cover -html coverage.out -o coverage.html +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... -real 0m0.072s -user 0m0.047s -sys 0m0.079s + +real 0m0.020s +user 0m0.011s +sys 0m0.015s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:32:14 Including rules: default +[gosec] 2023/09/07 00:32:14 Excluding rules: default +[gosec] 2023/09/07 00:32:14 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/weather-forecast +[gosec] 2023/09/07 00:32:14 Checking package: weather +[gosec] 2023/09/07 00:32:14 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/weather-forecast/weather_forecast.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 14 + Nosec : 0 + Issues : 0 + + +real 0m0.077s +user 0m0.064s +sys 0m0.045s + + + ============================================================================== + +Exit code: 0 + +real 0m0.115s +user 0m0.088s +sys 0m0.072s + +real 0m0.117s +user 0m0.090s +sys 0m0.073s =============================================================================== -go test -v -race -covermode=atomic weather +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.012s +user 0m0.006s +sys 0m0.009s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestComments --- PASS: TestComments (0.00s) === RUN ExampleForecast --- PASS: ExampleForecast (0.00s) PASS coverage: 100.0% of statements -ok weather 0.047s coverage: 100.0% of statements +ok weather 0.003s coverage: 100.0% of statements -real 0m0.787s -user 0m1.058s -sys 0m0.564s +real 0m0.187s +user 0m0.366s +sys 0m0.167s -=============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -PASS -ok weather 0.025s + ============================================================================== -real 0m0.467s -user 0m0.532s -sys 0m0.353s +Running: go tool cover -func=coverage.out -=============================================================================== +weather/weather_forecast.go:11: Forecast 100.0% +total: (statements) 100.0% + +real 0m0.022s +user 0m0.015s +sys 0m0.011s -go test -tags bonus + + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.022s +user 0m0.010s +sys 0m0.017s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.011s +user 0m0.003s +sys 0m0.012s + +real 0m0.011s +user 0m0.003s +sys 0m0.012s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + +=== RUN TestComments +--- PASS: TestComments (0.00s) +=== RUN ExampleForecast +--- PASS: ExampleForecast (0.00s) PASS -ok weather 0.018s +coverage: 100.0% of statements +ok weather 1.018s coverage: 100.0% of statements -real 0m0.564s -user 0m0.573s -sys 0m0.393s +real 0m1.281s +user 0m0.423s +sys 0m0.227s -=============================================================================== -No old benchmarks to run benchstat against. + ============================================================================== -=============================================================================== +Exit code: 0 -go vet weather +real 0m1.547s +user 0m0.833s +sys 0m0.452s -real 0m0.577s -user 0m0.664s -sys 0m0.431s +real 0m1.549s +user 0m0.833s +sys 0m0.454s =============================================================================== -go fix weather +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' + +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok weather 0.002s -real 0m0.047s -user 0m0.019s -sys 0m0.036s +real 0m0.158s +user 0m0.182s +sys 0m0.138s =============================================================================== -gosec ./weather-forecast -[gosec] 2022/07/24 00:42:26 Including rules: default -[gosec] 2022/07/24 00:42:26 Excluding rules: default -[gosec] 2022/07/24 00:42:26 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/weather-forecast -[gosec] 2022/07/24 00:42:26 Checking package: weather -[gosec] 2022/07/24 00:42:26 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/weather-forecast/weather_forecast.go -Results: +gotest -v -tags bonus +=== RUN TestComments +--- PASS: TestComments (0.00s) +=== RUN ExampleForecast +--- PASS: ExampleForecast (0.00s) +PASS +ok weather 0.003s +real 0m0.128s +user 0m0.181s +sys 0m0.111s -Summary: - Files: 1 - Lines: 14 - Nosec: 0 - Issues: 0 +=============================================================================== +benchstat benchstat-old.txt benchstat-new.txt -real 0m0.269s -user 0m0.289s -sys 0m0.197s +real 0m0.002s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output weather-doc.md -real 0m0.036s -user 0m0.031s -sys 0m0.010s +real 0m0.013s +user 0m0.007s +sys 0m0.006s =============================================================================== go doc -all weather package weather // import "weather" -Package weather is a library for forcasting weather conditions in various -cities in Goblinocus. +Package weather is a library for forcasting weather conditions in various cities +in Goblinocus. VARIABLES @@ -152,9 +755,9 @@ func Forecast(city, condition string) string Forecast returns a string with the weather conditions for a city. -real 0m0.137s -user 0m0.052s -sys 0m0.140s +real 0m0.036s +user 0m0.021s +sys 0m0.023s =============================================================================== diff --git a/go/weather-forecast/weather-doc.md b/go/weather-forecast/weather-doc.md index ce599979..16e3f923 100755 --- a/go/weather-forecast/weather-doc.md +++ b/go/weather-forecast/weather-doc.md @@ -6,7 +6,7 @@ import "weather" ``` -Package weather is a library for forcasting weather conditions in various cities in Goblinocus\. +Package weather is a library for forcasting weather conditions in various cities in Goblinocus. ## Index @@ -16,13 +16,13 @@ Package weather is a library for forcasting weather conditions in various cities ## Variables -CurrentCondition stores the current weather conditions for a city\. +CurrentCondition stores the current weather conditions for a city. ```go var CurrentCondition string ``` -CurrentLocation stores the current city we're forcasting for\. +CurrentLocation stores the current city we're forcasting for. ```go var CurrentLocation string @@ -34,7 +34,7 @@ var CurrentLocation string func Forecast(city, condition string) string ``` -Forecast returns a string with the weather conditions for a city\. +Forecast returns a string with the weather conditions for a city.

Example

diff --git a/go/weather-forecast/weather-doc.txt b/go/weather-forecast/weather-doc.txt index e9445533..b74a7d03 100644 --- a/go/weather-forecast/weather-doc.txt +++ b/go/weather-forecast/weather-doc.txt @@ -1,7 +1,7 @@ package weather // import "weather" -Package weather is a library for forcasting weather conditions in various -cities in Goblinocus. +Package weather is a library for forcasting weather conditions in various cities +in Goblinocus. VARIABLES diff --git a/go/welcome-to-tech-palace/benchstat-new.txt b/go/welcome-to-tech-palace/benchstat-new.txt index a880d7aa..52ec1e58 100644 --- a/go/welcome-to-tech-palace/benchstat-new.txt +++ b/go/welcome-to-tech-palace/benchstat-new.txt @@ -1,2 +1,2 @@ PASS -ok techpalace 0.021s +ok techpalace 0.002s diff --git a/go/welcome-to-tech-palace/benchstat-old.txt b/go/welcome-to-tech-palace/benchstat-old.txt new file mode 100644 index 00000000..a880d7aa --- /dev/null +++ b/go/welcome-to-tech-palace/benchstat-old.txt @@ -0,0 +1,2 @@ +PASS +ok techpalace 0.021s diff --git a/go/welcome-to-tech-palace/coverage-annotations.txt b/go/welcome-to-tech-palace/coverage-annotations.txt new file mode 100644 index 00000000..e69de29b diff --git a/go/welcome-to-tech-palace/run-tests-go.txt b/go/welcome-to-tech-palace/run-tests-go.txt index 44515c16..dc19f3a4 100644 --- a/go/welcome-to-tech-palace/run-tests-go.txt +++ b/go/welcome-to-tech-palace/run-tests-go.txt @@ -5,15 +5,587 @@ Go packages: techpalace =============================================================================== -golint techpalace +Running: ../../.github/citools/go/go-lint-golangci-lint + +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.022s +sys 0m0.032s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +welcome_to_tech_palace_examples_test.go:22:14: var-declaration: should omit type string from declaration of var message; it will be inferred from the right-hand side (revive) + var message string = ` + ^ +welcome_to_tech_palace.go:15:11: var-declaration: should omit type string from declaration of var line; it will be inferred from the right-hand side (revive) + var line string = strings.Repeat("*", numStarsPerLine) + ^ +welcome_to_tech_palace_test.go:35:29: Using the variable on range scope `tt` in function literal (scopelint) + if got := WelcomeMessage(tt.customer); got != tt.want { + ^ +welcome_to_tech_palace_test.go:36:62: Using the variable on range scope `tt` in function literal (scopelint) + t.Errorf("WelcomeMessage(\"%s\") = \"%s\", want \"%s\"", tt.customer, got, tt.want) + ^ +welcome_to_tech_palace_test.go:65:24: Using the variable on range scope `tt` in function literal (scopelint) + if got := AddBorder(tt.welcomeMessage, tt.numStarsPerLine); got != tt.want { + ^ +welcome_to_tech_palace_test.go:5:1: Function TestWelcomeMessage missing the call to method parallel (paralleltest) +func TestWelcomeMessage(t *testing.T) { +^ +welcome_to_tech_palace_test.go:33:2: Range statement for test TestWelcomeMessage missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +welcome_to_tech_palace_test.go:42:1: Function TestAddBorder missing the call to method parallel (paralleltest) +func TestAddBorder(t *testing.T) { +^ +welcome_to_tech_palace_test.go:63:2: Range statement for test TestAddBorder missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +welcome_to_tech_palace_test.go:72:1: Function TestCleanupMessage missing the call to method parallel (paralleltest) +func TestCleanupMessage(t *testing.T) { +^ +welcome_to_tech_palace_test.go:95:2: Range statement for test TestCleanupMessage missing the call to method parallel in test Run (paralleltest) + for _, tt := range tests { + ^ +welcome_to_tech_palace_examples_test.go:1:9: package should be `techpalace_test` instead of `techpalace` (testpackage) +package techpalace + ^ +welcome_to_tech_palace_test.go:1:9: package should be `techpalace_test` instead of `techpalace` (testpackage) +package techpalace + ^ + +real 0m0.502s +user 0m0.766s +sys 0m0.474s + + + ============================================================================== + +Exit code: -1 + +real 0m0.542s +user 0m0.794s +sys 0m0.516s + +real 0m0.543s +user 0m0.796s +sys 0m0.516s -real 0m0.186s -user 0m0.188s -sys 0m0.203s +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.046s +sys 0m0.044s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +welcome_to_tech_palace.go + (1, 1) https://revive.run/r#package-comments should have a package comment + +welcome_to_tech_palace_examples_test.go + (22, 14) https://revive.run/r#var-declaration should omit type string from declaration of var message; it will be inferred from the right-hand side + + + ✖ 2 problems (0 errors) (2 warnings) + +real 0m0.050s +user 0m0.021s +sys 0m0.041s + + + ============================================================================== + +Exit code: 0 + +real 0m0.094s +user 0m0.072s +sys 0m0.096s + +real 0m0.096s +user 0m0.072s +sys 0m0.097s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.017s +sys 0m0.021s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "fmt" without types was imported from "techpalace" + +real 0m0.107s +user 0m0.150s +sys 0m0.159s + + + ============================================================================== + +Exit code: -1 + +real 0m0.140s +user 0m0.173s +sys 0m0.187s + +real 0m0.142s +user 0m0.174s +sys 0m0.188s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.022s +sys 0m0.030s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +welcome_to_tech_palace.go:1:1: at least one file in a package should have a package comment (ST1000) +welcome_to_tech_palace.go:15:11: should omit type string from declaration; it will be inferred from the right-hand side (ST1023) +welcome_to_tech_palace_examples_test.go:22:14: should omit type string from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.155s +user 0m0.192s +sys 0m0.113s + + + ============================================================================== + +Exit code: -1 + +real 0m0.199s +user 0m0.223s +sys 0m0.153s + +real 0m0.201s +user 0m0.223s +sys 0m0.155s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.025s +user 0m0.016s +sys 0m0.021s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.874s +user 0m2.294s +sys 0m0.337s + + + ============================================================================== + +Exit code: 0 + +real 0m0.916s +user 0m2.319s +sys 0m0.371s + +real 0m0.920s +user 0m2.320s +sys 0m0.373s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.032s +user 0m0.028s +sys 0m0.035s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.071s +user 0m0.121s +sys 0m0.108s + + + ============================================================================== + +Exit code: 0 + +real 0m0.117s +user 0m0.158s +sys 0m0.154s + +real 0m0.120s +user 0m0.158s +sys 0m0.157s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.026s +sys 0m0.029s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.030s +user 0m0.028s +sys 0m0.030s + + + ============================================================================== + +Exit code: 0 + +real 0m0.070s +user 0m0.059s +sys 0m0.068s + +real 0m0.072s +user 0m0.059s +sys 0m0.070s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out techpalace +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.026s +sys 0m0.034s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.476s +user 0m1.329s +sys 0m0.321s + + + ============================================================================== + +Exit code: 0 + +real 0m0.524s +user 0m1.362s +sys 0m0.373s + +real 0m0.527s +user 0m1.363s +sys 0m0.374s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.035s +user 0m0.032s +sys 0m0.042s + + + ============================================================================== + +Running: gocyclo . + +3 techpalace TestCleanupMessage welcome_to_tech_palace_test.go:72:1 +3 techpalace TestAddBorder welcome_to_tech_palace_test.go:42:1 +3 techpalace TestWelcomeMessage welcome_to_tech_palace_test.go:5:1 +1 techpalace ExampleCleanupMessage welcome_to_tech_palace_examples_test.go:21:1 +1 techpalace ExampleAddBorder welcome_to_tech_palace_examples_test.go:13:1 +1 techpalace ExampleWelcomeMessage welcome_to_tech_palace_examples_test.go:7:1 +1 techpalace CleanupMessage welcome_to_tech_palace.go:21:1 +1 techpalace AddBorder welcome_to_tech_palace.go:14:1 +1 techpalace WelcomeMessage welcome_to_tech_palace.go:9:1 + +real 0m0.002s +user 0m0.001s +sys 0m0.001s + + + ============================================================================== + +Exit code: 0 + +real 0m0.054s +user 0m0.042s +sys 0m0.056s + +real 0m0.056s +user 0m0.044s +sys 0m0.057s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.041s +user 0m0.037s +sys 0m0.023s + + + ============================================================================== + +Exit code: 0 + +real 0m0.064s +user 0m0.047s +sys 0m0.045s + +real 0m0.066s +user 0m0.048s +sys 0m0.046s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.021s +sys 0m0.022s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:32:19 Including rules: default +[gosec] 2023/09/07 00:32:19 Excluding rules: default +[gosec] 2023/09/07 00:32:19 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/welcome-to-tech-palace +[gosec] 2023/09/07 00:32:19 Checking package: techpalace +[gosec] 2023/09/07 00:32:19 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/welcome-to-tech-palace/welcome_to_tech_palace.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 28 + Nosec : 0 + Issues : 0 + + +real 0m0.132s +user 0m0.141s +sys 0m0.115s + + + ============================================================================== + +Exit code: 0 + +real 0m0.166s +user 0m0.167s +sys 0m0.149s + +real 0m0.168s +user 0m0.170s +sys 0m0.149s + +=============================================================================== + +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.038s +user 0m0.027s +sys 0m0.039s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestWelcomeMessage === RUN TestWelcomeMessage/Welcome_message_for_customer_with_first_letter_capitalized === RUN TestWelcomeMessage/Welcome_message_for_customer_with_only_lowercase_letters @@ -46,35 +618,56 @@ go test -v -covermode=count -coverprofile coverage.out techpalace --- PASS: ExampleCleanupMessage (0.00s) PASS coverage: 100.0% of statements -ok techpalace 0.012s coverage: 100.0% of statements +ok techpalace 0.003s coverage: 100.0% of statements -real 0m0.588s -user 0m0.689s -sys 0m0.441s +real 0m0.180s +user 0m0.239s +sys 0m0.155s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + techpalace/welcome_to_tech_palace.go:9: WelcomeMessage 100.0% techpalace/welcome_to_tech_palace.go:14: AddBorder 100.0% techpalace/welcome_to_tech_palace.go:21: CleanupMessage 100.0% total: (statements) 100.0% -real 0m0.224s -user 0m0.208s -sys 0m0.195s +real 0m0.064s +user 0m0.079s +sys 0m0.089s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.213s -user 0m0.204s -sys 0m0.232s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic techpalace +real 0m0.050s +user 0m0.055s +sys 0m0.068s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +real 0m0.020s +user 0m0.023s +sys 0m0.018s + +real 0m0.020s +user 0m0.023s +sys 0m0.018s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestWelcomeMessage === RUN TestWelcomeMessage/Welcome_message_for_customer_with_first_letter_capitalized === RUN TestWelcomeMessage/Welcome_message_for_customer_with_only_lowercase_letters @@ -88,7 +681,7 @@ go test -v -race -covermode=atomic techpalace === RUN TestAddBorder === RUN TestAddBorder/Add_border_with_10_stars_per_line === RUN TestAddBorder/Add_border_with_2_stars_per_line ---- PASS: TestAddBorder (0.01s) +--- PASS: TestAddBorder (0.00s) --- PASS: TestAddBorder/Add_border_with_10_stars_per_line (0.00s) --- PASS: TestAddBorder/Add_border_with_2_stars_per_line (0.00s) === RUN TestCleanupMessage @@ -107,71 +700,93 @@ go test -v -race -covermode=atomic techpalace --- PASS: ExampleCleanupMessage (0.00s) PASS coverage: 100.0% of statements -ok techpalace 0.050s coverage: 100.0% of statements +ok techpalace 1.014s coverage: 100.0% of statements -real 0m0.712s -user 0m0.706s -sys 0m0.462s +real 0m1.258s +user 0m0.275s +sys 0m0.177s -=============================================================================== -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt -PASS -ok techpalace 0.021s + ============================================================================== -real 0m0.460s -user 0m0.529s -sys 0m0.330s +Exit code: 0 -=============================================================================== +real 0m1.633s +user 0m0.707s +sys 0m0.567s -go test -tags bonus -PASS -ok techpalace 0.004s - -real 0m0.567s -user 0m0.638s -sys 0m0.439s +real 0m1.637s +user 0m0.711s +sys 0m0.568s =============================================================================== -No old benchmarks to run benchstat against. - -=============================================================================== +mv -v benchstat-new.txt benchstat-old.txt +renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go vet techpalace +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt +PASS +ok techpalace 0.002s -real 0m0.298s -user 0m0.305s -sys 0m0.293s +real 0m0.147s +user 0m0.208s +sys 0m0.145s =============================================================================== -go fix techpalace +gotest -v -tags bonus +=== RUN TestWelcomeMessage +=== RUN TestWelcomeMessage/Welcome_message_for_customer_with_first_letter_capitalized +=== RUN TestWelcomeMessage/Welcome_message_for_customer_with_only_lowercase_letters +=== RUN TestWelcomeMessage/Welcome_message_for_customer_with_dash_in_name +=== RUN TestWelcomeMessage/Welcome_message_for_customer_with_only_uppercase_letters +--- PASS: TestWelcomeMessage (0.00s) + --- PASS: TestWelcomeMessage/Welcome_message_for_customer_with_first_letter_capitalized (0.00s) + --- PASS: TestWelcomeMessage/Welcome_message_for_customer_with_only_lowercase_letters (0.00s) + --- PASS: TestWelcomeMessage/Welcome_message_for_customer_with_dash_in_name (0.00s) + --- PASS: TestWelcomeMessage/Welcome_message_for_customer_with_only_uppercase_letters (0.00s) +=== RUN TestAddBorder +=== RUN TestAddBorder/Add_border_with_10_stars_per_line +=== RUN TestAddBorder/Add_border_with_2_stars_per_line +--- PASS: TestAddBorder (0.00s) + --- PASS: TestAddBorder/Add_border_with_10_stars_per_line (0.00s) + --- PASS: TestAddBorder/Add_border_with_2_stars_per_line (0.00s) +=== RUN TestCleanupMessage +=== RUN TestCleanupMessage/Cleanup_message_with_many_stars_and_leading_and_trailing_whitespace +=== RUN TestCleanupMessage/Cleanup_message_without_leading_or_trailing_whitespace +=== RUN TestCleanupMessage/Cleanup_message_without_leading_whitespace +--- PASS: TestCleanupMessage (0.00s) + --- PASS: TestCleanupMessage/Cleanup_message_with_many_stars_and_leading_and_trailing_whitespace (0.00s) + --- PASS: TestCleanupMessage/Cleanup_message_without_leading_or_trailing_whitespace (0.00s) + --- PASS: TestCleanupMessage/Cleanup_message_without_leading_whitespace (0.00s) +=== RUN ExampleWelcomeMessage +--- PASS: ExampleWelcomeMessage (0.00s) +=== RUN ExampleAddBorder +--- PASS: ExampleAddBorder (0.00s) +=== RUN ExampleCleanupMessage +--- PASS: ExampleCleanupMessage (0.00s) +PASS +ok techpalace 0.002s -real 0m0.189s -user 0m0.199s -sys 0m0.220s +real 0m0.122s +user 0m0.158s +sys 0m0.106s =============================================================================== -gosec ./welcome-to-tech-palace -[gosec] 2022/07/24 00:41:37 Including rules: default -[gosec] 2022/07/24 00:41:37 Excluding rules: default -[gosec] 2022/07/24 00:41:37 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/welcome-to-tech-palace -2022/07/24 00:41:38 internal error: package "fmt" without types was imported from "command-line-arguments" +benchstat benchstat-old.txt benchstat-new.txt -real 0m0.476s -user 0m0.527s -sys 0m0.370s +real 0m0.002s +user 0m0.001s +sys 0m0.001s =============================================================================== gomarkdoc --output techpalace-doc.md -real 0m0.023s -user 0m0.017s -sys 0m0.012s +real 0m0.010s +user 0m0.006s +sys 0m0.004s =============================================================================== @@ -191,9 +806,9 @@ func WelcomeMessage(customer string) string WelcomeMessage returns a welcome message for the customer. -real 0m0.218s -user 0m0.166s -sys 0m0.199s +real 0m0.040s +user 0m0.025s +sys 0m0.034s =============================================================================== diff --git a/go/welcome-to-tech-palace/techpalace-doc.md b/go/welcome-to-tech-palace/techpalace-doc.md index 22eec9e2..3fb20c79 100755 --- a/go/welcome-to-tech-palace/techpalace-doc.md +++ b/go/welcome-to-tech-palace/techpalace-doc.md @@ -19,7 +19,7 @@ import "techpalace" func AddBorder(welcomeMsg string, numStarsPerLine int) string ``` -AddBorder adds a border to a welcome message\. +AddBorder adds a border to a welcome message.

Example

@@ -48,7 +48,7 @@ Welcome! func CleanupMessage(oldMsg string) string ``` -CleanupMessage cleans up an old marketing message\. +CleanupMessage cleans up an old marketing message.

Example

@@ -81,7 +81,7 @@ BUY NOW, SAVE 10% func WelcomeMessage(customer string) string ``` -WelcomeMessage returns a welcome message for the customer\. +WelcomeMessage returns a welcome message for the customer.

Example

diff --git a/go/word-count/benchstat-new.txt b/go/word-count/benchstat-new.txt index 3f2a686b..30ad813c 100644 --- a/go/word-count/benchstat-new.txt +++ b/go/word-count/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: wordcount -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkWordCount-4 3898 310332 ns/op 86139 B/op 1150 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkWordCount +BenchmarkWordCount-8 10431 116806 ns/op 87077 B/op 1150 allocs/op PASS -ok wordcount 1.265s +ok wordcount 2.088s diff --git a/go/word-count/benchstat-old.txt b/go/word-count/benchstat-old.txt index 5dbbd123..3f2a686b 100644 --- a/go/word-count/benchstat-old.txt +++ b/go/word-count/benchstat-old.txt @@ -2,6 +2,6 @@ goos: linux goarch: amd64 pkg: wordcount cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkWordCount-4 2701 491216 ns/op 78760 B/op 1053 allocs/op +BenchmarkWordCount-4 3898 310332 ns/op 86139 B/op 1150 allocs/op PASS -ok wordcount 1.416s +ok wordcount 1.265s diff --git a/go/word-count/coverage-annotations.txt b/go/word-count/coverage-annotations.txt new file mode 100644 index 00000000..c3b8a40d --- /dev/null +++ b/go/word-count/coverage-annotations.txt @@ -0,0 +1,60 @@ + +13 func WordCount(phrase string) Frequency { +14 +15 // remove punctuation - except for ' +16 reStr := `["_;:.,!@$%^&]` +17 re, e := regexp.Compile(reStr) +18 if e != nil { +19 MISS panic(e) +20 } +21 phrase = re.ReplaceAllString(phrase, " ") +22 +23 // change [a-z]['][a-z] to _ +24 reStr = `([a-z])[']([a-z])` +25 re, e = regexp.Compile(reStr) +26 if e != nil { +27 MISS panic(e) +28 } +29 phrase = re.ReplaceAllString(phrase, `${1}_${2}`) +30 +31 // remove extra ' +32 reStr = `[']` +33 re, e = regexp.Compile(reStr) +34 if e != nil { +35 MISS panic(e) +36 } +37 phrase = re.ReplaceAllString(phrase, " ") +38 +39 // change _ to ' +40 reStr = `_` +41 re, e = regexp.Compile(reStr) +42 if e != nil { +43 MISS panic(e) +44 } +45 phrase = re.ReplaceAllString(phrase, "'") +46 +47 // lowercase, trim space +48 phrase = strings.ToLower(phrase) +49 phrase = strings.TrimSpace(phrase) +50 +51 // convert all whitespace to single space +52 reStr = `[[:space:]]+` +53 re, e = regexp.Compile(reStr) +54 if e != nil { +55 MISS panic(e) +56 } +57 phrase = re.ReplaceAllString(phrase, " ") +58 +59 // split on whitespace +60 words := strings.Split(phrase, " ") +61 +62 // walk slice and fill frequency map +63 freqMap := Frequency{} +64 for _, word := range words { +65 freqMap[word]++ +66 } +67 +68 // return frequency map +69 return freqMap +70 } + diff --git a/go/word-count/coverage.out b/go/word-count/coverage.out index 23c9f67b..30c7f063 100644 --- a/go/word-count/coverage.out +++ b/go/word-count/coverage.out @@ -1,14 +1,14 @@ mode: count wordcount/word_count.go:13.41,18.14 3 14 -wordcount/word_count.go:21.2,26.14 4 14 -wordcount/word_count.go:29.2,34.14 4 14 -wordcount/word_count.go:37.2,42.14 4 14 -wordcount/word_count.go:45.2,54.14 6 14 -wordcount/word_count.go:57.2,64.29 4 14 -wordcount/word_count.go:69.2,69.16 1 14 wordcount/word_count.go:18.14,19.11 1 0 +wordcount/word_count.go:21.2,26.14 4 14 wordcount/word_count.go:26.14,27.11 1 0 +wordcount/word_count.go:29.2,34.14 4 14 wordcount/word_count.go:34.14,35.11 1 0 +wordcount/word_count.go:37.2,42.14 4 14 wordcount/word_count.go:42.14,43.11 1 0 +wordcount/word_count.go:45.2,54.14 6 14 wordcount/word_count.go:54.14,55.11 1 0 +wordcount/word_count.go:57.2,64.29 4 14 wordcount/word_count.go:64.29,66.3 1 64 +wordcount/word_count.go:69.2,69.16 1 14 diff --git a/go/word-count/run-tests-go.txt b/go/word-count/run-tests-go.txt index 88d54191..0f4b123b 100644 --- a/go/word-count/run-tests-go.txt +++ b/go/word-count/run-tests-go.txt @@ -5,15 +5,588 @@ Go packages: wordcount =============================================================================== -golint wordcount +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.219s -user 0m0.211s -sys 0m0.172s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.029s +user 0m0.017s +sys 0m0.026s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +word_count.go:14: File is not `gofumpt`-ed (gofumpt) + +word_count_test.go:11:24: Using the variable on range scope `tc` in function literal (scopelint) + actual := WordCount(tc.input) + ^ +word_count_test.go:12:34: Using the variable on range scope `tc` in function literal (scopelint) + if !reflect.DeepEqual(actual, tc.expected) { + ^ +word_count_test.go:13:49: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("WordCount(%q)\n got:%v\nwant:%v", tc.input, actual, tc.expected) + ^ +word_count.go:13: unnecessary leading newline (whitespace) +func WordCount(phrase string) Frequency { + +word_count.go:18:2: only one cuddle assignment allowed before if statement (wsl) + if e != nil { + ^ +word_count.go:21:2: assignments should only be cuddled with other assignments (wsl) + phrase = re.ReplaceAllString(phrase, " ") + ^ +word_count.go:26:2: only one cuddle assignment allowed before if statement (wsl) + if e != nil { + ^ +word_count.go:29:2: assignments should only be cuddled with other assignments (wsl) + phrase = re.ReplaceAllString(phrase, `${1}_${2}`) + ^ +word_count.go:34:2: only one cuddle assignment allowed before if statement (wsl) + if e != nil { + ^ +word_count.go:37:2: assignments should only be cuddled with other assignments (wsl) + phrase = re.ReplaceAllString(phrase, " ") + ^ +word_count_test.go:23:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:6:5: testCases is a global variable (gochecknoglobals) +var testCases = []struct { + ^ +word_count_test.go:8:1: Function TestWordCount missing the call to method parallel (paralleltest) +func TestWordCount(t *testing.T) { +^ +word_count_test.go:9:2: Range statement for test TestWordCount missing the call to method parallel in test Run (paralleltest) + for _, tc := range testCases { + ^ +cases_test.go:1:9: package should be `wordcount_test` instead of `wordcount` (testpackage) +package wordcount + ^ +word_count_examples_test.go:1:9: package should be `wordcount_test` instead of `wordcount` (testpackage) +package wordcount + ^ +word_count_test.go:1:9: package should be `wordcount_test` instead of `wordcount` (testpackage) +package wordcount + ^ +word_count.go:17:2: variable name 're' is too short for the scope of its usage (varnamelen) + re, e := regexp.Compile(reStr) + ^ + +real 0m0.562s +user 0m0.798s +sys 0m0.554s + + + ============================================================================== + +Exit code: -1 + +real 0m0.606s +user 0m0.827s +sys 0m0.589s + +real 0m0.608s +user 0m0.828s +sys 0m0.591s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.010s +sys 0m0.021s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + + +real 0m0.064s +user 0m0.034s +sys 0m0.047s + + + ============================================================================== + +Exit code: 0 + +real 0m0.093s +user 0m0.049s +sys 0m0.076s + +real 0m0.096s +user 0m0.052s +sys 0m0.076s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.022s +sys 0m0.032s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "regexp" without types was imported from "wordcount" + +real 0m0.090s +user 0m0.107s +sys 0m0.113s + + + ============================================================================== + +Exit code: -1 + +real 0m0.140s +user 0m0.139s +sys 0m0.160s + +real 0m0.142s +user 0m0.140s +sys 0m0.161s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.016s +sys 0m0.015s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + + +real 0m0.163s +user 0m0.203s +sys 0m0.117s + + + ============================================================================== + +Exit code: 0 + +real 0m0.192s +user 0m0.223s +sys 0m0.145s + +real 0m0.195s +user 0m0.224s +sys 0m0.146s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.031s +user 0m0.022s +sys 0m0.029s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.857s +user 0m1.975s +sys 0m0.330s + + + ============================================================================== + +Exit code: 0 + +real 0m0.902s +user 0m2.005s +sys 0m0.370s + +real 0m0.904s +user 0m2.006s +sys 0m0.370s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.022s +user 0m0.011s +sys 0m0.024s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.070s +user 0m0.127s +sys 0m0.075s + + + ============================================================================== + +Exit code: 0 + +real 0m0.104s +user 0m0.143s +sys 0m0.110s + +real 0m0.106s +user 0m0.145s +sys 0m0.110s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.026s +user 0m0.020s +sys 0m0.020s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.031s +user 0m0.020s +sys 0m0.024s + + + ============================================================================== + +Exit code: 0 + +real 0m0.070s +user 0m0.048s +sys 0m0.053s + +real 0m0.072s +user 0m0.048s +sys 0m0.055s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.027s +user 0m0.017s +sys 0m0.026s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.481s +user 0m1.494s +sys 0m0.293s + + + ============================================================================== + +Exit code: 0 + +real 0m0.523s +user 0m1.517s +sys 0m0.337s + +real 0m0.525s +user 0m1.517s +sys 0m0.338s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.030s +user 0m0.031s +sys 0m0.020s + + + ============================================================================== + +Running: gocyclo . + +7 wordcount WordCount word_count.go:13:1 +4 wordcount BenchmarkWordCount word_count_test.go:19:1 +3 wordcount TestWordCount word_count_test.go:8:1 +1 wordcount ExampleWordCount word_count_examples_test.go:7:1 + +real 0m0.002s +user 0m0.001s +sys 0m0.001s + + + ============================================================================== + +Exit code: 0 + +real 0m0.044s +user 0m0.038s +sys 0m0.031s + +real 0m0.046s +user 0m0.039s +sys 0m0.032s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.031s +user 0m0.031s +sys 0m0.014s + + + ============================================================================== + +Exit code: 0 + +real 0m0.042s +user 0m0.037s +sys 0m0.023s + +real 0m0.043s +user 0m0.037s +sys 0m0.025s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.013s +sys 0m0.034s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:32:24 Including rules: default +[gosec] 2023/09/07 00:32:24 Excluding rules: default +[gosec] 2023/09/07 00:32:24 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/word-count +[gosec] 2023/09/07 00:32:24 Checking package: wordcount +[gosec] 2023/09/07 00:32:24 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/word-count/word_count.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 70 + Nosec : 0 + Issues : 0 + + +real 0m0.118s +user 0m0.122s +sys 0m0.075s + + + ============================================================================== + +Exit code: 0 + +real 0m0.160s +user 0m0.142s +sys 0m0.121s + +real 0m0.163s +user 0m0.144s +sys 0m0.121s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out wordcount +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.018s +sys 0m0.017s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestWordCount === RUN TestWordCount/count_one_word === RUN TestWordCount/count_one_of_each_word @@ -46,33 +619,114 @@ go test -v -covermode=count -coverprofile coverage.out wordcount --- PASS: ExampleWordCount (0.00s) PASS coverage: 84.4% of statements -ok wordcount 0.008s coverage: 84.4% of statements +ok wordcount 0.004s coverage: 84.4% of statements -real 0m0.622s -user 0m0.701s -sys 0m0.424s +real 0m0.177s +user 0m0.250s +sys 0m0.146s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + wordcount/word_count.go:13: WordCount 84.4% total: (statements) 84.4% -real 0m0.196s -user 0m0.176s -sys 0m0.206s +real 0m0.042s +user 0m0.056s +sys 0m0.057s + + + ============================================================================== + +Running: go tool cover -html coverage.out -o coverage.html + + +real 0m0.045s +user 0m0.051s +sys 0m0.058s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + +13 func WordCount(phrase string) Frequency { +14 +15 // remove punctuation - except for ' +16 reStr := `["_;:.,!@$%^&]` +17 re, e := regexp.Compile(reStr) +18 if e != nil { +19 MISS panic(e) +20 } +21 phrase = re.ReplaceAllString(phrase, " ") +22 +23 // change [a-z]['][a-z] to _ +24 reStr = `([a-z])[']([a-z])` +25 re, e = regexp.Compile(reStr) +26 if e != nil { +27 MISS panic(e) +28 } +29 phrase = re.ReplaceAllString(phrase, `${1}_${2}`) +30 +31 // remove extra ' +32 reStr = `[']` +33 re, e = regexp.Compile(reStr) +34 if e != nil { +35 MISS panic(e) +36 } +37 phrase = re.ReplaceAllString(phrase, " ") +38 +39 // change _ to ' +40 reStr = `_` +41 re, e = regexp.Compile(reStr) +42 if e != nil { +43 MISS panic(e) +44 } +45 phrase = re.ReplaceAllString(phrase, "'") +46 +47 // lowercase, trim space +48 phrase = strings.ToLower(phrase) +49 phrase = strings.TrimSpace(phrase) +50 +51 // convert all whitespace to single space +52 reStr = `[[:space:]]+` +53 re, e = regexp.Compile(reStr) +54 if e != nil { +55 MISS panic(e) +56 } +57 phrase = re.ReplaceAllString(phrase, " ") +58 +59 // split on whitespace +60 words := strings.Split(phrase, " ") +61 +62 // walk slice and fill frequency map +63 freqMap := Frequency{} +64 for _, word := range words { +65 freqMap[word]++ +66 } +67 +68 // return frequency map +69 return freqMap +70 } + + +real 0m0.020s +user 0m0.017s +sys 0m0.016s -=============================================================================== +real 0m0.020s +user 0m0.017s +sys 0m0.016s -go tool cover -html coverage.out -o coverage.html -real 0m0.210s -user 0m0.172s -sys 0m0.205s + ============================================================================== -=============================================================================== +Running: gotest -v -race -covermode=atomic ./... -go test -v -race -covermode=atomic wordcount === RUN TestWordCount === RUN TestWordCount/count_one_word === RUN TestWordCount/count_one_of_each_word @@ -87,7 +741,7 @@ go test -v -race -covermode=atomic wordcount === RUN TestWordCount/substrings_from_the_beginning === RUN TestWordCount/multiple_spaces_not_detected_as_a_word === RUN TestWordCount/alternating_word_separators_not_detected_as_a_word ---- PASS: TestWordCount (0.03s) +--- PASS: TestWordCount (0.00s) --- PASS: TestWordCount/count_one_word (0.00s) --- PASS: TestWordCount/count_one_of_each_word (0.00s) --- PASS: TestWordCount/multiple_occurrences_of_a_word (0.00s) @@ -105,97 +759,134 @@ go test -v -race -covermode=atomic wordcount --- PASS: ExampleWordCount (0.00s) PASS coverage: 84.4% of statements -ok wordcount 0.063s coverage: 84.4% of statements +ok wordcount 1.019s coverage: 84.4% of statements + +real 0m1.237s +user 0m0.282s +sys 0m0.185s + -real 0m0.755s -user 0m0.779s -sys 0m0.456s + ============================================================================== + +Exit code: 0 + +real 0m1.554s +user 0m0.680s +sys 0m0.489s + +real 0m1.556s +user 0m0.681s +sys 0m0.490s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: wordcount -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkWordCount-4 3898 310332 ns/op 86139 B/op 1150 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkWordCount +BenchmarkWordCount-8 10431 116806 ns/op 87077 B/op 1150 allocs/op PASS -ok wordcount 1.265s +ok wordcount 2.088s -real 0m1.686s -user 0m2.156s -sys 0m0.407s +real 0m2.248s +user 0m2.369s +sys 0m0.232s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestWordCount +=== RUN TestWordCount/count_one_word +=== RUN TestWordCount/count_one_of_each_word +=== RUN TestWordCount/multiple_occurrences_of_a_word +=== RUN TestWordCount/handles_cramped_lists +=== RUN TestWordCount/handles_expanded_lists +=== RUN TestWordCount/ignore_punctuation +=== RUN TestWordCount/include_numbers +=== RUN TestWordCount/normalize_case +=== RUN TestWordCount/with_apostrophes +=== RUN TestWordCount/with_quotations +=== RUN TestWordCount/substrings_from_the_beginning +=== RUN TestWordCount/multiple_spaces_not_detected_as_a_word +=== RUN TestWordCount/alternating_word_separators_not_detected_as_a_word +--- PASS: TestWordCount (0.00s) + --- PASS: TestWordCount/count_one_word (0.00s) + --- PASS: TestWordCount/count_one_of_each_word (0.00s) + --- PASS: TestWordCount/multiple_occurrences_of_a_word (0.00s) + --- PASS: TestWordCount/handles_cramped_lists (0.00s) + --- PASS: TestWordCount/handles_expanded_lists (0.00s) + --- PASS: TestWordCount/ignore_punctuation (0.00s) + --- PASS: TestWordCount/include_numbers (0.00s) + --- PASS: TestWordCount/normalize_case (0.00s) + --- PASS: TestWordCount/with_apostrophes (0.00s) + --- PASS: TestWordCount/with_quotations (0.00s) + --- PASS: TestWordCount/substrings_from_the_beginning (0.00s) + --- PASS: TestWordCount/multiple_spaces_not_detected_as_a_word (0.00s) + --- PASS: TestWordCount/alternating_word_separators_not_detected_as_a_word (0.00s) +=== RUN ExampleWordCount +--- PASS: ExampleWordCount (0.00s) PASS -ok wordcount 0.009s +ok wordcount 0.002s -real 0m0.480s -user 0m0.622s -sys 0m0.343s +real 0m0.132s +user 0m0.169s +sys 0m0.125s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m0.786s -user 0m0.703s -sys 0m0.340s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -WordCount-4 491µs ± 0% 310µs ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -WordCount-4 78.8kB ± 0% 86.1kB ± 0% ~ (p=1.000 n=1+1) - -name old allocs/op new allocs/op delta -WordCount-4 1.05k ± 0% 1.15k ± 0% ~ (p=1.000 n=1+1) - -real 0m0.023s -user 0m0.008s -sys 0m0.015s - -=============================================================================== - -go vet wordcount - -real 0m0.301s -user 0m0.376s -sys 0m0.281s - -=============================================================================== - -go fix wordcount +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: wordcount +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +WordCount-8 116.8µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ B/op │ +WordCount-8 85.04Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 + + │ benchstat-new.txt │ + │ allocs/op │ +WordCount-8 1.150k ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.151s -user 0m0.129s -sys 0m0.160s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +WordCount-4 310.3µ ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +WordCount-4 84.12Ki ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./word-count -[gosec] 2022/07/24 00:40:44 Including rules: default -[gosec] 2022/07/24 00:40:44 Excluding rules: default -[gosec] 2022/07/24 00:40:44 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/word-count -2022/07/24 00:40:45 internal error: package "regexp" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +WordCount-4 1.150k ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.480s -user 0m0.517s -sys 0m0.397s +real 0m0.002s +user 0m0.001s +sys 0m0.002s =============================================================================== gomarkdoc --output wordcount-doc.md -real 0m0.029s -user 0m0.022s -sys 0m0.016s +real 0m0.010s +user 0m0.006s +sys 0m0.005s =============================================================================== @@ -213,9 +904,9 @@ func WordCount(phrase string) Frequency WordCount returns a frequency map for the words counts in the string. -real 0m0.201s -user 0m0.142s -sys 0m0.200s +real 0m0.049s +user 0m0.030s +sys 0m0.039s =============================================================================== diff --git a/go/word-count/wordcount-doc.md b/go/word-count/wordcount-doc.md index add6c681..d8e8df14 100755 --- a/go/word-count/wordcount-doc.md +++ b/go/word-count/wordcount-doc.md @@ -6,7 +6,7 @@ import "wordcount" ``` -Package wordcount is used to count word frequencies\. +Package wordcount is used to count word frequencies. ## Index @@ -16,7 +16,7 @@ Package wordcount is used to count word frequencies\. ## type [Frequency]() -Frequency is a map used to count word frequencies\. +Frequency is a map used to count word frequencies. ```go type Frequency map[string]int @@ -28,7 +28,7 @@ type Frequency map[string]int func WordCount(phrase string) Frequency ``` -WordCount returns a frequency map for the words counts in the string\. +WordCount returns a frequency map for the words counts in the string.

Example

diff --git a/go/wordy/benchstat-new.txt b/go/wordy/benchstat-new.txt index e7a23a0a..1b5f4e78 100644 --- a/go/wordy/benchstat-new.txt +++ b/go/wordy/benchstat-new.txt @@ -1,7 +1,8 @@ goos: linux goarch: amd64 pkg: wordy -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkAnswer-4 237 6107230 ns/op 1698478 B/op 19532 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkAnswer +BenchmarkAnswer-8 924 1473809 ns/op 1701312 B/op 19545 allocs/op PASS -ok wordy 2.001s +ok wordy 1.501s diff --git a/go/wordy/benchstat-old.txt b/go/wordy/benchstat-old.txt index 87ab02bb..e7a23a0a 100644 --- a/go/wordy/benchstat-old.txt +++ b/go/wordy/benchstat-old.txt @@ -2,6 +2,6 @@ goos: linux goarch: amd64 pkg: wordy cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkAnswer-4 266 5660630 ns/op 1792281 B/op 20564 allocs/op +BenchmarkAnswer-4 237 6107230 ns/op 1698478 B/op 19532 allocs/op PASS -ok wordy 1.982s +ok wordy 2.001s diff --git a/go/wordy/coverage-annotations.txt b/go/wordy/coverage-annotations.txt new file mode 100644 index 00000000..0991292f --- /dev/null +++ b/go/wordy/coverage-annotations.txt @@ -0,0 +1,96 @@ + + 12 func Answer(question string) (int, bool) { + 13 var result int + 14 var reStr string + 15 var e error + 16 + 17 var reStrings []string = []string{ + 18 `^What is (-?[0-9]+)[?]`, + 19 `^What is (-?[0-9]+) ?(plus|minus|multiplied by|divided by) ?(-?[0-9]+)[?]$`, + 20 `^What is (-?[0-9]+) ?(plus|minus|multiplied by|divided by) ?(-?[0-9]+) ?(plus|minus|multiplied by|divided by) ?(-?[0-9]+)[?]$`, + 21 `^What is (-?[0-9]+) ?(raised to the) ?(-?[0-9]+)[a-z][a-z] power[?]$`, + 22 } + 23 + 24 for _, reStr = range reStrings { + 25 + 26 match, me := regexp.MatchString(reStr, question) + 27 + 28 if me != nil { + 29 MISS panic(me) + 30 } + 31 + 32 if match { + 33 break + 34 } + 35 } + 36 + 37 re, e := regexp.Compile(reStr) + 38 if e != nil { + 39 MISS panic(e) + 40 } + 41 + 42 s1 := re.ReplaceAllString(question, "$1") + 43 n1, e1 := strconv.Atoi(s1) + 44 if e1 != nil { + 45 return 0, false + 46 } + 47 + 48 s3 := re.ReplaceAllString(question, "$3") + 49 var n3 int + 50 var e3 error + 51 if s3 != "" { + 52 n3, e3 = strconv.Atoi(s3) + 53 if e3 != nil { + 54 MISS return 0, false + 55 } + 56 } + 57 + 58 s2 := re.ReplaceAllString(question, "$2") + 59 switch s2 { + 60 case "": + 61 result = n1 + 62 case "plus": + 63 result = n1 + n3 + 64 case "minus": + 65 result = n1 - n3 + 66 case "multiplied by": + 67 result = n1 * n3 + 68 case "divided by": + 69 result = n1 / n3 + 70 case "raised to the": + 71 result = int(math.Pow(float64(n1), float64(n3))) + 72 default: + 73 MISS return 0, false + 74 } + 75 + 76 s5 := re.ReplaceAllString(question, "$5") + 77 var n5 int + 78 var e5 error + 79 if s5 != "" { + 80 n5, e5 = strconv.Atoi(s5) + 81 if e5 != nil { + 82 MISS return 0, false + 83 } + 84 } + 85 + 86 s4 := re.ReplaceAllString(question, "$4") + 87 switch s4 { + 88 case "": + 89 return result, true + 90 case "plus": + 91 result += n5 + 92 case "minus": + 93 result -= n5 + 94 case "multiplied by": + 95 result *= n5 + 96 case "divided by": + 97 result /= n5 + 98 case "raised to the": + 99 MISS result = int(math.Pow(float64(result), float64(n5))) +100 default: +101 MISS return result, true +102 } +103 +104 return result, true +105 } + diff --git a/go/wordy/coverage.out b/go/wordy/coverage.out index 40bb97fc..77db8102 100644 --- a/go/wordy/coverage.out +++ b/go/wordy/coverage.out @@ -1,20 +1,17 @@ mode: count wordy/wordy.go:12.42,24.33 5 29 -wordy/wordy.go:37.2,38.14 2 29 -wordy/wordy.go:42.2,44.15 3 29 -wordy/wordy.go:48.2,51.14 4 21 -wordy/wordy.go:58.2,59.12 2 21 -wordy/wordy.go:76.2,79.14 4 21 -wordy/wordy.go:86.2,87.12 2 21 -wordy/wordy.go:104.2,104.21 1 7 wordy/wordy.go:24.33,28.16 2 81 -wordy/wordy.go:32.3,32.12 1 81 wordy/wordy.go:28.16,29.13 1 0 +wordy/wordy.go:32.3,32.12 1 81 wordy/wordy.go:32.12,33.9 1 21 +wordy/wordy.go:37.2,38.14 2 29 wordy/wordy.go:38.14,39.11 1 0 +wordy/wordy.go:42.2,44.15 3 29 wordy/wordy.go:44.15,46.3 1 8 +wordy/wordy.go:48.2,51.14 4 21 wordy/wordy.go:51.14,53.16 2 19 wordy/wordy.go:53.16,55.4 1 0 +wordy/wordy.go:58.2,59.12 2 21 wordy/wordy.go:60.10,61.14 1 2 wordy/wordy.go:62.14,63.19 1 8 wordy/wordy.go:64.15,65.19 1 4 @@ -22,8 +19,10 @@ wordy/wordy.go:66.23,67.19 1 3 wordy/wordy.go:68.20,69.19 1 3 wordy/wordy.go:70.23,71.51 1 1 wordy/wordy.go:72.10,73.18 1 0 +wordy/wordy.go:76.2,79.14 4 21 wordy/wordy.go:79.14,81.16 2 7 wordy/wordy.go:81.16,83.4 1 0 +wordy/wordy.go:86.2,87.12 2 21 wordy/wordy.go:88.10,89.22 1 14 wordy/wordy.go:90.14,91.15 1 2 wordy/wordy.go:92.15,93.15 1 2 @@ -31,3 +30,4 @@ wordy/wordy.go:94.23,95.15 1 2 wordy/wordy.go:96.20,97.15 1 1 wordy/wordy.go:98.23,99.55 1 0 wordy/wordy.go:100.10,101.22 1 0 +wordy/wordy.go:104.2,104.21 1 7 diff --git a/go/wordy/run-tests-go.txt b/go/wordy/run-tests-go.txt index 0823b87a..25dd9992 100644 --- a/go/wordy/run-tests-go.txt +++ b/go/wordy/run-tests-go.txt @@ -5,15 +5,605 @@ Go packages: wordy =============================================================================== -golint wordy +Running: ../../.github/citools/go/go-lint-golangci-lint -real 0m0.145s -user 0m0.131s -sys 0m0.149s +Running GoLangCi-Lint + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.018s +user 0m0.016s +sys 0m0.013s + + + ============================================================================== + +Running: golangci-lint run --enable-all ./... + +level=warning msg="[runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive." +level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner. " +level=warning msg="[runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct." +level=warning msg="[runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming)." +level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused." +level=warning msg="[runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'." +level=warning msg="[runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. " +level=warning msg="[runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref." +wordy.go:12: Function 'Answer' has too many statements (64 > 40) (funlen) +func Answer(question string) (int, bool) { +wordy.go:20: line is 130 characters (lll) + `^What is (-?[0-9]+) ?(plus|minus|multiplied by|divided by) ?(-?[0-9]+) ?(plus|minus|multiplied by|divided by) ?(-?[0-9]+)[?]$`, +wordy.go:17:16: var-declaration: should omit type []string from declaration of var reStrings; it will be inferred from the right-hand side (revive) + var reStrings []string = []string{ + ^ +wordy_test.go:8:25: Using the variable on range scope `tc` in function literal (scopelint) + actual, ok := Answer(tc.question) + ^ +wordy_test.go:10:9: Using the variable on range scope `tc` in function literal (scopelint) + case tc.expectError: + ^ +wordy_test.go:12:53: Using the variable on range scope `tc` in function literal (scopelint) + t.Fatalf("Answer(%q) expected error, got: %d", tc.question, actual) + ^ +wordy.go:24: unnecessary leading newline (whitespace) + for _, reStr = range reStrings { + +wordy.go:14:2: declarations should never be cuddled (wsl) + var reStr string + ^ +wordy.go:15:2: declarations should never be cuddled (wsl) + var e error + ^ +wordy.go:44:2: only one cuddle assignment allowed before if statement (wsl) + if e1 != nil { + ^ +wordy.go:49:2: declarations should never be cuddled (wsl) + var n3 int + ^ +wordy.go:51:2: only one cuddle assignment allowed before if statement (wsl) + if s3 != "" { + ^ +wordy.go:79:2: only one cuddle assignment allowed before if statement (wsl) + if s5 != "" { + ^ +wordy_test.go:28:2: for statements should only be cuddled with assignments used in the iteration (wsl) + for i := 0; i < b.N; i++ { + ^ +cases_test.go:130:16: Duplicate words (plus) found (dupword) + question: "What is 1 plus plus 2?", + ^ +cases_test.go:13:5: tests is a global variable (gochecknoglobals) +var tests = []wordyTest{ + ^ +wordy_test.go:5:1: Function TestAnswer missing the call to method parallel (paralleltest) +func TestAnswer(t *testing.T) { +^ +wordy_test.go:6:2: Range statement for test TestAnswer missing the call to method parallel in test Run (paralleltest) + for _, tc := range tests { + ^ +cases_test.go:1:9: package should be `wordy_test` instead of `wordy` (testpackage) +package wordy + ^ +wordy_examples_test.go:1:9: package should be `wordy_test` instead of `wordy` (testpackage) +package wordy + ^ +wordy_test.go:1:9: package should be `wordy_test` instead of `wordy` (testpackage) +package wordy + ^ +wordy.go:43:2: variable name 'n1' is too short for the scope of its usage (varnamelen) + n1, e1 := strconv.Atoi(s1) + ^ +wordy.go:37:2: variable name 're' is too short for the scope of its usage (varnamelen) + re, e := regexp.Compile(reStr) + ^ + +real 0m0.560s +user 0m0.803s +sys 0m0.571s + + + ============================================================================== + +Exit code: -1 + +real 0m0.588s +user 0m0.824s +sys 0m0.593s + +real 0m0.590s +user 0m0.825s +sys 0m0.595s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-revive + +Running Go Lint Revive + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.024s +user 0m0.011s +sys 0m0.026s + + + ============================================================================== + +Running: revive -formatter=stylish ./... + +wordy.go + (17, 16) https://revive.run/r#var-declaration should omit type []string from declaration of var reStrings; it will be inferred from the right-hand side + + + ✖ 1 problem (0 errors) (1 warnings) + +real 0m0.064s +user 0m0.033s +sys 0m0.050s + + + ============================================================================== + +Exit code: 0 + +real 0m0.106s +user 0m0.050s +sys 0m0.095s + +real 0m0.109s +user 0m0.051s +sys 0m0.096s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-ineffassign +../run-tests: line 41: .github/citools/go/go-lint-ineffassign: No such file or directory + +real 0m0.001s +user 0m0.000s +sys 0m0.001s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go-consistent + +Running Go go-consistent + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.033s +user 0m0.024s +sys 0m0.031s + + + ============================================================================== + +Running: go-consistent -v ./... + + info: check "./." +internal error: package "math" without types was imported from "wordy" + +real 0m0.096s +user 0m0.121s +sys 0m0.134s + + + ============================================================================== + +Exit code: -1 + +real 0m0.149s +user 0m0.156s +sys 0m0.183s + +real 0m0.152s +user 0m0.158s +sys 0m0.184s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-staticcheck + +Running Go StaticCheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.019s +user 0m0.010s +sys 0m0.020s + + + ============================================================================== + +Running: staticcheck -checks=all ./... + +wordy.go:17:16: should omit type []string from declaration; it will be inferred from the right-hand side (ST1023) + +real 0m0.186s +user 0m0.216s +sys 0m0.113s + + + ============================================================================== + +Exit code: -1 + +real 0m0.220s +user 0m0.233s +sys 0m0.145s + +real 0m0.222s +user 0m0.235s +sys 0m0.145s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocritic + +Running Go gocritic + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.019s +sys 0m0.019s + + + ============================================================================== + +Running: gocritic check -enableAll ./... + + +real 0m0.826s +user 0m1.872s +sys 0m0.275s + + + ============================================================================== + +Exit code: 0 + +real 0m0.862s +user 0m1.898s +sys 0m0.303s + +real 0m0.864s +user 0m1.898s +sys 0m0.305s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-go_vet + +Running Go Vet + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.015s +sys 0m0.018s + + + ============================================================================== + +Running: go vet ./... + + +real 0m0.076s +user 0m0.119s +sys 0m0.114s + + + ============================================================================== + +Exit code: 0 + +real 0m0.108s +user 0m0.140s +sys 0m0.141s + +real 0m0.110s +user 0m0.141s +sys 0m0.141s + +=============================================================================== + +Running: ../../.github/citools/go/go-fixer-go_fix + +Running go fix + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.023s +user 0m0.015s +sys 0m0.022s + + + ============================================================================== + +Running: go fix ./... + + +real 0m0.029s +user 0m0.022s +sys 0m0.018s + + + ============================================================================== + +Exit code: 0 + +real 0m0.065s +user 0m0.044s +sys 0m0.051s + +real 0m0.067s +user 0m0.046s +sys 0m0.051s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-errcheck + +Running Go errcheck + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.026s +sys 0m0.019s + + + ============================================================================== + +Running: errcheck ./... + + +real 0m0.511s +user 0m1.646s +sys 0m0.318s + + + ============================================================================== + +Exit code: 0 + +real 0m0.558s +user 0m1.681s +sys 0m0.352s + +real 0m0.560s +user 0m1.682s +sys 0m0.353s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gocyclo + +Running Go gocyclo + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.021s +user 0m0.017s +sys 0m0.017s + + + ============================================================================== + +Running: gocyclo . + +22 wordy Answer wordy.go:12:1 +6 wordy TestAnswer wordy_test.go:5:1 +4 wordy BenchmarkAnswer wordy_test.go:24:1 +1 wordy ExampleAnswer wordy_examples_test.go:7:1 + +real 0m0.002s +user 0m0.001s +sys 0m0.001s + + + ============================================================================== + +Exit code: 0 + +real 0m0.034s +user 0m0.026s +sys 0m0.024s + +real 0m0.036s +user 0m0.027s +sys 0m0.025s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-misspell + +Running Go misspell + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: misspell . + + +real 0m0.029s +user 0m0.031s +sys 0m0.017s + + + ============================================================================== + +Exit code: 0 + +real 0m0.043s +user 0m0.037s +sys 0m0.030s + +real 0m0.045s +user 0m0.038s +sys 0m0.031s + +=============================================================================== + +Running: ../../.github/citools/go/go-lint-gosec + +Running Go GoSec + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.020s +user 0m0.017s +sys 0m0.016s + + + ============================================================================== + +Running: gosec ./... + +[gosec] 2023/09/07 00:32:31 Including rules: default +[gosec] 2023/09/07 00:32:31 Excluding rules: default +[gosec] 2023/09/07 00:32:31 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/wordy +[gosec] 2023/09/07 00:32:31 Checking package: wordy +[gosec] 2023/09/07 00:32:31 Checking file: /home/vpayno/git_vpayno/exercism-workspace/go/wordy/wordy.go +Results: + + +Summary: + Gosec : dev + Files : 1 + Lines : 105 + Nosec : 0 + Issues : 0 + + +real 0m0.132s +user 0m0.118s +sys 0m0.112s + + + ============================================================================== + +Exit code: 0 + +real 0m0.162s +user 0m0.143s +sys 0m0.133s + +real 0m0.164s +user 0m0.144s +sys 0m0.135s =============================================================================== -go test -v -covermode=count -coverprofile coverage.out wordy +Running: ../../.github/citools/go/go-test-cover-report + +Running Go Test, Coverage & Reports + +Go version: + + go version go1.21.0 linux/amd64 + + + ============================================================================== + +Running: go clean ./... + + +real 0m0.028s +user 0m0.016s +sys 0m0.030s + + + ============================================================================== + +Running: gotest -v -covermode=count -coverprofile coverage.out ./... + === RUN TestAnswer === RUN TestAnswer/just_a_number === RUN TestAnswer/addition @@ -38,7 +628,7 @@ go test -v -covermode=count -coverprofile coverage.out wordy === RUN TestAnswer/reject_two_numbers_in_a_row === RUN TestAnswer/reject_postfix_notation === RUN TestAnswer/reject_prefix_notation ---- PASS: TestAnswer (0.01s) +--- PASS: TestAnswer (0.00s) --- PASS: TestAnswer/just_a_number (0.00s) --- PASS: TestAnswer/addition (0.00s) --- PASS: TestAnswer/more_addition (0.00s) @@ -66,33 +656,150 @@ go test -v -covermode=count -coverprofile coverage.out wordy --- PASS: ExampleAnswer (0.00s) PASS coverage: 86.0% of statements -ok wordy 0.027s coverage: 86.0% of statements +ok wordy 0.008s coverage: 86.0% of statements -real 0m0.599s -user 0m0.659s -sys 0m0.447s +real 0m0.196s +user 0m0.239s +sys 0m0.196s -=============================================================================== -go tool cover -func=coverage.out + ============================================================================== + +Running: go tool cover -func=coverage.out + wordy/wordy.go:12: Answer 86.0% total: (statements) 86.0% -real 0m0.225s -user 0m0.160s -sys 0m0.236s +real 0m0.049s +user 0m0.051s +sys 0m0.079s -=============================================================================== -go tool cover -html coverage.out -o coverage.html + ============================================================================== -real 0m0.182s -user 0m0.173s -sys 0m0.200s +Running: go tool cover -html coverage.out -o coverage.html -=============================================================================== -go test -v -race -covermode=atomic wordy +real 0m0.045s +user 0m0.061s +sys 0m0.067s + + + ============================================================================== + +Running: cover_annotate + +Running: gocov convert coverage.out | gocov annotate -ceiling=100 - | tee coverage-annotations.txt + + 12 func Answer(question string) (int, bool) { + 13 var result int + 14 var reStr string + 15 var e error + 16 + 17 var reStrings []string = []string{ + 18 `^What is (-?[0-9]+)[?]`, + 19 `^What is (-?[0-9]+) ?(plus|minus|multiplied by|divided by) ?(-?[0-9]+)[?]$`, + 20 `^What is (-?[0-9]+) ?(plus|minus|multiplied by|divided by) ?(-?[0-9]+) ?(plus|minus|multiplied by|divided by) ?(-?[0-9]+)[?]$`, + 21 `^What is (-?[0-9]+) ?(raised to the) ?(-?[0-9]+)[a-z][a-z] power[?]$`, + 22 } + 23 + 24 for _, reStr = range reStrings { + 25 + 26 match, me := regexp.MatchString(reStr, question) + 27 + 28 if me != nil { + 29 MISS panic(me) + 30 } + 31 + 32 if match { + 33 break + 34 } + 35 } + 36 + 37 re, e := regexp.Compile(reStr) + 38 if e != nil { + 39 MISS panic(e) + 40 } + 41 + 42 s1 := re.ReplaceAllString(question, "$1") + 43 n1, e1 := strconv.Atoi(s1) + 44 if e1 != nil { + 45 return 0, false + 46 } + 47 + 48 s3 := re.ReplaceAllString(question, "$3") + 49 var n3 int + 50 var e3 error + 51 if s3 != "" { + 52 n3, e3 = strconv.Atoi(s3) + 53 if e3 != nil { + 54 MISS return 0, false + 55 } + 56 } + 57 + 58 s2 := re.ReplaceAllString(question, "$2") + 59 switch s2 { + 60 case "": + 61 result = n1 + 62 case "plus": + 63 result = n1 + n3 + 64 case "minus": + 65 result = n1 - n3 + 66 case "multiplied by": + 67 result = n1 * n3 + 68 case "divided by": + 69 result = n1 / n3 + 70 case "raised to the": + 71 result = int(math.Pow(float64(n1), float64(n3))) + 72 default: + 73 MISS return 0, false + 74 } + 75 + 76 s5 := re.ReplaceAllString(question, "$5") + 77 var n5 int + 78 var e5 error + 79 if s5 != "" { + 80 n5, e5 = strconv.Atoi(s5) + 81 if e5 != nil { + 82 MISS return 0, false + 83 } + 84 } + 85 + 86 s4 := re.ReplaceAllString(question, "$4") + 87 switch s4 { + 88 case "": + 89 return result, true + 90 case "plus": + 91 result += n5 + 92 case "minus": + 93 result -= n5 + 94 case "multiplied by": + 95 result *= n5 + 96 case "divided by": + 97 result /= n5 + 98 case "raised to the": + 99 MISS result = int(math.Pow(float64(result), float64(n5))) +100 default: +101 MISS return result, true +102 } +103 +104 return result, true +105 } + + +real 0m0.019s +user 0m0.014s +sys 0m0.019s + +real 0m0.019s +user 0m0.014s +sys 0m0.019s + + + ============================================================================== + +Running: gotest -v -race -covermode=atomic ./... + === RUN TestAnswer === RUN TestAnswer/just_a_number === RUN TestAnswer/addition @@ -117,7 +824,7 @@ go test -v -race -covermode=atomic wordy === RUN TestAnswer/reject_two_numbers_in_a_row === RUN TestAnswer/reject_postfix_notation === RUN TestAnswer/reject_prefix_notation ---- PASS: TestAnswer (0.10s) +--- PASS: TestAnswer (0.02s) --- PASS: TestAnswer/just_a_number (0.00s) --- PASS: TestAnswer/addition (0.00s) --- PASS: TestAnswer/more_addition (0.00s) @@ -128,11 +835,11 @@ go test -v -race -covermode=atomic wordy --- PASS: TestAnswer/division (0.00s) --- PASS: TestAnswer/multiple_additions (0.00s) --- PASS: TestAnswer/addition_and_subtraction (0.00s) - --- PASS: TestAnswer/multiple_subtraction (0.01s) + --- PASS: TestAnswer/multiple_subtraction (0.00s) --- PASS: TestAnswer/subtraction_then_addition (0.00s) - --- PASS: TestAnswer/multiple_multiplication (0.02s) - --- PASS: TestAnswer/addition_and_multiplication (0.01s) - --- PASS: TestAnswer/multiple_division (0.01s) + --- PASS: TestAnswer/multiple_multiplication (0.00s) + --- PASS: TestAnswer/addition_and_multiplication (0.00s) + --- PASS: TestAnswer/multiple_division (0.00s) --- PASS: TestAnswer/unknown_operation (0.00s) --- PASS: TestAnswer/Non_math_question (0.00s) --- PASS: TestAnswer/reject_problem_missing_an_operand (0.00s) @@ -142,100 +849,157 @@ go test -v -race -covermode=atomic wordy --- PASS: TestAnswer/reject_postfix_notation (0.00s) --- PASS: TestAnswer/reject_prefix_notation (0.00s) === RUN ExampleAnswer ---- PASS: ExampleAnswer (0.01s) +--- PASS: ExampleAnswer (0.00s) PASS coverage: 86.0% of statements -ok wordy 0.130s coverage: 86.0% of statements +ok wordy 1.041s coverage: 86.0% of statements + +real 0m1.272s +user 0m0.303s +sys 0m0.179s + + + ============================================================================== + +Exit code: 0 -real 0m0.739s -user 0m0.831s -sys 0m0.444s +real 0m1.624s +user 0m0.691s +sys 0m0.581s + +real 0m1.626s +user 0m0.692s +sys 0m0.582s =============================================================================== mv -v benchstat-new.txt benchstat-old.txt renamed 'benchstat-new.txt' -> 'benchstat-old.txt' -go test --run=xxx --bench . --benchmem |& tee benchstat-new.txt +gotest -v --run=xxx --bench . --benchmem |& tee benchstat-new.txt goos: linux goarch: amd64 pkg: wordy -cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz -BenchmarkAnswer-4 237 6107230 ns/op 1698478 B/op 19532 allocs/op +cpu: 12th Gen Intel(R) Core(TM) i5-1240P +BenchmarkAnswer +BenchmarkAnswer-8 924 1473809 ns/op 1701312 B/op 19545 allocs/op PASS -ok wordy 2.001s +ok wordy 1.501s -real 0m2.875s -user 0m4.319s -sys 0m0.982s +real 0m1.666s +user 0m1.761s +sys 0m0.223s =============================================================================== -go test -tags bonus +gotest -v -tags bonus +=== RUN TestAnswer +=== RUN TestAnswer/just_a_number +=== RUN TestAnswer/addition +=== RUN TestAnswer/more_addition +=== RUN TestAnswer/addition_with_negative_numbers +=== RUN TestAnswer/large_addition +=== RUN TestAnswer/subtraction +=== RUN TestAnswer/multiplication +=== RUN TestAnswer/division +=== RUN TestAnswer/multiple_additions +=== RUN TestAnswer/addition_and_subtraction +=== RUN TestAnswer/multiple_subtraction +=== RUN TestAnswer/subtraction_then_addition +=== RUN TestAnswer/multiple_multiplication +=== RUN TestAnswer/addition_and_multiplication +=== RUN TestAnswer/multiple_division +=== RUN TestAnswer/unknown_operation +=== RUN TestAnswer/Non_math_question +=== RUN TestAnswer/reject_problem_missing_an_operand +=== RUN TestAnswer/reject_problem_with_no_operands_or_operators +=== RUN TestAnswer/reject_two_operations_in_a_row +=== RUN TestAnswer/reject_two_numbers_in_a_row +=== RUN TestAnswer/reject_postfix_notation +=== RUN TestAnswer/reject_prefix_notation +--- PASS: TestAnswer (0.00s) + --- PASS: TestAnswer/just_a_number (0.00s) + --- PASS: TestAnswer/addition (0.00s) + --- PASS: TestAnswer/more_addition (0.00s) + --- PASS: TestAnswer/addition_with_negative_numbers (0.00s) + --- PASS: TestAnswer/large_addition (0.00s) + --- PASS: TestAnswer/subtraction (0.00s) + --- PASS: TestAnswer/multiplication (0.00s) + --- PASS: TestAnswer/division (0.00s) + --- PASS: TestAnswer/multiple_additions (0.00s) + --- PASS: TestAnswer/addition_and_subtraction (0.00s) + --- PASS: TestAnswer/multiple_subtraction (0.00s) + --- PASS: TestAnswer/subtraction_then_addition (0.00s) + --- PASS: TestAnswer/multiple_multiplication (0.00s) + --- PASS: TestAnswer/addition_and_multiplication (0.00s) + --- PASS: TestAnswer/multiple_division (0.00s) + --- PASS: TestAnswer/unknown_operation (0.00s) + --- PASS: TestAnswer/Non_math_question (0.00s) + --- PASS: TestAnswer/reject_problem_missing_an_operand (0.00s) + --- PASS: TestAnswer/reject_problem_with_no_operands_or_operators (0.00s) + --- PASS: TestAnswer/reject_two_operations_in_a_row (0.00s) + --- PASS: TestAnswer/reject_two_numbers_in_a_row (0.00s) + --- PASS: TestAnswer/reject_postfix_notation (0.00s) + --- PASS: TestAnswer/reject_prefix_notation (0.00s) +=== RUN ExampleAnswer +--- PASS: ExampleAnswer (0.00s) PASS -ok wordy 0.015s +ok wordy 0.006s -real 0m0.654s -user 0m0.703s -sys 0m0.464s +real 0m0.147s +user 0m0.203s +sys 0m0.138s =============================================================================== -go install golang.org/x/perf/cmd/benchstat@latest - -real 0m0.863s -user 0m0.732s -sys 0m0.319s - benchstat benchstat-old.txt benchstat-new.txt -name old time/op new time/op delta -Answer-4 5.66ms ± 0% 6.11ms ± 0% ~ (p=1.000 n=1+1) - -name old alloc/op new alloc/op delta -Answer-4 1.79MB ± 0% 1.70MB ± 0% ~ (p=1.000 n=1+1) - -name old allocs/op new allocs/op delta -Answer-4 20.6k ± 0% 19.5k ± 0% ~ (p=1.000 n=1+1) - -real 0m0.019s -user 0m0.008s -sys 0m0.012s - -=============================================================================== - -go vet wordy - -real 0m0.282s -user 0m0.346s -sys 0m0.275s +benchstat-new.txt:5: missing iteration count +goos: linux +goarch: amd64 +pkg: wordy +cpu: 12th Gen Intel(R) Core(TM) i5-1240P + │ benchstat-new.txt │ + │ sec/op │ +Answer-8 1.474m ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-new.txt │ + │ B/op │ +Answer-8 1.622Mi ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -go fix wordy + │ benchstat-new.txt │ + │ allocs/op │ +Answer-8 19.55k ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.158s -user 0m0.117s -sys 0m0.147s +cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz + │ benchstat-old.txt │ + │ sec/op │ +Answer-4 6.107m ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -=============================================================================== + │ benchstat-old.txt │ + │ B/op │ +Answer-4 1.620Mi ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -gosec ./wordy -[gosec] 2022/07/24 00:25:13 Including rules: default -[gosec] 2022/07/24 00:25:13 Excluding rules: default -[gosec] 2022/07/24 00:25:13 Import directory: /home/vpayno/git_vpayno/exercism-workspace/go/wordy -2022/07/24 00:25:14 internal error: package "math" without types was imported from "command-line-arguments" + │ benchstat-old.txt │ + │ allocs/op │ +Answer-4 19.53k ± ∞ ¹ +¹ need >= 6 samples for confidence interval at level 0.95 -real 0m0.453s -user 0m0.502s -sys 0m0.342s +real 0m0.002s +user 0m0.000s +sys 0m0.002s =============================================================================== gomarkdoc --output wordy-doc.md -real 0m0.032s -user 0m0.022s -sys 0m0.012s +real 0m0.008s +user 0m0.005s +sys 0m0.004s =============================================================================== @@ -251,9 +1015,9 @@ func Answer(question string) (int, bool) problem. -real 0m0.208s -user 0m0.163s -sys 0m0.213s +real 0m0.039s +user 0m0.021s +sys 0m0.031s =============================================================================== diff --git a/go/wordy/wordy-doc.md b/go/wordy/wordy-doc.md index 6a8f2133..075d159e 100755 --- a/go/wordy/wordy-doc.md +++ b/go/wordy/wordy-doc.md @@ -6,7 +6,7 @@ import "wordy" ``` -Package wordy parses and evaluates simple math problems\. +Package wordy parses and evaluates simple math problems. ## Index @@ -19,7 +19,7 @@ Package wordy parses and evaluates simple math problems\. func Answer(question string) (int, bool) ``` -Answer returns a result and error after parsing and evaluating a simple math problem\. +Answer returns a result and error after parsing and evaluating a simple math problem.

Example

From a9e2804e0deea505b41d438a9755f1f0d7e3e483 Mon Sep 17 00:00:00 2001 From: Victor Payno Date: Fri, 8 Sep 2023 08:52:30 -0700 Subject: [PATCH 9/9] ci(docker-build): force sh or bash shell on each layer step --- Dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3f68edd7..dff16de0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,19 +6,19 @@ From debian:bullseye-slim As ci-generic-base COPY .github/docker /.github/docker -RUN .github/docker/layer-00.00-base-dependencies.sh ci-generic-debian +RUN sh .github/docker/layer-00.00-base-dependencies.sh ci-generic-debian -RUN .github/docker/layer-00.10-base-daggerio.sh ci-generic-debian +RUN bash .github/docker/layer-00.10-base-daggerio.sh ci-generic-debian -RUN .github/docker/layer-02.20-exercism-nodejs.sh ci-generic-debian +RUN bash .github/docker/layer-02.20-exercism-nodejs.sh ci-generic-debian -RUN .github/docker/layer-10.00-exercism-gcc_clang_llvm.sh ci-generic-debian +RUN bash .github/docker/layer-10.00-exercism-gcc_clang_llvm.sh ci-generic-debian -RUN .github/docker/layer-15.00-exercism-rust.sh ci-generic-debian +RUN bash .github/docker/layer-15.00-exercism-rust.sh ci-generic-debian -RUN .github/docker/layer-16.00-exercism-go.sh ci-generic-debian +RUN bash .github/docker/layer-16.00-exercism-go.sh ci-generic-debian -RUN .github/docker/layer-99.00-summary.sh ci-generic-debian +RUN bash .github/docker/layer-99.00-summary.sh ci-generic-debian # Copies your code file from your action repository to the filesystem path `/` of the container COPY .github/docker/entrypoint.sh /entrypoint.sh