1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-04 03:48:07 +02:00

initial commit

This commit is contained in:
Jesse Duffield 2018-05-13 13:23:45 +10:00
commit 4f2b1608b4

31
hello-world.go Normal file
View File

@ -0,0 +1,31 @@
// Go has various value types including strings,
// integers, floats, booleans, etc. Here are a few
// basic examples.
package main
import (
"fmt"
// "log"
"os/exec"
"os"
)
func main() {
var (
cmdOut []byte
err error
)
cmdName := "git"
cmdArgs := []string{"rev-parse", "--verify", "HEAD"}
if cmdOut, err = exec.Command(cmdName, cmdArgs...).Output(); err != nil {
fmt.Fprintln(os.Stderr, "There was an error running git rev-parse command: ", err)
fmt.Println(string(cmdOut))
os.Exit(1)
}
sha := string(cmdOut)
firstSix := sha[:6]
fmt.Println("The first six chars of the SHA at HEAD in this repo are", firstSix)
}