go version
This commit is contained in:
parent
a4d8e2b530
commit
e179df8475
7
Makefile
7
Makefile
|
@ -1,6 +1,9 @@
|
|||
CFLAGS=-Wall -g
|
||||
|
||||
all: fake
|
||||
all: fake gofake
|
||||
|
||||
gofake:
|
||||
go build -o gofake fake.go
|
||||
|
||||
clean:
|
||||
rm -f fake
|
||||
rm -f fake gofake
|
||||
|
|
24
fake.go
Normal file
24
fake.go
Normal 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)
|
||||
}
|
Loading…
Reference in New Issue
Block a user