Fast implementation of Git in pure Go codeberg.org/lindenii/furgit
git go
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

cmd/receivepack9418: Actually I do need return here because defer.

Runxi Yu 02efb65b 14630e66

+8 -4
+8 -4
cmd/receivepack9418/main.go
··· 8 8 ) 9 9 10 10 func main() { 11 + os.Exit(runMain()) 12 + } 13 + 14 + func runMain() int { 11 15 listenAddr := flag.String("listen", ":9418", "listen address") 12 16 repoPath := flag.String("repo", "", "path to git dir (.git or bare repo root)") 13 17 cpuProfilePath := flag.String("cpuprofile", "", "write CPU profile to file") ··· 18 22 if *repoPath == "" { 19 23 log.Print("must provide -repo <path-to-git-dir>") 20 24 21 - os.Exit(2) 25 + return 2 22 26 } 23 27 24 28 if *cpuProfilePath != "" { ··· 26 30 if err != nil { 27 31 log.Printf("cpuprofile: %v", err) 28 32 29 - os.Exit(1) 33 + return 1 30 34 } 31 35 32 36 defer func() { ··· 50 54 if err != nil { 51 55 log.Printf("run: %v", err) 52 56 53 - os.Exit(1) 57 + return 1 54 58 } 55 59 56 - os.Exit(0) 60 + return 0 57 61 }