Are you tired of writing if/else for every number to check if those numbers are even or odd? Luckily with this program you can easily generate go code to determine if a number is even or odd.
go build main.go
- You can specify
output
which is the location/name of the file being generated. - You can specify
n
which is the number of even/odd checks to be written. - You can specify
package
which is the name of the package of the file to be written. - You can specify
function
which is the name of the even/odd function.
./main --output="./main2.go" --n=1000 --package="main" --function="main"
This section describes how you can build and run the generated code. Amazing!
go build main2.go
- You can also specify
n
which is the number to be checked if it is even or odd.
./main2 --n=69