calc

command
v0.0.0-...-9c6ac59 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 6 Imported by: 0

README

Example: calc

❯ ./calc -h
Error: command not found -h
Usage: calc {mult,pow,sum}
exit status 1

❯ ./calc pow -h
Usage of pow:
  -base int

  -exp int


❯ ./calc sum -h
sum prints the sum of args.

sum without arguments prints 0 because the default value of intList is intList([]int{}) from intList.FlagZero().

❯ ./calc sum
0

mult without arguments fails to run because the default value of comp is zero value.

❯ ./calc mult
call failure recover mult reflect: Call using zero Value argument
Usage: calc {mult,sum}

Normal cases:

❯ ./calc sum -args 1
1

❯ ./calc sum -args 1,2,3,4
10

❯ ./calc mult -a 1,2 -b 3,4
(-5+10i)

❯ ./calc pow -base 2 -exp 10
1024

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL