Skip to content

Instantly share code, notes, and snippets.

@sugilog sugilog/stdout.go
Last active Jul 25, 2016

Embed
What would you like to do?
Stdout
package main
import(
"fmt"
)
func main() {
chars := []string{
"A", "B", "C", "D", "E", "F", "G",
"L", "M", "Z",
// Skip "H"
// => same as `command := exec.Command( "clear" ); command.Stdout = os.Stdout; command.Run()
// Skip them, no mean
// "I", "J", "K", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y",
}
for _, c := range chars {
fmt.Println( "Test: " + c )
fmt.Println( "----" )
fmt.Print( "1234567890" )
fmt.Print( "\033[0;0" + c )
fmt.Print( "HOGEFUGA" )
fmt.Println( "" )
fmt.Println( "----" )
}
}
Test: A
---- HOGEFUGA
----567890
Test: B
----
1234567890HOGEFUGA
----
Test: C
----
1234567890 HOGEFUGA
----
Test: D
----
123456789HOGEFUGA
----
Test: E
----
HOGEFUGA90
----
Test: F
HOGEFUGA
----567890
Test: G
----
HOGEFUGA90
----
Test: L
----
HOGEFUGA
----
Test: M
----
HOGEFUGA
----
Test: Z
----
12345678HOGEFUGA
----
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.