Skip to content

Commit

Permalink
Merge pull request #19 from n3wscott/lint
Browse files Browse the repository at this point in the history
fix lint issues
  • Loading branch information
Scott Nichols authored Apr 2, 2021
2 parents ae61fa9 + 29c3edf commit 0f65088
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 12 deletions.
1 change: 0 additions & 1 deletion .github/workflows/go-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Checkout code
uses: actions/checkout@v2
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/go-format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: 1.16.x
id: go

- name: Checkout code
uses: actions/checkout@v2
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/go-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: 1.16.x
id: go

- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -28,9 +27,8 @@ jobs:
with:
files: .golangci.yaml

- name: Go Lint on ./v2
- name: Go Lint
if: steps.golangci_configuration.outputs.files_exists == 'true'
uses: golangci/golangci-lint-action@v2
with:
version: v1.29
working-directory: v2
1 change: 0 additions & 1 deletion .github/workflows/go-unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Checkout code
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ go 1.14

require (
github.com/spf13/cobra v0.0.5
gopkg.in/yaml.v2 v2.2.2
gopkg.in/yaml.v2 v2.4.0
)
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
2 changes: 1 addition & 1 deletion pkg/commands/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func addSend(topLevel *cobra.Command) {

// Process extensions.
if len(eo.Extensions) > 0 {
eo.Event.Attributes.Extensions = make(map[string]string, 0)
eo.Event.Attributes.Extensions = make(map[string]string)
for _, ext := range eo.Extensions {
kv := strings.SplitN(ext, "=", 2)
if len(kv) == 2 {
Expand Down
4 changes: 2 additions & 2 deletions pkg/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func RequestToEvent(req *http.Request) (*event.Event, error) {

// CloudEvents attribute extensions.
event.Attributes.Extensions = make(map[string]string)
for k, _ := range req.Header {
for k := range req.Header {
if strings.HasPrefix(strings.ToLower(k), "ce-") {
event.Attributes.Extensions[k[len("ce-"):]] = req.Header.Get(k)
req.Header.Del(k)
Expand All @@ -92,7 +92,7 @@ func RequestToEvent(req *http.Request) (*event.Event, error) {

// Transport extensions.
event.TransportExtensions = make(map[string]string)
for k, _ := range req.Header {
for k := range req.Header {
event.TransportExtensions[k] = req.Header.Get(k)
req.Header.Del(k)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/sender/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (s *Sender) Do() error {
if err != nil {
_, _ = fmt.Fprintf(os.Stderr, "Failed to dump request: %+v\n", err)
} else {
_, _ = fmt.Fprintf(os.Stderr, string(b))
_, _ = fmt.Fprint(os.Stderr, string(b))
}
}

Expand Down

0 comments on commit 0f65088

Please sign in to comment.