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 var startIdx uint = 1
for { for {
linen, _ := common.ReadLinesOffsetN(filename, startIdx, 1) linen, _ := common.ReadLinesOffsetN(filename, startIdx, 1)
if len(linen) == 0 {
break
}
line := linen[0] line := linen[0]
if !strings.HasPrefix(line, "cpu") { if !strings.HasPrefix(line, "cpu") {
break break

View file

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

View file

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

View file

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

View file

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

View file

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