Skip to content

Instantly share code, notes, and snippets.

@adyatlov
Last active May 28, 2020 13:13
Show Gist options
  • Save adyatlov/195387eb49ce9d071f0c5356994a908b to your computer and use it in GitHub Desktop.
Save adyatlov/195387eb49ce9d071f0c5356994a908b to your computer and use it in GitHub Desktop.
package main
// NOTE, THAT THIS PROGRAM HAS A BUG
import (
"bufio"
"fmt"
"io"
"log"
"os"
"unicode"
)
func main() {
reader := bufio.NewReader(os.Stdin)
for {
r, size, err := reader.ReadRune()
if err != nil {
if err == io.EOF && size == 0 {
break
}
log.Println("Error: ", err)
continue
}
if unicode.IsUpper(r) {
fmt.Print(string(r))
}
}
fmt.Println()
}
@adyatlov
Copy link
Author

NOTE, THAT THIS PROGRAM HAS A BUG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment