This commit is contained in:
WAKAYAMA shirou 2014-04-22 17:39:51 +09:00
parent ac570a47a1
commit 4bf256a08a
4 changed files with 12 additions and 16 deletions

View File

@ -10,7 +10,6 @@ import (
"bufio"
"os"
"strings"
)
// Read contents from file and split by new line.
@ -33,8 +32,7 @@ func ReadLines(filename string) ([]string, error) {
return ret, err
}
func byteToString(orig []byte) string{
func byteToString(orig []byte) string {
n := -1
for i, b := range orig {
if b == 0 {
@ -42,9 +40,9 @@ func byteToString(orig []byte) string{
}
n = i + 1
}
if n == -1{
if n == -1 {
return string(orig)
}else{
} else {
return string(orig[:n])
}

View File

@ -9,6 +9,5 @@ import (
func Cpu_times() ([]CPU_TimesStat, error) {
ret := make([]CPU_TimesStat, 0)
fmt.Println("FreeBSD")
return ret, nil
}

View File

@ -3,8 +3,8 @@
package gopsutil
import (
"encoding/binary"
"bytes"
"encoding/binary"
"io/ioutil"
"os"
"syscall"

View File

@ -24,14 +24,13 @@ func TestBoot_time(t *testing.T) {
}
}
func TestUsers(t *testing.T) {
v, err := Users()
if err != nil {
t.Errorf("error %v", err)
}
for _, u := range v {
if u.User == ""{
if u.User == "" {
t.Errorf("Could not Users %v", v)
}
}