зеркало из https://github.com/golang/scratch.git
rautelap: some harmless hello world
Change-Id: I2bdefcbfd5c79dc1f1774050fc9fd63b0506988e Reviewed-on: https://go-review.googlesource.com/48989 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Родитель
2ad051b889
Коммит
d32158d9a4
|
@ -0,0 +1,28 @@
|
||||||
|
// The rautelap tool prints a quote from a famous bending unit.
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bufio"
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
|
file, err := os.Create("/tmp/hubertJfarnsworth")
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
panic("Error opening file")
|
||||||
|
}
|
||||||
|
|
||||||
|
w := bufio.NewWriter(file)
|
||||||
|
io.WriteString(w, "Bite my shiny metal A**")
|
||||||
|
|
||||||
|
err = w.Flush()
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
println("Check file, some data maybe missing")
|
||||||
|
}
|
||||||
|
|
||||||
|
file.Close()
|
||||||
|
}
|
Загрузка…
Ссылка в новой задаче