ref: Collapse into a single conditional
このコミットが含まれているのは:
コミット
f2a190fb41
14
main.go
14
main.go
|
@ -26,17 +26,9 @@ func main() {
|
|||
version := os.Getenv("CVS_VERSION")
|
||||
|
||||
// Cursed, but it's like, whatever
|
||||
if len(author) == 0 {
|
||||
log.Printf("$CVS_AUTHOR is not set. \n")
|
||||
os.Exit(1)
|
||||
} else if len(file) == 0 {
|
||||
log.Printf("$CVS_FILE is not set. \n")
|
||||
os.Exit(1)
|
||||
} else if len(identifier) == 0 {
|
||||
log.Printf("$CVS_ID is not set. \n")
|
||||
os.Exit(1)
|
||||
} else if len(version) == 0 {
|
||||
log.Printf("$CVS_VERSION is not set. \n")
|
||||
|
||||
if len(author) == 0 || len(file) == 0 || len(identifier) == 0 || len(version) == 0 {
|
||||
log.Fatal("None of CVS_* are set.")
|
||||
} else {
|
||||
fmt.Printf("$%s: %s,v %s %d/%d/%d %d:%d:%d %s Exp $\n", identifier, file, version, year, month, day, hour, minute, second, author)
|
||||
}
|
||||
|
|
読み込み中…
新しいイシューから参照