Last active
May 8, 2016 04:59
-
-
Save complxalgorithm/3fcc896821c47c4b3e5dafc6386fa940 to your computer and use it in GitHub Desktop.
Golang script that will write capitalized version of all input text.
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 ( | |
"bufio" | |
"fmt" | |
"os" | |
"strings" | |
) | |
func main() { | |
scanner := bufio.NewScanner(os.Stdin) | |
for scanner.Scan() { | |
ucl := strings.ToUpper(scanner.Text()) | |
fmt.Println(ucl) | |
} | |
if err := scanner.Err(); err != nil { | |
fmt.Fprintln(os.Stderr, "error:", err) | |
os.Exit(1) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment