go version

This commit is contained in:
Jack L. Frost 2016-07-01 13:37:25 +03:00
parent a4d8e2b530
commit e179df8475
2 changed files with 29 additions and 2 deletions

View File

@ -1,6 +1,9 @@
CFLAGS=-Wall -g CFLAGS=-Wall -g
all: fake all: fake gofake
gofake:
go build -o gofake fake.go
clean: clean:
rm -f fake rm -f fake gofake

24
fake.go Normal file
View File

@ -0,0 +1,24 @@
package main
import (
"os"
"fmt"
)
func eprintf(format string, i ...interface{}) {
fmt.Fprintf(os.Stderr, format, i...)
}
func main() {
var i int
eprintf("Hi! I'm fake. I've been called as: %s ", os.Args[0])
for i = 1; i < len(os.Args[0:]); i++ {
eprintf("%s ", os.Args[i])
}
eprintf("\n")
os.Exit(1)
}