Chase an upstream go fmt that has been long overdue.

This commit is contained in:
Sean Chittenden 2017-02-03 22:31:11 -08:00
parent eab1cd3a2e
commit 4c6c18a709
No known key found for this signature in database
GPG key ID: 4EBC9DC16C2E5E16
15 changed files with 670 additions and 671 deletions

View file

@ -36,6 +36,9 @@ func Times(percpu bool) ([]TimesStat, error) {
var startIdx uint = 1
for {
linen, _ := common.ReadLinesOffsetN(filename, startIdx, 1)
if len(linen) == 0 {
break
}
line := linen[0]
if !strings.HasPrefix(line, "cpu") {
break

View file

@ -7,8 +7,8 @@ import (
"encoding/binary"
"errors"
"fmt"
"os/exec"
"github.com/shirou/gopsutil/internal/common"
"os/exec"
)
func GetPageSize() (uint64, error) {

View file

@ -4,7 +4,6 @@
Input to cgo -godefs.
*/
package mem
/*
@ -31,7 +30,5 @@ const (
sizeOfBcachestats = C.sizeof_struct_bcachestats
)
type Uvmexp C.struct_uvmexp
type Bcachestats C.struct_bcachestats

View file

@ -12,7 +12,7 @@ import (
)
func ParseNetstat(output string, mode string,
iocs map[string]IOCountersStat) (error) {
iocs map[string]IOCountersStat) error {
lines := strings.Split(output, "\n")
exists := make([]string, 0, len(lines)-1)

View file

@ -3,8 +3,8 @@
package process
import (
"bytes"
"C"
"bytes"
"encoding/binary"
"strings"
"syscall"
@ -12,8 +12,8 @@ import (
cpu "github.com/shirou/gopsutil/cpu"
"github.com/shirou/gopsutil/internal/common"
net "github.com/shirou/gopsutil/net"
mem "github.com/shirou/gopsutil/mem"
net "github.com/shirou/gopsutil/net"
)
// MemoryInfoExStat is different between OSes

View file

@ -51,7 +51,6 @@ const (
ArgMax = 256 * 1024 // sys/syslimits.h:#define ARG_MAX
)
const (
sizeofPtr = C.sizeofPtr
sizeofShort = C.sizeof_short