ref: Collapse into a single conditional

このコミットが含まれているのは:
Aoi K 2023-02-06 12:56:51 -03:00
コミット f2a190fb41
1個のファイルの変更3行の追加11行の削除

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)
}