`gofmt -s -w .`

上级 d0e40ff7
......@@ -552,7 +552,7 @@ func SensorsTemperatures() ([]TemperatureStat, error) {
return temperatures, err
}
temperature, err := strconv.ParseFloat(string(current), 64)
if err != nil{
if err != nil {
continue
}
temperatures = append(temperatures, TemperatureStat{
......
......@@ -256,17 +256,17 @@ var kindUNIX = netConnectionKindType{
}
var netConnectionKindMap = map[string][]netConnectionKindType{
"all": []netConnectionKindType{kindTCP4, kindTCP6, kindUDP4, kindUDP6, kindUNIX},
"tcp": []netConnectionKindType{kindTCP4, kindTCP6},
"tcp4": []netConnectionKindType{kindTCP4},
"tcp6": []netConnectionKindType{kindTCP6},
"udp": []netConnectionKindType{kindUDP4, kindUDP6},
"udp4": []netConnectionKindType{kindUDP4},
"udp6": []netConnectionKindType{kindUDP6},
"unix": []netConnectionKindType{kindUNIX},
"inet": []netConnectionKindType{kindTCP4, kindTCP6, kindUDP4, kindUDP6},
"inet4": []netConnectionKindType{kindTCP4, kindUDP4},
"inet6": []netConnectionKindType{kindTCP6, kindUDP6},
"all": {kindTCP4, kindTCP6, kindUDP4, kindUDP6, kindUNIX},
"tcp": {kindTCP4, kindTCP6},
"tcp4": {kindTCP4},
"tcp6": {kindTCP6},
"udp": {kindUDP4, kindUDP6},
"udp4": {kindUDP4},
"udp6": {kindUDP6},
"unix": {kindUNIX},
"inet": {kindTCP4, kindTCP6, kindUDP4, kindUDP6},
"inet4": {kindTCP4, kindUDP4},
"inet6": {kindTCP6, kindUDP6},
}
type inodeMap struct {
......@@ -680,7 +680,7 @@ func processUnix(file string, kind netConnectionKindType, inodes map[string][]in
pairs, exists := inodes[inode]
if !exists {
pairs = []inodeMap{
inodeMap{},
{},
}
}
for _, pair := range pairs {
......
......@@ -51,25 +51,25 @@ func TestDecodeAddress(t *testing.T) {
assert := assert.New(t)
addr := map[string]AddrTest{
"0500000A:0016": AddrTest{
"0500000A:0016": {
IP: "10.0.0.5",
Port: 22,
},
"0100007F:D1C2": AddrTest{
"0100007F:D1C2": {
IP: "127.0.0.1",
Port: 53698,
},
"11111:0035": AddrTest{
"11111:0035": {
Error: true,
},
"0100007F:BLAH": AddrTest{
"0100007F:BLAH": {
Error: true,
},
"0085002452100113070057A13F025401:0035": AddrTest{
"0085002452100113070057A13F025401:0035": {
IP: "2400:8500:1301:1052:a157:7:154:23f",
Port: 53,
},
"00855210011307F025401:0035": AddrTest{
"00855210011307F025401:0035": {
Error: true,
},
}
......
......@@ -97,12 +97,12 @@ func TestNetIOCountersPerNic(t *testing.T) {
func TestGetNetIOCountersAll(t *testing.T) {
n := []IOCountersStat{
IOCountersStat{
{
Name: "a",
BytesRecv: 10,
PacketsRecv: 10,
},
IOCountersStat{
{
Name: "b",
BytesRecv: 10,
PacketsRecv: 10,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册