Browse Source

fix linting (#4000)

release/v0.32.4
Marko 5 years ago
committed by Ethan Buchman
parent
commit
bf989eb272
4 changed files with 5 additions and 6 deletions
  1. +1
    -0
      .golangci.yml
  2. +2
    -4
      blockchain/v2/reactor.go
  3. +1
    -0
      blockchain/v2/routine.go
  4. +1
    -2
      blockchain/v2/routine_test.go

+ 1
- 0
.golangci.yml View File

@ -45,3 +45,4 @@ linters:
# disabled-checks:
# - wrapperFunc
# - commentFormatting # https://github.com/go-critic/go-critic/issues/755

+ 2
- 4
blockchain/v2/reactor.go View File

@ -13,16 +13,14 @@ type timeCheck struct {
}
func schedulerHandle(event Event) (Event, error) {
switch event.(type) {
case timeCheck:
if _, ok := event.(timeCheck); ok {
fmt.Println("scheduler handle timeCheck")
}
return noOp, nil
}
func processorHandle(event Event) (Event, error) {
switch event.(type) {
case timeCheck:
if _, ok := event.(timeCheck); ok {
fmt.Println("processor handle timeCheck")
}
return noOp, nil


+ 1
- 0
blockchain/v2/routine.go View File

@ -42,6 +42,7 @@ func newRoutine(name string, handleFunc handleFunc, bufferSize int) *Routine {
}
}
// nolint: unused
func (rt *Routine) setLogger(logger log.Logger) {
rt.logger = logger
}


+ 1
- 2
blockchain/v2/routine_test.go View File

@ -15,8 +15,7 @@ type eventA struct {
var done = fmt.Errorf("done")
func simpleHandler(event Event) (Event, error) {
switch event.(type) {
case eventA:
if _, ok := event.(eventA); ok {
return noOp, done
}
return noOp, nil


Loading…
Cancel
Save