Skip to content

Instantly share code, notes, and snippets.

@roelofjan-elsinga
Created May 13, 2020 10:10
Show Gist options
  • Save roelofjan-elsinga/39cc6df5483622bdcbf27c9307b2b8c6 to your computer and use it in GitHub Desktop.
Save roelofjan-elsinga/39cc6df5483622bdcbf27c9307b2b8c6 to your computer and use it in GitHub Desktop.
A Go application to print a custom string and number to the terminal
package main
import (
"flag"
"fmt"
"strconv"
)
func main() {
var message = flag.String(
"message",
"Hello, World!",
"The message you'd like to print to the terminal",
)
var number = flag.Int(
"number",
1,
"The number you'd like to add to your message",
)
flag.Parse()
fmt.Println("This is the message you want to display: " + *message + " with number " + strconv.Itoa(*number))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment