Skip to content

Commit

Permalink
all: imp code, docs
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Mar 9, 2022
1 parent cf605dd commit c949e76
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions internal/aghnet/arpdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ func (ns *neighs) reset(with []Neighbor) {
// command. lenHint is a hint for the size of the allocated slice of Neighbors.
type parseFunc func(sc *bufio.Scanner, lenHint int) (ns []Neighbor)

// runcmdFunc is the function that runs some command and returns its output
// wrapped to be a io.Reader.
type runcmdFunc func() (r io.Reader, err error)

// cmdARPDB is the implementation of the ARPDB that uses command line to
Expand Down Expand Up @@ -188,6 +190,8 @@ type arpdbs struct {
last int
}

// newARPDBs returns a properly initialized *arpdbs. It begins refreshing from
// the first of arps.
func newARPDBs(arps ...ARPDB) (arp *arpdbs) {
return &arpdbs{
arps: arps,
Expand Down
1 change: 1 addition & 0 deletions internal/aghnet/net_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/stretchr/testify/require"
)

// testdata is the filesystem containing data for testing the package.
var testdata fs.FS = os.DirFS("./testdata")

func TestMain(m *testing.M) {
Expand Down
2 changes: 1 addition & 1 deletion internal/aghos/os.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func HaveAdminRights() (bool, error) {

// MaxCmdOutputSize is the maximum length of performed shell command output in
// bytes.
const MaxCmdOutputSize = 2 * 1024
const MaxCmdOutputSize = 64 * 1024

// RunCommand runs shell command.
func RunCommand(command string, arguments ...string) (code int, output string, err error) {
Expand Down

0 comments on commit c949e76

Please sign in to comment.