chore: fix typos in comment

Signed-off-by: wanshuangcheng <wanshuangcheng@outlook.com>
This commit is contained in:
wanshuangcheng 2024-04-08 15:48:09 +08:00
commit 5993dd5d53
2 changed files with 5 additions and 5 deletions

View file

@ -48,13 +48,13 @@ func CaptureWithOptions(ifName string, options CaptureOptions) (*pcap.Handle, er
}
if err = ihandle.SetSnapLen(options.Snaplen); err != nil {
return nil, fmt.Errorf("error while settng snapshot length: %s", err)
return nil, fmt.Errorf("error while setting snapshot length: %s", err)
} else if err = ihandle.SetBufferSize(options.Bufsize); err != nil {
return nil, fmt.Errorf("error while settng buffer size: %s", err)
return nil, fmt.Errorf("error while setting buffer size: %s", err)
} else if err = ihandle.SetPromisc(options.Promisc); err != nil {
return nil, fmt.Errorf("error while settng promiscuous mode to %v: %s", options.Promisc, err)
return nil, fmt.Errorf("error while setting promiscuous mode to %v: %s", options.Promisc, err)
} else if err = ihandle.SetTimeout(options.Timeout); err != nil {
return nil, fmt.Errorf("error while settng snapshot length: %s", err)
return nil, fmt.Errorf("error while setting snapshot length: %s", err)
}
return ihandle.Activate()

View file

@ -28,7 +28,7 @@ func TestNewModuleHandler(t *testing.T) {
args: args{name: "test name", desc: "test description", expr: `[a-z]`},
want: ModuleHandler{Name: "test name", Description: "test description", Parser: regexp.MustCompile(`[a-z]`)},
},
// this test shoud handle panic on bad regexp ?
// this test should handle panic on bad regexp ?
// {
// name: "Test NewModuleHandler bad regex expr",
// args: args{name: "test name", desc: "test description", expr: "/abcd.(]"},