Created
May 13, 2020 10:10
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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