Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
Fixup style based on lint output
Browse files Browse the repository at this point in the history
  • Loading branch information
Arvind Iyengar authored and Arvind Iyengar committed Jun 3, 2021
1 parent daafb13 commit 50281f9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
3 changes: 0 additions & 3 deletions pkg/apis/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,10 @@ func sendAlert(req *restful.Request, resp *restful.Response) {
resp.WriteHeader(200)
log.Infof("send msg successful")
}

return
}

func reportLiveness(req *restful.Request, resp *restful.Response) {
resp.WriteHeader(200)
return
}

func reportState(req *restful.Request, resp *restful.Response) {
Expand Down
19 changes: 1 addition & 18 deletions pkg/options/option.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package options

import (
"errors"
"fmt"
"path/filepath"
"strings"
Expand All @@ -18,8 +17,6 @@ import (
"github.com/rancher/webhook-receiver/pkg/providers/msteams"
)

const logLevelErr = "set log level error, support Info,Error"

var (
mut sync.RWMutex
receivers map[string]providers.Receiver
Expand Down Expand Up @@ -145,24 +142,10 @@ func getProviderCreator(name string) (providers.Creator, error) {
case msteams.Name:
return msteams.New, nil
default:
return nil, errors.New(fmt.Sprintf("provider %s is not support", name))
return nil, fmt.Errorf("provider %s is not support", name)
}
}

type option struct {
Providers map[string]map[string]string
Receivers []providers.Receiver
}

func newOption(data []byte) (option, error) {
opt := option{}
if err := yaml.Unmarshal(data, &opt); err != nil {
return option{}, err
}

return opt, nil
}

func convertInterfaceToStruct(inter interface{}, s interface{}) error {
byteData, err := yaml.Marshal(inter)
if err != nil {
Expand Down

0 comments on commit 50281f9

Please sign in to comment.