Preparing report...

Report for github.com/joaosoft/go-learn

A+    Excellent!    Found 183 issues across 385 files

Tweet

gofmt84%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


golint65%

Golint is a linter for Go source code.

    • go-learn/31_web/1_webserver/web_server_1.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 24: warning: don't use underscores in Go names; func handler_server1 should be handlerServer1 (golint)
    • Line 33: warning: don't use underscores in Go names; func handler_server2 should be handlerServer2 (golint)
    • go-learn/31_web/3_webserver/controllers/product.go
    • Line 9: warning: exported type XPTOController should have comment or be unexported (golint)
    • Line 12: warning: exported function InitXPTOResources should have comment or be unexported (golint)
    • Line 18: warning: exported method XPTOController.HandleXPTO should have comment or be unexported (golint)
    • go-learn/0_exercises/truphone/controllers/device.go
    • Line 12: warning: exported var ErrorUnexpected should have comment or be unexported (golint)
    • Line 16: warning: exported function Create should have comment or be unexported (golint)
    • Line 93: warning: exported function Update should have comment or be unexported (golint)
    • Line 161: warning: exported function Delete should have comment or be unexported (golint)
    • go-learn/45_cache/cache.go
    • Line 22: warning: comment on exported type Dog should be of the form "Dog ..." (with optional leading article) (golint)
    • Line 66: warning: exported function DecodeData should have comment or be unexported (golint)
    • Line 71: warning: exported function EncodeData should have comment or be unexported (golint)
    • go-learn/52_nsq/common/nsq/nsq_mock.go
    • Line 8: warning: exported type NSQConsumerMock should have comment or be unexported (golint)
    • Line 12: warning: exported method NSQConsumerMock.SetHandler should have comment or be unexported (golint)
    • Line 18: warning: comment on exported method NSQConsumerMock.HandleMessage should be of the form "HandleMessage ..." (golint)
    • Line 25: warning: comment on exported method NSQConsumerMock.Start should be of the form "Start ..." (golint)
    • Line 32: warning: exported method NSQConsumerMock.Stop should have comment or be unexported (golint)
    • go-learn/47_time/time.go
    • Line 84: warning: don't use underscores in Go names; var input_form should be inputForm (golint)
    • Line 85: warning: don't use underscores in Go names; var user_str should be userStr (golint)
    • Line 86: warning: don't use underscores in Go names; var user_date should be userDate (golint)
    • go-learn/27_heritage/heritage.go
    • Line 7: warning: exported type Veiculo should have comment or be unexported (golint)
    • Line 12: warning: exported type Carro should have comment or be unexported (golint)
    • Line 16: warning: exported type Moto should have comment or be unexported (golint)
    • Line 21: warning: exported type Veiculo1 should have comment or be unexported (golint)
    • Line 25: warning: exported method Carro.Preco should have comment or be unexported (golint)
    • Line 29: warning: exported method Moto.Preco should have comment or be unexported (golint)
    • Line 34: warning: receiver name carro should be consistent with previous receiver name a for Carro (golint)
    • go-learn/0_exercises/truphone/models/device.go
    • Line 13: warning: exported type DeviceList should have comment or be unexported (golint)
    • Line 14: warning: exported type Device should have comment or be unexported (golint)
    • Line 21: warning: exported type DeviceType should have comment or be unexported (golint)
    • Line 24: warning: exported const DeviceSmartphone should have comment (or a comment on this block) or be unexported (golint)
    • Line 29: warning: exported method Device.Create should have comment or be unexported (golint)
    • Line 35: warning: exported method Device.Update should have comment or be unexported (golint)
    • Line 45: warning: exported method Device.Delete should have comment or be unexported (golint)
    • go-learn/51_elastic_search/repositories/olivere/olivere_repository.go
    • Line 13: warning: exported type Repository should have comment or be unexported (golint)
    • Line 17: warning: exported function NewRepository should have comment or be unexported (golint)
    • Line 25: warning: exported method Repository.CreateIndex should have comment or be unexported (golint)
    • Line 52: warning: exported method Repository.DeleteIndex should have comment or be unexported (golint)
    • Line 70: warning: exported method Repository.Insert should have comment or be unexported (golint)
    • Line 120: warning: context.Context should be the first parameter of a function (golint)
    • go-learn/70_patterns/9_state_handle_pattern/example.go
    • Line 7: warning: exported type Context should have comment or be unexported (golint)
    • Line 11: warning: exported method Context.Request should have comment or be unexported (golint)
    • Line 15: warning: exported method Context.SetState should have comment or be unexported (golint)
    • Line 19: warning: exported type State should have comment or be unexported (golint)
    • Line 23: warning: exported type ConcreteStateA should have comment or be unexported (golint)
    • Line 25: warning: exported method ConcreteStateA.Handle should have comment or be unexported (golint)
    • Line 29: warning: exported type ConcreteStateB should have comment or be unexported (golint)
    • Line 31: warning: exported method ConcreteStateB.Handle should have comment or be unexported (golint)
    • go-learn/70_patterns/2_factory_pattern/example.go
    • Line 7: warning: exported type StorageType should have comment or be unexported (golint)
    • Line 8: warning: exported type Store should have comment or be unexported (golint)
    • Line 10: warning: exported method Store.Open should have comment or be unexported (golint)
    • Line 13: warning: exported const DiskStorage should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: exported function NewStore should have comment or be unexported (golint)
    • go-learn/20_errors/try-catch.go
    • Line 7: warning: exported type Block should have comment or be unexported (golint)
    • Line 13: warning: exported type Exception should have comment or be unexported (golint)
    • Line 15: warning: exported function Throw should have comment or be unexported (golint)
    • Line 19: warning: exported method Block.Do should have comment or be unexported (golint)
    • go-learn/52_nsq/controllers/controller.go
    • Line 10: warning: exported type Controller should have comment or be unexported (golint)
    • Line 15: warning: comment on exported method Controller.Start should be of the form "Start ..." (golint)
    • Line 22: warning: comment on exported method Controller.Stop should be of the form "Stop ..." (golint)
    • Line 27: warning: comment on exported method Controller.HandleMessage should be of the form "HandleMessage ..." (golint)
    • go-learn/51_elastic_search/repositories/original/oficial_repository.go
    • Line 12: warning: exported type Repository should have comment or be unexported (golint)
    • Line 16: warning: exported function NewRepository should have comment or be unexported (golint)
    • Line 24: warning: exported method Repository.CreateIndex should have comment or be unexported (golint)
    • Line 50: warning: exported method Repository.DeleteIndex should have comment or be unexported (golint)
    • Line 54: warning: exported method Repository.Insert should have comment or be unexported (golint)
    • go-learn/29_json/json_2.go
    • Line 10: warning: comment on exported type Person should be of the form "Person ..." (with optional leading article) (golint)
    • Line 32: warning: don't use underscores in Go names; var json_str should be jsonStr (golint)
    • go-learn/70_patterns/1_builder_pattern/example.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 6: warning: exported type Color should have comment or be unexported (golint)
    • Line 7: warning: exported type Make should have comment or be unexported (golint)
    • Line 8: warning: exported type Model should have comment or be unexported (golint)
    • Line 11: warning: exported const BLUE should have comment (or a comment on this block) or be unexported (golint)
    • Line 15: warning: exported type Car should have comment or be unexported (golint)
    • Line 20: warning: exported type CarBuilder should have comment or be unexported (golint)
    • Line 48: warning: exported function New should have comment or be unexported (golint)
    • go-learn/0_exercises/truphone/controllers/requests.go
    • Line 3: warning: exported type CreateDeviceRequest should have comment or be unexported (golint)
    • Line 8: warning: exported type UpdateDeviceRequest should have comment or be unexported (golint)
    • Line 14: warning: exported type DeleteDeviceRequest should have comment or be unexported (golint)
    • Line 19: warning: exported type DeviceType should have comment or be unexported (golint)
    • Line 22: warning: exported const DeviceSmartphone should have comment (or a comment on this block) or be unexported (golint)
    • go-learn/28_tests/6_mock/domain/repository.go
    • Line 3: warning: exported type Repository should have comment or be unexported (golint)
    • Line 5: warning: exported function NewRepository should have comment or be unexported (golint)
    • Line 9: warning: exported method Repository.Store should have comment or be unexported (golint)
    • go-learn/53_viper/main.go
    • Line 65: warning: don't use underscores in Go names; struct field Teste_1 should be Teste1 (golint)
    • Line 66: warning: don't use underscores in Go names; struct field Teste_2 should be Teste2 (golint)
    • Line 67: warning: don't use underscores in Go names; struct field Teste_2_1 should be Teste2_1 (golint)
    • Line 68: warning: don't use underscores in Go names; struct field Teste_2_2 should be Teste2_2 (golint)
    • Line 70: warning: don't use underscores in Go names; struct field Teste_3 should be Teste3 (golint)
    • Line 71: warning: don't use underscores in Go names; struct field Teste_3_1 should be Teste3_1 (golint)
    • Line 72: warning: don't use underscores in Go names; struct field Teste_3_1_1 should be Teste3_1_1 (golint)
    • Line 73: warning: don't use underscores in Go names; struct field Teste_3_1_2 should be Teste3_1_2 (golint)
    • go-learn/70_patterns/7_strategy_pattern/example_1/example.go
    • Line 1: warning: package comment should be of the form "Package example_1 ..." (golint)
    • Line 3: warning: don't use an underscore in package name (golint)
    • Line 5: warning: exported type Operator should have comment or be unexported (golint)
    • Line 9: warning: exported type Operation should have comment or be unexported (golint)
    • Line 13: warning: exported method Operation.Operate should have comment or be unexported (golint)
    • Line 17: warning: exported type Addition should have comment or be unexported (golint)
    • Line 19: warning: exported method Addition.Apply should have comment or be unexported (golint)
    • Line 23: warning: exported type Multiplication should have comment or be unexported (golint)
    • Line 25: warning: exported method Multiplication.Apply should have comment or be unexported (golint)
    • go-learn/70_patterns/8_publish_subscribe_pattern/example.go
    • Line 8: warning: exported type Message should have comment or be unexported (golint)
    • Line 12: warning: exported type Subscription should have comment or be unexported (golint)
    • Line 18: warning: exported method Subscription.Publish should have comment or be unexported (golint)
    • Line 28: warning: exported type Topic should have comment or be unexported (golint)
    • Line 33: warning: exported method Topic.Subscribe should have comment or be unexported (golint)
    • Line 42: warning: exported method Topic.Unsubscribe should have comment or be unexported (golint)
    • Line 47: warning: exported method Topic.Delete should have comment or be unexported (golint)
    • Line 52: warning: exported type User should have comment or be unexported (golint)
    • Line 57: warning: exported type Session should have comment or be unexported (golint)
    • go-learn/43_regex/regex.go
    • Line 23: warning: don't use underscores in Go names; func basic_regexes should be basicRegexes (golint)
    • Line 45: warning: don't use underscores in Go names; var result_two should be resultTwo (golint)
    • Line 49: warning: don't use underscores in Go names; var results_three should be resultsThree (golint)
    • Line 55: warning: don't use underscores in Go names; var results_four should be resultsFour (golint)
    • Line 59: warning: don't use underscores in Go names; func case_insensitive should be caseInsensitive (golint)
    • Line 76: warning: don't use underscores in Go names; func sub_matches should be subMatches (golint)
    • Line 81: warning: don't use underscores in Go names; var sub_re should be subRe (golint)
    • Line 98: warning: don't use underscores in Go names; var esc_pattern should be escPattern (golint)
    • Line 99: warning: don't use underscores in Go names; var esc_re should be escRe (golint)
    • go-learn/51_elastic_search/interactors/interactor.go
    • Line 21: warning: exported type Interactor should have comment or be unexported (golint)
    • Line 33: warning: comment on exported method Interactor.CreateIndex should be of the form "CreateIndex ..." (golint)
    • Line 38: warning: comment on exported method Interactor.Insert should be of the form "Insert ..." (golint)
    • go-learn/32_tree/tree.go
    • Line 18: warning: comment on exported type Tree should be of the form "Tree ..." (with optional leading article) (golint)
    • Line 27: warning: don't use underscores in Go names; var tree_head should be treeHead (golint)
    • Line 27: warning: don't use underscores in Go names; var tree_second should be treeSecond (golint)
    • Line 27: warning: don't use underscores in Go names; var tree_tail should be treeTail (golint)
    • go-learn/76_google-sitemap/main.go
    • Line 21: warning: exported type UrlSet should have comment or be unexported (golint)
    • Line 27: warning: exported type Url should have comment or be unexported (golint)
    • Line 33: warning: exported type Configuration should have comment or be unexported (golint)
    • go-learn/46_workers/common/workers/collector.go
    • Line 10: warning: comment on exported var WorkQueue should be of the form "WorkQueue ..." (golint)
    • Line 13: warning: exported function HttpCollector should have comment or be unexported (golint)
    • Line 44: warning: exported function SimpleCollector should have comment or be unexported (golint)
    • go-learn/75_linked_list/example.go
    • Line 8: warning: exported type Post should have comment or be unexported (golint)
    • Line 14: warning: exported type Feed should have comment or be unexported (golint)
    • Line 20: warning: exported method Feed.Append should have comment or be unexported (golint)
    • Line 32: warning: exported method Feed.Remove should have comment or be unexported (golint)
    • Line 53: warning: exported method Feed.Insert should have comment or be unexported (golint)
    • go-learn/59_null/null_struct_1.go
    • Line 10: warning: exported type Example should have comment or be unexported (golint)
    • Line 11: warning: don't use underscores in Go names; struct field My_string_ok should be MyStringOk (golint)
    • Line 12: warning: don't use underscores in Go names; struct field My_string_ko should be MyStringKo (golint)
    • Line 13: warning: don't use underscores in Go names; struct field My_string_null should be MyStringNull (golint)
    • Line 14: warning: don't use underscores in Go names; struct field My_int_ok should be MyIntOk (golint)
    • Line 15: warning: don't use underscores in Go names; struct field My_int_ko should be MyIntKo (golint)
    • Line 16: warning: don't use underscores in Go names; struct field My_int_null should be MyIntNull (golint)
    • Line 19: warning: exported type Example3 should have comment or be unexported (golint)
    • Line 20: warning: don't use underscores in Go names; struct field My_string_ok should be MyStringOk (golint)
    • Line 77: warning: don't use underscores in Go names; var My_string_ok should be MyStringOk (golint)
    • Line 78: warning: don't use underscores in Go names; var My_string_ok_bytes should be MyStringOkBytes (golint)
    • Line 84: warning: don't use underscores in Go names; var My_string_ok_2 should be MyStringOk2 (golint)
    • go-learn/48_queue/4_queue_worker/main.go
    • Line 11: warning: exported var NWorkers should have comment or be unexported (golint)
    • Line 15: warning: exported type WorkRequest should have comment or be unexported (golint)
    • Line 20: warning: comment on exported var WorkQueue should be of the form "WorkQueue ..." (golint)
    • Line 23: warning: exported function Collector should have comment or be unexported (golint)
    • Line 65: warning: exported var WorkerQueue should have comment or be unexported (golint)
    • Line 109: warning: exported type Worker should have comment or be unexported (golint)
    • Line 116: warning: comment on exported method Worker.Start should be of the form "Start ..." (golint)
    • go-learn/28_tests/9_elastic/example.go
    • Line 10: warning: exported type Service should have comment or be unexported (golint)
    • Line 14: warning: exported function NewService should have comment or be unexported (golint)
    • Line 26: warning: exported type Response should have comment or be unexported (golint)
    • go-learn/0_exercises/2/car/car.go
    • Line 10: warning: exported const BrandBMW should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: exported var ErrorInvalidVersion should have comment or be unexported (golint)
    • Line 20: warning: exported type Brand should have comment or be unexported (golint)
    • Line 22: warning: exported type Car should have comment or be unexported (golint)
    • Line 28: warning: exported type CarModel should have comment or be unexported (golint)
    • Line 34: warning: exported type Defect should have comment or be unexported (golint)
    • Line 40: warning: exported method Car.Validate should have comment or be unexported (golint)
    • Line 51: warning: exported method CarModel.StringForLog should have comment or be unexported (golint)
    • Line 59: warning: exported method CarModel.IncrementVersion should have comment or be unexported (golint)
    • Line 63: warning: exported function GetCarsDefects should have comment or be unexported (golint)
    • Line 96: warning: exported function CarDefectFactory should have comment or be unexported (golint)
    • Line 100: warning: exported type CarDefecter should have comment or be unexported (golint)
    • Line 104: warning: exported type CarModelDefectImp should have comment or be unexported (golint)
    • Line 106: warning: exported method CarModelDefectImp.GetCarModelsDefects should have comment or be unexported (golint)
    • go-learn/31_web/rest_fetch.go
    • Line 15: warning: comment on exported type Entry should be of the form "Entry ..." (with optional leading article) (golint)
    • Line 24: warning: comment on exported type Feed should be of the form "Feed ..." (with optional leading article) (golint)
    • go-learn/28_tests/7_sqlmock/domain/repository.go
    • Line 7: warning: exported type Repository should have comment or be unexported (golint)
    • Line 11: warning: exported function NewRepository should have comment or be unexported (golint)
    • Line 17: warning: exported method Repository.DoSomethingSelect should have comment or be unexported (golint)
    • Line 40: warning: exported method Repository.DoSomethingInsert should have comment or be unexported (golint)
    • Line 66: warning: exported method Repository.DoSomethingUpdate should have comment or be unexported (golint)
    • go-learn/48_queue/2_queue_struct/common/queue/queue.go
    • Line 14: warning: exported type Queue should have comment or be unexported (golint)
    • Line 23: warning: exported function NewQueue should have comment or be unexported (golint)
    • Line 41: warning: exported method Queue.AddWork should have comment or be unexported (golint)
    • Line 99: warning: don't use underscores in Go names; var has_error should be hasError (golint)
    • go-learn/70_patterns/6_observer_pattern/example_2/example.go
    • Line 8: warning: exported type Observer should have comment or be unexported (golint)
    • Line 12: warning: exported type Subject should have comment or be unexported (golint)
    • Line 16: warning: exported function NewSubject should have comment or be unexported (golint)
    • Line 20: warning: exported method Subject.RegisterObserver should have comment or be unexported (golint)
    • Line 24: warning: exported method Subject.UnregisterObserver should have comment or be unexported (golint)
    • Line 33: warning: exported method Subject.NotifyObservers should have comment or be unexported (golint)
    • Line 40: warning: exported type ConcreteObserver should have comment or be unexported (golint)
    • Line 42: warning: exported method ConcreteObserver.Notify should have comment or be unexported (golint)
    • go-learn/70_patterns/6_observer_pattern/example_1/example.go
    • Line 1: warning: package comment should be of the form "Package example_1 ..." (golint)
    • Line 3: warning: don't use an underscore in package name (golint)
    • Line 11: warning: comment on exported type Event should be of the form "Event ..." (with optional leading article) (golint)
    • Line 66: warning: receiver name p should be consistent with previous receiver name o for eventNotifier (golint)
    • go-learn/28_tests/6_mock/domain/interactor.go
    • Line 3: warning: exported type Interactor should have comment or be unexported (golint)
    • Line 7: warning: exported function NewInteractor should have comment or be unexported (golint)
    • Line 13: warning: exported method Interactor.DoSomething should have comment or be unexported (golint)
    • go-learn/48_queue/5_queue_worker/collector.go
    • Line 9: warning: exported type WorkRequest should have comment or be unexported (golint)
    • Line 14: warning: comment on exported var WorkQueue should be of the form "WorkQueue ..." (golint)
    • Line 17: warning: exported function Collector should have comment or be unexported (golint)
    • go-learn/39_objects/objects.go
    • Line 18: warning: comment on exported type Dog should be of the form "Dog ..." (with optional leading article) (golint)
    • Line 25: warning: comment on exported method Dog.Call should be of the form "Call ..." (golint)
    • go-learn/52_nsq/common/nsq/nsq.go
    • Line 8: warning: exported type NSQConsumer should have comment or be unexported (golint)
    • Line 15: warning: comment on exported function NewNSQConsumer should be of the form "NewNSQConsumer ..." (golint)
    • Line 39: warning: comment on exported method NSQConsumer.SetHandler should be of the form "SetHandler ..." (golint)
    • Line 47: warning: comment on exported method NSQConsumer.HandleMessage should be of the form "HandleMessage ..." (golint)
    • Line 59: warning: comment on exported method NSQConsumer.Start should be of the form "Start ..." (golint)
    • Line 94: warning: comment on exported method NSQConsumer.Stop should be of the form "Stop ..." (golint)
    • go-learn/17_methods/methods.go
    • Line 19: warning: comment on exported type Vertex should be of the form "Vertex ..." (with optional leading article) (golint)
    • Line 26: warning: exported method Vertex.Soma should have comment or be unexported (golint)
    • Line 30: warning: comment on exported type MyFloat should be of the form "MyFloat ..." (with optional leading article) (golint)
    • Line 33: warning: exported method MyFloat.MyAbs should have comment or be unexported (golint)
    • Line 40: warning: comment on exported method Vertex.Abs should be of the form "Abs ..." (golint)
    • Line 47: warning: exported method Vertex.Scale should have comment or be unexported (golint)
    • Line 52: warning: comment on exported function ScaleFunc should be of the form "ScaleFunc ..." (golint)
    • go-learn/18_interfaces/interfaces.go
    • Line 19: warning: comment on exported type Abser should be of the form "Abser ..." (with optional leading article) (golint)
    • Line 25: warning: exported type MyFloat1 should have comment or be unexported (golint)
    • Line 27: warning: exported method MyFloat1.Abs should have comment or be unexported (golint)
    • Line 34: warning: exported type Vertex1 should have comment or be unexported (golint)
    • Line 38: warning: exported method Vertex1.Abs should have comment or be unexported (golint)
    • Line 44: warning: exported type I should have comment or be unexported (golint)
    • Line 48: warning: exported type T should have comment or be unexported (golint)
    • Line 52: warning: comment on exported method T.M should be of the form "M ..." (golint)

gocyclo100%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!