mirror of
https://github.com/shirou/gopsutil.git
synced 2025-04-29 13:49:21 +08:00
format go program with go 1.5.2 "go fmt"
This commit is contained in:
parent
ef151b7ff7
commit
3a1fa5dc80
@ -6,7 +6,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/shirou/gopsutil/cpu"
|
"github.com/shirou/gopsutil/cpu"
|
||||||
"github.com/shirou/gopsutil/internal/common"
|
"github.com/shirou/gopsutil/internal/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetDockerIDList returnes a list of DockerID.
|
// GetDockerIDList returnes a list of DockerID.
|
||||||
|
@ -3,10 +3,11 @@
|
|||||||
package mem
|
package mem
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"errors"
|
|
||||||
"github.com/shirou/gopsutil/internal/common"
|
"github.com/shirou/gopsutil/internal/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -65,8 +65,8 @@ type NetInterfaceStat struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type NetFilterStat struct {
|
type NetFilterStat struct {
|
||||||
ConnTrackCount int64 `json:"conntrack_count"`
|
ConnTrackCount int64 `json:"conntrack_count"`
|
||||||
ConnTrackMax int64 `json:"conntrack_max"`
|
ConnTrackMax int64 `json:"conntrack_max"`
|
||||||
}
|
}
|
||||||
|
|
||||||
var constMap = map[string]int{
|
var constMap = map[string]int{
|
||||||
|
@ -165,8 +165,8 @@ func NetProtoCounters(protocols []string) ([]NetProtoCountersStat, error) {
|
|||||||
// the currently in use conntrack count and the max.
|
// the currently in use conntrack count and the max.
|
||||||
// If the file does not exist or is invalid it will return nil.
|
// If the file does not exist or is invalid it will return nil.
|
||||||
func NetFilterCounters() ([]NetFilterStat, error) {
|
func NetFilterCounters() ([]NetFilterStat, error) {
|
||||||
countfile := common.HostProc("sys/net/netfilter/nf_conntrack_count")
|
countfile := common.HostProc("sys/net/netfilter/nf_conntrack_count")
|
||||||
maxfile := common.HostProc("sys/net/netfilter/nf_conntrack_max")
|
maxfile := common.HostProc("sys/net/netfilter/nf_conntrack_max")
|
||||||
|
|
||||||
count, err := common.ReadInts(countfile)
|
count, err := common.ReadInts(countfile)
|
||||||
|
|
||||||
@ -174,7 +174,7 @@ func NetFilterCounters() ([]NetFilterStat, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
stats := make([]NetFilterStat, 0, 1)
|
stats := make([]NetFilterStat, 0, 1)
|
||||||
|
|
||||||
max, err := common.ReadInts(maxfile)
|
max, err := common.ReadInts(maxfile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -5,9 +5,9 @@ package process
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"unsafe"
|
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
|
||||||
cpu "github.com/shirou/gopsutil/cpu"
|
cpu "github.com/shirou/gopsutil/cpu"
|
||||||
"github.com/shirou/gopsutil/internal/common"
|
"github.com/shirou/gopsutil/internal/common"
|
||||||
|
@ -12,8 +12,8 @@ import (
|
|||||||
"github.com/StackExchange/wmi"
|
"github.com/StackExchange/wmi"
|
||||||
"github.com/shirou/w32"
|
"github.com/shirou/w32"
|
||||||
|
|
||||||
"github.com/shirou/gopsutil/internal/common"
|
|
||||||
cpu "github.com/shirou/gopsutil/cpu"
|
cpu "github.com/shirou/gopsutil/cpu"
|
||||||
|
"github.com/shirou/gopsutil/internal/common"
|
||||||
net "github.com/shirou/gopsutil/net"
|
net "github.com/shirou/gopsutil/net"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user