Use tabs as the canonical source indentation in git
Space conversion is done during generation only. Fixes #192
This commit is contained in:
committed by
Mark McGranaghan
parent
1699ad1c45
commit
7c160440be
@@ -16,33 +16,33 @@ import "os/exec"
|
||||
|
||||
func main() {
|
||||
|
||||
// For our example we'll exec `ls`. Go requires an
|
||||
// absolute path to the binary we want to execute, so
|
||||
// we'll use `exec.LookPath` to find it (probably
|
||||
// `/bin/ls`).
|
||||
binary, lookErr := exec.LookPath("ls")
|
||||
if lookErr != nil {
|
||||
panic(lookErr)
|
||||
}
|
||||
// For our example we'll exec `ls`. Go requires an
|
||||
// absolute path to the binary we want to execute, so
|
||||
// we'll use `exec.LookPath` to find it (probably
|
||||
// `/bin/ls`).
|
||||
binary, lookErr := exec.LookPath("ls")
|
||||
if lookErr != nil {
|
||||
panic(lookErr)
|
||||
}
|
||||
|
||||
// `Exec` requires arguments in slice form (as
|
||||
// apposed to one big string). We'll give `ls` a few
|
||||
// common arguments. Note that the first argument should
|
||||
// be the program name.
|
||||
args := []string{"ls", "-a", "-l", "-h"}
|
||||
// `Exec` requires arguments in slice form (as
|
||||
// apposed to one big string). We'll give `ls` a few
|
||||
// common arguments. Note that the first argument should
|
||||
// be the program name.
|
||||
args := []string{"ls", "-a", "-l", "-h"}
|
||||
|
||||
// `Exec` also needs a set of [environment variables](environment-variables)
|
||||
// to use. Here we just provide our current
|
||||
// environment.
|
||||
env := os.Environ()
|
||||
// `Exec` also needs a set of [environment variables](environment-variables)
|
||||
// to use. Here we just provide our current
|
||||
// environment.
|
||||
env := os.Environ()
|
||||
|
||||
// Here's the actual `syscall.Exec` call. If this call is
|
||||
// successful, the execution of our process will end
|
||||
// here and be replaced by the `/bin/ls -a -l -h`
|
||||
// process. If there is an error we'll get a return
|
||||
// value.
|
||||
execErr := syscall.Exec(binary, args, env)
|
||||
if execErr != nil {
|
||||
panic(execErr)
|
||||
}
|
||||
// Here's the actual `syscall.Exec` call. If this call is
|
||||
// successful, the execution of our process will end
|
||||
// here and be replaced by the `/bin/ls -a -l -h`
|
||||
// process. If there is an error we'll get a return
|
||||
// value.
|
||||
execErr := syscall.Exec(binary, args, env)
|
||||
if execErr != nil {
|
||||
panic(execErr)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
b527bbb76a42dd4bae541b73a7377b7e83e79905
|
||||
neqdJ51KLN
|
||||
bf11ADw-2Ho
|
||||
|
||||
Reference in New Issue
Block a user