set LC_ALL to C in order to avoid number formatting problem.

This commit is contained in:
Shirou WAKAYAMA 2016-02-17 16:29:35 +09:00
parent 79f021f66e
commit 3166d41538
2 changed files with 4 additions and 0 deletions

View File

@ -3,6 +3,7 @@
package common
import (
"os"
"os/exec"
"strings"
"syscall"
@ -10,6 +11,7 @@ import (
)
func DoSysctrl(mib string) ([]string, error) {
os.Setenv("LC_ALL", "C")
out, err := exec.Command("/usr/sbin/sysctl", "-n", mib).Output()
if err != nil {
return []string{}, err

View File

@ -3,6 +3,7 @@
package common
import (
"os"
"os/exec"
"strings"
"syscall"
@ -10,6 +11,7 @@ import (
)
func DoSysctrl(mib string) ([]string, error) {
os.Setenv("LC_ALL", "C")
out, err := exec.Command("/sbin/sysctl", "-n", mib).Output()
if err != nil {
return []string{}, err