What do you want to save?
Add Code snippet
New code examples
-
Go 2021-10-12 10:13:08
golang kong cmd example
type Context struct { Debug bool } type RmCmd struct { Force bool `help:"Force removal."` Recursive bool `help:"Recursively remove files."` Paths []string `arg name:"path" help:"Paths to remove." type:... Add solution -
Go 2021-10-11 18:33:04
golang switch no condition
package main import ( "fmt" "time" ) func main() { t := time.Now() switch { case t.Hour() < 12: fmt.Println("Good morning!") case t.Hour() < 17: fmt.Println("Good afternoon.") default: fmt.Print... Add solution -
TypeScript 2021-10-06 20:04:08
if statements in go
func main() { // Basic one if x > 10 { return x } else if x == 10 { return 10 } else { return -x } // You can put one statement before the condition if a := b + c; a < 42 { return a } else { return a - 42 } // Type assertion in... Add solution