1
0
mirror of https://github.com/rancher/os.git synced 2025-09-05 08:42:38 +00:00

gofmt changes

This commit is contained in:
Darren Shepherd
2015-02-17 17:31:19 -07:00
parent c4fc978b47
commit 9f1a38f8c8
3 changed files with 10 additions and 8 deletions

View File

@@ -42,8 +42,8 @@ func main() {
registerCmd("/sbin/halt", power.Halt) registerCmd("/sbin/halt", power.Halt)
registerCmd("/usr/bin/respawn", respawn.Main) registerCmd("/usr/bin/respawn", respawn.Main)
registerCmd("/usr/sbin/rancherctl", control.Main) registerCmd("/usr/sbin/rancherctl", control.Main)
registerCmd("/sbin/tlsconf", util.TLSConf) registerCmd("/sbin/tlsconf", util.TLSConf)
if !reexec.Init() { if !reexec.Init() {
log.Fatalf("Failed to find an entry point for %s", os.Args[0]) log.Fatalf("Failed to find an entry point for %s", os.Args[0])
} }

View File

@@ -1,9 +1,13 @@
#!/bin/bash #!/bin/bash
set -e set -e
if [[ ! -x "$(which go)" && -x /usr/local/go/bin/go ]]; then
PATH=/usr/local/go/bin:${PATH}
fi
cd $(dirname $0)/.. cd $(dirname $0)/..
result=$(find . -name "*.go" | grep -v ./Godeps | xargs gofmt -s -l) result=$(find . -name "*.go" | grep -v ./Godeps | xargs gofmt -l)
for i in $result; do for i in $result; do
echo $i echo $i
done done

View File

@@ -18,7 +18,6 @@ var (
letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
) )
func TLSConf() { func TLSConf() {
name := "rancher" name := "rancher"
bits := 2048 bits := 2048
@@ -44,7 +43,7 @@ func TLSConf() {
fmt.Println("--outdir \t the output directory to save the generate certs or keys") fmt.Println("--outdir \t the output directory to save the generate certs or keys")
return return
} else if arg == "--outdir" { } else if arg == "--outdir" {
if len(vargs) > index + 1 { if len(vargs) > index+1 {
outDir = vargs[index+1] outDir = vargs[index+1]
} else { } else {
fmt.Println("please specify a output directory") fmt.Println("please specify a output directory")
@@ -52,13 +51,13 @@ func TLSConf() {
} else if arg == "-g" { } else if arg == "-g" {
generateCaCerts = false generateCaCerts = false
} else if arg == "--cakey" { } else if arg == "--cakey" {
if len(vargs) > index + 1 { if len(vargs) > index+1 {
inputCaKey = vargs[index+1] inputCaKey = vargs[index+1]
} else { } else {
fmt.Println("please specify a input ca-key file path") fmt.Println("please specify a input ca-key file path")
} }
} else if arg == "--ca" { } else if arg == "--ca" {
if len(vargs) > index + 1 { if len(vargs) > index+1 {
inputCaCert = vargs[index+1] inputCaCert = vargs[index+1]
} else { } else {
fmt.Println("please specify a input ca file path") fmt.Println("please specify a input ca file path")
@@ -109,7 +108,6 @@ func TLSConf() {
} }
func mountProc() error { func mountProc() error {
if _, err := os.Stat("/proc/self/mountinfo"); os.IsNotExist(err) { if _, err := os.Stat("/proc/self/mountinfo"); os.IsNotExist(err) {
if _, err := os.Stat("/proc"); os.IsNotExist(err) { if _, err := os.Stat("/proc"); os.IsNotExist(err) {