Permalink
Browse files

Fix gometalinter issues

  • Loading branch information...
HaraldNordgren committed Oct 28, 2018
1 parent 0a2b42a commit af44c4de3b81d2b2d5d80cc6031c3fefde330e6f
Showing with 6 additions and 9 deletions.
  1. +2 −5 api/api.go
  2. +2 −2 api/errors/errors.go
  3. +2 −2 utils/merge.go
@@ -507,11 +507,7 @@ func (api *api) Team(ctx *Context) (*models.Team, error) {
} else {
log.Errorf("Error: %#v\n", err.Error())
return nil, fmt.Errorf("Team is disabled or does not exist")

}

return &team, nil

}

func (api *api) messagesHandler(ctx *Context) error {
@@ -1074,7 +1070,8 @@ func (api *api) Serve() {
}()

<-stop
ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()

h.Shutdown(ctx)

@@ -28,8 +28,8 @@ type PublicErrorer interface {
}

type apiError struct {
id string `json:"id"`
message string `json:"message"`
id string
message string
code int
}

@@ -81,8 +81,8 @@ func merge(dest reflect.Value, src reflect.Value) error {
case reflect.Chan:
case reflect.Ptr:
if !src.IsNil() && dest.CanSet() && src.Type() == dest.Type() {
fmt.Fprintln(os.Stderr, "%#v", src.Type(), src.Type().Name())
fmt.Fprintln(os.Stderr, "%#v", dest.Type(), dest.Type().Name())
fmt.Fprintf(os.Stderr, "%#v %s\n", src.Type(), src.Type().Name())
fmt.Fprintf(os.Stderr, "%#v %s\n", dest.Type(), dest.Type().Name())
x := reflect.New(dest.Type().Elem())
merge(x.Elem(), src.Elem())
dest.Set(x)

0 comments on commit af44c4d

Please sign in to comment.