Skip to content

Commit

Permalink
fix lint warning (#242)
Browse files Browse the repository at this point in the history
* fix lint warning - exported func NewStreamVisitor returns unexported type *command.streamVisitor, which can be annoying to use

* add comment for StreamVisitor struct

* golang 1.17 : go:build style
  • Loading branch information
haoel committed Sep 7, 2021
1 parent 4749392 commit 7c7dc26
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/client/command/visitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ type spec struct {
doc string
}

type streamVisitor struct {
// StreamVisitor is the struct of Visitor Pattern
type StreamVisitor struct {
io.Reader
}

// NewStreamVisitor returns a streamVisitor.
func NewStreamVisitor(src string) *streamVisitor {
return &streamVisitor{
func NewStreamVisitor(src string) *StreamVisitor {
return &StreamVisitor{
Reader: strings.NewReader(src),
}
}
Expand Down Expand Up @@ -58,7 +59,7 @@ func (d *yamlDecoder) Decode(into interface{}) error {
}

// Visit implements Visitor over a stream.
func (v *streamVisitor) Visit(fn VisitorFunc) {
func (v *StreamVisitor) Visit(fn VisitorFunc) {
d := newYAMLDecoder(v.Reader)
var validSpecs []spec
for {
Expand Down
1 change: 1 addition & 0 deletions pkg/api/wasm.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build wasmhost
// +build wasmhost

/*
Expand Down
1 change: 1 addition & 0 deletions pkg/common/os_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
1 change: 1 addition & 0 deletions pkg/common/signal_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
1 change: 1 addition & 0 deletions pkg/common/signal_unix_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
1 change: 1 addition & 0 deletions pkg/common/signal_windows.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

/*
Expand Down
1 change: 1 addition & 0 deletions pkg/common/time_unix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows

/*
Expand Down
1 change: 1 addition & 0 deletions pkg/common/time_windows.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build windows
// +build windows

/*
Expand Down
1 change: 1 addition & 0 deletions pkg/filter/wasmhost/hostfunc.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build wasmhost
// +build wasmhost

/*
Expand Down
1 change: 1 addition & 0 deletions pkg/filter/wasmhost/vm.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build wasmhost
// +build wasmhost

/*
Expand Down
1 change: 1 addition & 0 deletions pkg/filter/wasmhost/wasmhost.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build wasmhost
// +build wasmhost

/*
Expand Down

0 comments on commit 7c7dc26

Please sign in to comment.