diff options
author | Ondřej Surý <ondrej@sury.org> | 2012-03-26 16:50:58 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2012-03-26 16:50:58 +0200 |
commit | 519725bb3c075ee2462c929f5997cb068e18466a (patch) | |
tree | 5b162e8488ad147a645048c073577821b4a2bee9 /misc/cgo/stdio | |
parent | 842623c5dd2819d980ca9c58048d6bc6ed82475f (diff) | |
download | golang-upstream-weekly/2012.03.22.tar.gz |
Imported Upstream version 2012.03.22upstream-weekly/2012.03.22
Diffstat (limited to 'misc/cgo/stdio')
-rw-r--r-- | misc/cgo/stdio/Makefile | 17 | ||||
-rw-r--r-- | misc/cgo/stdio/chain.go | 4 | ||||
-rw-r--r-- | misc/cgo/stdio/fib.go | 4 | ||||
-rw-r--r-- | misc/cgo/stdio/file.go | 2 | ||||
-rw-r--r-- | misc/cgo/stdio/hello.go | 4 | ||||
-rwxr-xr-x | misc/cgo/stdio/test.bash | 9 |
6 files changed, 17 insertions, 23 deletions
diff --git a/misc/cgo/stdio/Makefile b/misc/cgo/stdio/Makefile deleted file mode 100644 index 586132b3c..000000000 --- a/misc/cgo/stdio/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2009 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -include ../../../src/Make.inc - -TARG=stdio -CGOFILES=\ - file.go\ - -CLEANFILES+=hello fib chain run.out - -include ../../../src/Make.pkg - -%: install %.go - $(GC) $(GCFLAGS) $(GCIMPORTS) $*.go - $(LD) -o $@ $*.$O diff --git a/misc/cgo/stdio/chain.go b/misc/cgo/stdio/chain.go index c188b2dd9..1cf0b1fe5 100644 --- a/misc/cgo/stdio/chain.go +++ b/misc/cgo/stdio/chain.go @@ -2,13 +2,15 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build ignore + // Pass numbers along a chain of threads. package main import ( + "../stdio" "runtime" - "stdio" "strconv" ) diff --git a/misc/cgo/stdio/fib.go b/misc/cgo/stdio/fib.go index 431d9cefe..6d3ccfd52 100644 --- a/misc/cgo/stdio/fib.go +++ b/misc/cgo/stdio/fib.go @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build ignore + // Compute Fibonacci numbers with two goroutines // that pass integers back and forth. No actual // concurrency, just threads and synchronization @@ -10,8 +12,8 @@ package main import ( + "../stdio" "runtime" - "stdio" "strconv" ) diff --git a/misc/cgo/stdio/file.go b/misc/cgo/stdio/file.go index ab1e88436..6e7d479ad 100644 --- a/misc/cgo/stdio/file.go +++ b/misc/cgo/stdio/file.go @@ -28,7 +28,7 @@ var Stderr = (*File)(C.stderr) // Test reference to library symbol. // Stdout and stderr are too special to be a reliable test. -var myerr = C.sys_errlist +//var = C.environ func (f *File) WriteString(s string) { p := C.CString(s) diff --git a/misc/cgo/stdio/hello.go b/misc/cgo/stdio/hello.go index 58fc6d574..4ab3c7447 100644 --- a/misc/cgo/stdio/hello.go +++ b/misc/cgo/stdio/hello.go @@ -2,9 +2,11 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build ignore + package main -import "stdio" +import "../stdio" func main() { stdio.Stdout.WriteString(stdio.Greeting + "\n") diff --git a/misc/cgo/stdio/test.bash b/misc/cgo/stdio/test.bash index 82e3f7b45..21829fa31 100755 --- a/misc/cgo/stdio/test.bash +++ b/misc/cgo/stdio/test.bash @@ -4,7 +4,10 @@ # license that can be found in the LICENSE file. set -e -gomake hello fib chain +go build hello.go +go build fib.go +go build chain.go + echo '*' hello >run.out ./hello >>run.out echo '*' fib >>run.out @@ -12,4 +15,6 @@ echo '*' fib >>run.out echo '*' chain >>run.out ./chain >>run.out diff run.out golden.out -gomake clean + +rm -f hello fib chain + |