-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor codebase, also removing some features #14
Conversation
}, | ||
} | ||
|
||
type Encoder interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported type Encoder should have comment or be unexported
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(versionCmd) | ||
func (e *Encoder) Encode(set []onf.ONF) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method Encoder.Encode should have comment or be unexported
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Printf("Version: %s, Commit: %s, Built at: %s\n\n", Version, Commit, BuildTime) | ||
}, | ||
func NewEncoder(w io.Writer) *Encoder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function NewEncoder should have comment or be unexported
Commit = "N/A" | ||
BuildTime = "N/A" | ||
) | ||
type Encoder struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported type Encoder should have comment or be unexported
Pid int | ||
} | ||
|
||
func Run() ([]ActiveConnection, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function Run should have comment or be unexported
"gopkg.in/pipe.v2" | ||
) | ||
|
||
type ActiveConnection struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported type ActiveConnection should have comment or be unexported
DstAddr net.Addr // Destination address | ||
} | ||
|
||
func Run() ([]OpenFile, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function Run should have comment or be unexported
"gopkg.in/pipe.v2" | ||
) | ||
|
||
type OpenFile struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported type OpenFile should have comment or be unexported
return scanner.Err() | ||
} | ||
|
||
func ParseNetAddr(network, addr string) (net.Addr, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function ParseNetAddr should have comment or be unexported
"strings" | ||
) | ||
|
||
func ChunkLine(line string, sep string, min int) ([]string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function ChunkLine should have comment or be unexported
}, | ||
} | ||
|
||
type Encoder interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported type Encoder should have comment or be unexported
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(versionCmd) | ||
func (e *Encoder) Encode(set []onf.ONF) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method Encoder.Encode should have comment or be unexported
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Printf("Version: %s, Commit: %s, Built at: %s\n\n", Version, Commit, BuildTime) | ||
}, | ||
func NewEncoder(w io.Writer) *Encoder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function NewEncoder should have comment or be unexported
Commit = "N/A" | ||
BuildTime = "N/A" | ||
) | ||
type Encoder struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported type Encoder should have comment or be unexported
The dynamic build of the filtering regular expression based on user input was removed, as it is not so useful in practise. From now on the user is expected to provide the raw regex by himself.
This merge has an incompatible API compared with the previous version of the library.