turn int a terse one-liner: `package leap func isleapyear(year int) bool { return year%4 == 0 && (year%100 != 0 || year%400 == 0) }` in go

To turn the given function into a one-liner, you can remove unnecessary whitespaces and put everything on a single line. Here's the one-liner version:

main.go
package leap

func isLeapYear(year int) bool { return year%4 == 0 && (year%100 != 0 || year%400 == 0) }
104 chars
4 lines

This code achieves the same functionality as the original code but is written as a concise one-liner.

related categories

gistlibby LogSnag