Skip to content

Commit

Permalink
Merge pull request #389 from askuy/feature/optimizecontextcancel
Browse files Browse the repository at this point in the history
tcpstat
  • Loading branch information
askuy authored Jun 6, 2024
2 parents 24efa37 + f0fd979 commit df9fea8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/emetric/tcpstat.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func (st tcpConnectionState) String() string {
// 只解析IPV4
// 34190A0A:3D2D
func parseIpV4(s string) (string, error) {
if len(s) == 13 {
if len(s) != 13 {
return "", fmt.Errorf("not ipv4")
}
hexIP := s[:len(s)-5]
Expand Down
2 changes: 1 addition & 1 deletion core/emetric/tcpstat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ func Test_parsePort(t *testing.T) {
//assert.Equal(t, 6379, got)
got1, err1 := parseIpV4("95141EAC:18EB")
assert.Equal(t, nil, err1)
assert.Equal(t, 6379, string(got1))
assert.Equal(t, "172.30.20.149:6379", string(got1))
}

0 comments on commit df9fea8

Please sign in to comment.