summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cmd/gc/sys.go48
-rwxr-xr-xsrc/lib/bignum.go32
-rw-r--r--src/lib/bignum_test.go36
-rw-r--r--src/lib/bufio.go14
-rw-r--r--src/lib/bufio_test.go6
-rw-r--r--src/lib/container/array/array.go8
-rw-r--r--src/lib/container/array/array_test.go12
-rw-r--r--src/lib/container/array/intarray.go4
-rw-r--r--src/lib/flag.go38
-rw-r--r--src/lib/fmt/fmt_test.go10
-rw-r--r--src/lib/fmt/format.go4
-rw-r--r--src/lib/fmt/print.go24
-rw-r--r--src/lib/hash/adler32.go4
-rw-r--r--src/lib/hash/adler32_test.go2
-rw-r--r--src/lib/hash/crc32.go14
-rw-r--r--src/lib/hash/crc32_test.go2
-rw-r--r--src/lib/hash/md5.go4
-rw-r--r--src/lib/hash/md5_test.go2
-rw-r--r--src/lib/hash/sha1.go4
-rw-r--r--src/lib/hash/sha1_test.go2
-rw-r--r--src/lib/http/conn.go4
-rw-r--r--src/lib/http/request.go6
-rw-r--r--src/lib/http/server.go4
-rw-r--r--src/lib/http/url.go10
-rw-r--r--src/lib/io/bytebuffer.go5
-rw-r--r--src/lib/io/io.go22
-rw-r--r--src/lib/json/generic.go14
-rw-r--r--src/lib/json/generic_test.go4
-rw-r--r--src/lib/json/parse.go8
-rw-r--r--src/lib/json/struct.go2
-rw-r--r--src/lib/json/struct_test.go2
-rw-r--r--src/lib/malloc.go10
-rw-r--r--src/lib/math/all_test.go24
-rw-r--r--src/lib/math/asin.go4
-rw-r--r--src/lib/math/atan.go2
-rw-r--r--src/lib/math/atan2.go2
-rw-r--r--src/lib/math/const.go2
-rw-r--r--src/lib/math/exp.go2
-rw-r--r--src/lib/math/fabs.go2
-rw-r--r--src/lib/math/floor.go4
-rw-r--r--src/lib/math/fmod.go2
-rw-r--r--src/lib/math/hypot.go2
-rw-r--r--src/lib/math/log.go4
-rw-r--r--src/lib/math/pow.go2
-rw-r--r--src/lib/math/pow10.go2
-rw-r--r--src/lib/math/sin.go4
-rw-r--r--src/lib/math/sinh.go4
-rw-r--r--src/lib/math/sqrt.go2
-rw-r--r--src/lib/math/tan.go2
-rw-r--r--src/lib/math/tanh.go2
-rw-r--r--src/lib/net/dialgoogle_test.go2
-rw-r--r--src/lib/net/dnsclient.go4
-rw-r--r--src/lib/net/dnsconfig.go4
-rw-r--r--src/lib/net/dnsmsg.go34
-rw-r--r--src/lib/net/fd.go4
-rw-r--r--src/lib/net/fd_darwin.go4
-rw-r--r--src/lib/net/fd_linux.go4
-rw-r--r--src/lib/net/ip.go20
-rw-r--r--src/lib/net/ip_test.go2
-rw-r--r--src/lib/net/net.go24
-rw-r--r--src/lib/net/net_darwin.go16
-rw-r--r--src/lib/net/net_linux.go16
-rw-r--r--src/lib/net/parse_test.go2
-rw-r--r--src/lib/net/port.go2
-rw-r--r--src/lib/net/port_test.go2
-rw-r--r--src/lib/net/tcpserver_test.go2
-rw-r--r--src/lib/once.go2
-rw-r--r--src/lib/once_test.go2
-rw-r--r--src/lib/os/os_env.go4
-rw-r--r--src/lib/os/os_error.go8
-rw-r--r--src/lib/os/os_file.go14
-rw-r--r--src/lib/os/os_time.go2
-rw-r--r--src/lib/rand.go24
-rw-r--r--src/lib/reflect/all_test.go12
-rw-r--r--src/lib/reflect/tostring.go8
-rw-r--r--src/lib/reflect/type.go30
-rw-r--r--src/lib/reflect/value.go62
-rw-r--r--src/lib/regexp/all_test.go32
-rw-r--r--src/lib/regexp/regexp.go26
-rw-r--r--src/lib/sort.go24
-rw-r--r--src/lib/sort_test.go16
-rw-r--r--src/lib/strconv/atof.go6
-rw-r--r--src/lib/strconv/atof_test.go4
-rw-r--r--src/lib/strconv/atoi.go8
-rw-r--r--src/lib/strconv/atoi_test.go8
-rw-r--r--src/lib/strconv/decimal_test.go6
-rw-r--r--src/lib/strconv/fp_test.go2
-rw-r--r--src/lib/strconv/ftoa.go8
-rw-r--r--src/lib/strconv/ftoa_test.go2
-rw-r--r--src/lib/strconv/itoa.go4
-rw-r--r--src/lib/strconv/itoa_test.go2
-rw-r--r--src/lib/strconv/quote.go4
-rw-r--r--src/lib/strconv/quote_test.go4
-rw-r--r--src/lib/strings.go10
-rw-r--r--src/lib/strings_test.go8
-rw-r--r--src/lib/sync/mutex.go2
-rw-r--r--src/lib/sync/mutex_test.go8
-rw-r--r--src/lib/syscall/errstr_darwin.go4
-rw-r--r--src/lib/syscall/errstr_linux.go4
-rw-r--r--src/lib/syscall/file_darwin.go44
-rw-r--r--src/lib/syscall/file_linux.go46
-rw-r--r--src/lib/syscall/signal_amd64_darwin.go2
-rw-r--r--src/lib/syscall/signal_amd64_linux.go2
-rw-r--r--src/lib/syscall/socket_darwin.go50
-rw-r--r--src/lib/syscall/socket_linux.go50
-rw-r--r--src/lib/syscall/syscall.go8
-rw-r--r--src/lib/syscall/syscall_amd64_darwin.go2
-rw-r--r--src/lib/syscall/syscall_amd64_linux.go2
-rw-r--r--src/lib/syscall/time_amd64_darwin.go4
-rw-r--r--src/lib/syscall/time_amd64_linux.go6
-rw-r--r--src/lib/syscall/types_amd64_darwin.go34
-rw-r--r--src/lib/syscall/types_amd64_linux.go34
-rw-r--r--src/lib/tabwriter/tabwriter.go4
-rw-r--r--src/lib/tabwriter/tabwriter_test.go2
-rw-r--r--src/lib/testing.go6
-rw-r--r--src/lib/time/tick.go4
-rw-r--r--src/lib/time/tick_test.go2
-rw-r--r--src/lib/time/time.go16
-rw-r--r--src/lib/time/time_test.go4
-rw-r--r--src/lib/time/zoneinfo.go4
-rw-r--r--src/lib/unicode/letter.go12
-rw-r--r--src/lib/unicode/letter_test.go4
-rw-r--r--src/lib/utf8.go18
-rw-r--r--src/lib/utf8_test.go12
124 files changed, 651 insertions, 652 deletions
diff --git a/src/cmd/gc/sys.go b/src/cmd/gc/sys.go
index 7b2e3ad2e..28a22fba3 100644
--- a/src/cmd/gc/sys.go
+++ b/src/cmd/gc/sys.go
@@ -69,35 +69,35 @@ func arrays2d(old *any, nel int) (ary []any);
// used by go programs
-export func Breakpoint();
+func Breakpoint();
-export func Reflect(i interface { }) (uint64, string, bool);
-export func Unreflect(uint64, string, bool) (ret interface { });
+func Reflect(i interface { }) (uint64, string, bool);
+func Unreflect(uint64, string, bool) (ret interface { });
-export var Args []string;
-export var Envs []string;
+var Args []string;
+var Envs []string;
-export func Frexp(float64) (float64, int); // break fp into exp,fract
-export func Ldexp(float64, int) float64; // make fp from exp,fract
-export func Modf(float64) (float64, float64); // break fp into double.double
-export func IsInf(float64, int) bool; // test for infinity
-export func IsNaN(float64) bool; // test for not-a-number
-export func Inf(int) float64; // return signed Inf
-export func NaN() float64; // return a NaN
-export func Float32bits(float32) uint32; // raw bits
-export func Float64bits(float64) uint64; // raw bits
-export func Float32frombits(uint32) float32; // raw bits
-export func Float64frombits(uint64) float64; // raw bits
+func Frexp(float64) (float64, int); // break fp into exp,fract
+func Ldexp(float64, int) float64; // make fp from exp,fract
+func Modf(float64) (float64, float64); // break fp into double.double
+func IsInf(float64, int) bool; // test for infinity
+func IsNaN(float64) bool; // test for not-a-number
+func Inf(int) float64; // return signed Inf
+func NaN() float64; // return a NaN
+func Float32bits(float32) uint32; // raw bits
+func Float64bits(float64) uint64; // raw bits
+func Float32frombits(uint32) float32; // raw bits
+func Float64frombits(uint64) float64; // raw bits
-export func Gosched();
-export func Goexit();
+func Gosched();
+func Goexit();
-export func BytesToRune(*byte, int, int) (int, int); // convert bytes to runes
-export func StringToRune(string, int) (int, int); // convert bytes to runes
+func BytesToRune(*byte, int, int) (int, int); // convert bytes to runes
+func StringToRune(string, int) (int, int); // convert bytes to runes
-export func Exit(int);
+func Exit(int);
-export func Caller(n int) (pc uint64, file string, line int, ok bool);
+func Caller(n int) (pc uint64, file string, line int, ok bool);
-export func SemAcquire(sema *int32);
-export func SemRelease(sema *int32);
+func SemAcquire(sema *int32);
+func SemRelease(sema *int32);
diff --git a/src/lib/bignum.go b/src/lib/bignum.go
index fb66ba02a..078374ad7 100755
--- a/src/lib/bignum.go
+++ b/src/lib/bignum.go
@@ -52,7 +52,7 @@ import "fmt"
// results are packed again. For faster unpacking/packing, the base size
// in bits must be even.
-export type (
+type (
Digit uint64;
Digit2 uint32; // half-digits for division
)
@@ -91,7 +91,7 @@ func isSmall(x Digit) bool {
}
-export func Dump(x []Digit) {
+func Dump(x []Digit) {
print("[", len(x), "]");
for i := len(x) - 1; i >= 0; i-- {
print(" ", x[i]);
@@ -111,7 +111,7 @@ export func Dump(x []Digit) {
// n, m len(x), len(y)
-export type Natural []Digit;
+type Natural []Digit;
var (
natZero Natural = Natural{};
@@ -123,7 +123,7 @@ var (
// Creation
-export func Nat(x uint) Natural {
+func Nat(x uint) Natural {
switch x {
case 0: return natZero;
case 1: return natOne;
@@ -696,7 +696,7 @@ func muladd1(x Natural, d, c Digit) Natural {
// Determines base (octal, decimal, hexadecimal) if base == 0.
// Returns the number and base.
-export func NatFromString(s string, base uint, slen *int) (Natural, uint) {
+func NatFromString(s string, base uint, slen *int) (Natural, uint) {
// determine base if necessary
i, n := 0, len(s);
if base == 0 {
@@ -766,7 +766,7 @@ func (xp Natural) Pow(n uint) Natural {
}
-export func MulRange(a, b uint) Natural {
+func MulRange(a, b uint) Natural {
switch {
case a > b: return Nat(1);
case a == b: return Nat(a);
@@ -778,14 +778,14 @@ export func MulRange(a, b uint) Natural {
}
-export func Fact(n uint) Natural {
+func Fact(n uint) Natural {
// Using MulRange() instead of the basic for-loop
// lead to faster factorial computation.
return MulRange(2, n);
}
-export func Binomial(n, k uint) Natural {
+func Binomial(n, k uint) Natural {
return MulRange(n-k+1, n).Div(MulRange(1, k));
}
@@ -806,7 +806,7 @@ func (xp Natural) Gcd(y Natural) Natural {
// Integers are normalized if the mantissa is normalized and the sign is
// false for mant == 0. Use MakeInt to create normalized Integers.
-export type Integer struct {
+type Integer struct {
sign bool;
mant Natural;
}
@@ -814,7 +814,7 @@ export type Integer struct {
// Creation
-export func MakeInt(sign bool, mant Natural) *Integer {
+func MakeInt(sign bool, mant Natural) *Integer {
if mant.IsZero() {
sign = false; // normalize
}
@@ -822,7 +822,7 @@ export func MakeInt(sign bool, mant Natural) *Integer {
}
-export func Int(x int) *Integer {
+func Int(x int) *Integer {
sign := false;
var ux uint;
if x < 0 {
@@ -1103,7 +1103,7 @@ func (x *Integer) Format(h fmt.Formatter, c int) {
// Determines base (octal, decimal, hexadecimal) if base == 0.
// Returns the number and base.
-export func IntFromString(s string, base uint, slen *int) (*Integer, uint) {
+func IntFromString(s string, base uint, slen *int) (*Integer, uint) {
// get sign, if any
sign := false;
if len(s) > 0 && (s[0] == '-' || s[0] == '+') {
@@ -1126,7 +1126,7 @@ export func IntFromString(s string, base uint, slen *int) (*Integer, uint) {
// ----------------------------------------------------------------------------
// Rational numbers
-export type Rational struct {
+type Rational struct {
a *Integer; // numerator
b Natural; // denominator
}
@@ -1134,7 +1134,7 @@ export type Rational struct {
// Creation
-export func MakeRat(a *Integer, b Natural) *Rational {
+func MakeRat(a *Integer, b Natural) *Rational {
f := a.mant.Gcd(b); // f > 0
if f.Cmp(Nat(1)) != 0 {
a = MakeInt(a.sign, a.mant.Div(f));
@@ -1144,7 +1144,7 @@ export func MakeRat(a *Integer, b Natural) *Rational {
}
-export func Rat(a0 int, b0 int) *Rational {
+func Rat(a0 int, b0 int) *Rational {
a, b := Int(a0), Int(b0);
if b.sign {
a = a.Neg();
@@ -1233,7 +1233,7 @@ func (x *Rational) Format(h fmt.Formatter, c int) {
// Determines base (octal, decimal, hexadecimal) if base == 0.
// Returns the number and base of the nominator.
-export func RatFromString(s string, base uint, slen *int) (*Rational, uint) {
+func RatFromString(s string, base uint, slen *int) (*Rational, uint) {
// read nominator
var alen, blen int;
a, abase := IntFromString(s, base, &alen);
diff --git a/src/lib/bignum_test.go b/src/lib/bignum_test.go
index f87cfd50a..d8d214dd7 100644
--- a/src/lib/bignum_test.go
+++ b/src/lib/bignum_test.go
@@ -90,7 +90,7 @@ func rat_eq(n uint, x, y *bignum.Rational) {
}
}
-export func TestNatConv(t *testing.T) {
+func TestNatConv(t *testing.T) {
tester = t;
test_msg = "NatConvA";
nat_eq(0, a, bignum.Nat(991));
@@ -122,7 +122,7 @@ export func TestNatConv(t *testing.T) {
}
-export func TestIntConv(t *testing.T) {
+func TestIntConv(t *testing.T) {
tester = t;
test_msg = "IntConv";
var slen int;
@@ -140,7 +140,7 @@ export func TestIntConv(t *testing.T) {
}
-export func TestRatConv(t *testing.T) {
+func TestRatConv(t *testing.T) {
tester = t;
test_msg = "RatConv";
var slen int;
@@ -176,7 +176,7 @@ func sum(n uint, scale bignum.Natural) bignum.Natural {
}
-export func TestNatAdd(t *testing.T) {
+func TestNatAdd(t *testing.T) {
tester = t;
test_msg = "NatAddA";
nat_eq(0, add(nat_zero, nat_zero), nat_zero);
@@ -206,7 +206,7 @@ func mul(x, y bignum.Natural) bignum.Natural {
}
-export func TestNatSub(t *testing.T) {
+func TestNatSub(t *testing.T) {
tester = t;
test_msg = "NatSubA";
nat_eq(0, nat_zero.Sub(nat_zero), nat_zero);
@@ -223,7 +223,7 @@ export func TestNatSub(t *testing.T) {
}
-export func TestNatMul(t *testing.T) {
+func TestNatMul(t *testing.T) {
tester = t;
test_msg = "NatMulA";
nat_eq(0, mul(c, nat_zero), nat_zero);
@@ -242,7 +242,7 @@ export func TestNatMul(t *testing.T) {
}
-export func TestNatDiv(t *testing.T) {
+func TestNatDiv(t *testing.T) {
tester = t;
test_msg = "NatDivA";
nat_eq(0, c.Div(nat_one), c);
@@ -260,7 +260,7 @@ export func TestNatDiv(t *testing.T) {
}
-export func TestIntQuoRem(t *testing.T) {
+func TestIntQuoRem(t *testing.T) {
tester = t;
test_msg = "IntQuoRem";
type T struct { x, y, q, r int };
@@ -287,7 +287,7 @@ export func TestIntQuoRem(t *testing.T) {
}
-export func TestIntDivMod(t *testing.T) {
+func TestIntDivMod(t *testing.T) {
tester = t;
test_msg = "IntDivMod";
type T struct { x, y, q, r int };
@@ -314,7 +314,7 @@ export func TestIntDivMod(t *testing.T) {
}
-export func TestNatMod(t *testing.T) {
+func TestNatMod(t *testing.T) {
tester = t;
test_msg = "NatModA";
for i := uint(0); ; i++ {
@@ -330,7 +330,7 @@ export func TestNatMod(t *testing.T) {
}
-export func TestNatShift(t *testing.T) {
+func TestNatShift(t *testing.T) {
tester = t;
test_msg = "NatShift1L";
test(0, b.Shl(0).Cmp(b) == 0);
@@ -365,7 +365,7 @@ export func TestNatShift(t *testing.T) {
}
-export func TestIntShift(t *testing.T) {
+func TestIntShift(t *testing.T) {
tester = t;
test_msg = "IntShift1L";
test(0, ip.Shl(0).Cmp(ip) == 0);
@@ -404,7 +404,7 @@ export func TestIntShift(t *testing.T) {
}
-export func TestNatCmp(t *testing.T) {
+func TestNatCmp(t *testing.T) {
tester = t;
test_msg = "NatCmp";
test(0, a.Cmp(a) == 0);
@@ -417,14 +417,14 @@ export func TestNatCmp(t *testing.T) {
}
-export func TestNatLog2(t *testing.T) {
+func TestNatLog2(t *testing.T) {
tester = t;
test_msg = "NatLog2A";
test(0, nat_one.Log2() == 0);
test(1, nat_two.Log2() == 1);
test(2, bignum.Nat(3).Log2() == 1);
test(3, bignum.Nat(4).Log2() == 2);
-
+
test_msg = "NatLog2B";
for i := uint(0); i < 100; i++ {
test(i, nat_one.Shl(i).Log2() == i);
@@ -432,7 +432,7 @@ export func TestNatLog2(t *testing.T) {
}
-export func TestNatGcd(t *testing.T) {
+func TestNatGcd(t *testing.T) {
tester = t;
test_msg = "NatGcdA";
f := bignum.Nat(99991);
@@ -440,7 +440,7 @@ export func TestNatGcd(t *testing.T) {
}
-export func TestNatPow(t *testing.T) {
+func TestNatPow(t *testing.T) {
tester = t;
test_msg = "NatPowA";
nat_eq(0, nat_two.Pow(0), nat_one);
@@ -452,7 +452,7 @@ export func TestNatPow(t *testing.T) {
}
-export func TestNatPop(t *testing.T) {
+func TestNatPop(t *testing.T) {
tester = t;
test_msg = "NatPopA";
test(0, nat_zero.Pop() == 0);
diff --git a/src/lib/bufio.go b/src/lib/bufio.go
index 5a712e3f6..6fed9d06e 100644
--- a/src/lib/bufio.go
+++ b/src/lib/bufio.go
@@ -21,7 +21,7 @@ const (
defaultBufSize = 4096
)
-export var (
+var (
EndOfFile = os.NewError("end of file");
PhaseError = os.NewError("phase error");
BufferFull = os.NewError("buffer full");
@@ -39,14 +39,14 @@ func copySlice(dst []byte, src []byte) {
// Buffered input.
-export type BufRead struct {
+type BufRead struct {
buf []byte;
rd io.Read;
r, w int;
err *os.Error;
}
-export func NewBufReadSize(rd io.Read, size int) (b *BufRead, err *os.Error) {
+func NewBufReadSize(rd io.Read, size int) (b *BufRead, err *os.Error) {
if size <= 0 {
return nil, BadBufSize
}
@@ -56,7 +56,7 @@ export func NewBufReadSize(rd io.Read, size int) (b *BufRead, err *os.Error) {
return b, nil
}
-export func NewBufRead(rd io.Read) (b *BufRead, err *os.Error) {
+func NewBufRead(rd io.Read) (b *BufRead, err *os.Error) {
return NewBufReadSize(rd, defaultBufSize);
}
@@ -326,14 +326,14 @@ func (b *BufRead) ReadLineString(delim byte, savedelim bool) (line string, err *
// buffered output
-export type BufWrite struct {
+type BufWrite struct {
err *os.Error;
buf []byte;
n int;
wr io.Write;
}
-export func NewBufWriteSize(wr io.Write, size int) (b *BufWrite, err *os.Error) {
+func NewBufWriteSize(wr io.Write, size int) (b *BufWrite, err *os.Error) {
if size <= 0 {
return nil, BadBufSize
}
@@ -343,7 +343,7 @@ export func NewBufWriteSize(wr io.Write, size int) (b *BufWrite, err *os.Error)
return b, nil
}
-export func NewBufWrite(wr io.Write) (b *BufWrite, err *os.Error) {
+func NewBufWrite(wr io.Write) (b *BufWrite, err *os.Error) {
return NewBufWriteSize(wr, defaultBufSize);
}
diff --git a/src/lib/bufio_test.go b/src/lib/bufio_test.go
index 4b09a7c3f..eead927b4 100644
--- a/src/lib/bufio_test.go
+++ b/src/lib/bufio_test.go
@@ -173,7 +173,7 @@ var bufsizes = []int {
23, 32, 46, 64, 93, 128, 1024, 4096
}
-export func TestBufReadSimple(t *testing.T) {
+func TestBufReadSimple(t *testing.T) {
b, e := NewBufRead(newByteReader(io.StringBytes("hello world")));
if s := readBytes(b); s != "hello world" {
t.Errorf("simple hello world test failed: got %q", s);
@@ -185,7 +185,7 @@ export func TestBufReadSimple(t *testing.T) {
}
}
-export func TestBufRead(t *testing.T) {
+func TestBufRead(t *testing.T) {
var texts [31]string;
str := "";
all := "";
@@ -278,7 +278,7 @@ type writeMaker struct {
name string;
fn *()writeBuffer;
}
-export func TestBufWrite(t *testing.T) {
+func TestBufWrite(t *testing.T) {
var data [8192]byte;
var writers = []writeMaker {
diff --git a/src/lib/container/array/array.go b/src/lib/container/array/array.go
index 241e8d9e9..3d5c53249 100644
--- a/src/lib/container/array/array.go
+++ b/src/lib/container/array/array.go
@@ -4,11 +4,11 @@
package array
-export type Element interface {
+type Element interface {
}
-export type Array struct {
+type Array struct {
// TODO do not export field
a []Element
}
@@ -35,7 +35,7 @@ func (p *Array) Init(initial_len int) *Array {
}
-export func New(len int) *Array {
+func New(len int) *Array {
return new(Array).Init(len)
}
@@ -112,7 +112,7 @@ func (p *Array) Pop() Element {
// Partial SortInterface support
-export type LessInterface interface {
+type LessInterface interface {
Less(y Element) bool
}
diff --git a/src/lib/container/array/array_test.go b/src/lib/container/array/array_test.go
index 2c56ba8f0..6deaf4a6e 100644
--- a/src/lib/container/array/array_test.go
+++ b/src/lib/container/array/array_test.go
@@ -9,7 +9,7 @@ import "testing"
import "sort"
-export func TestInit(t *testing.T) {
+func TestInit(t *testing.T) {
var a array.Array;
if a.Init(0).Len() != 0 { t.Error("A") }
if a.Init(1).Len() != 1 { t.Error("B") }
@@ -17,19 +17,19 @@ export func TestInit(t *testing.T) {
}
-export func TestNew(t *testing.T) {
+func TestNew(t *testing.T) {
if array.New(0).Len() != 0 { t.Error("A") }
if array.New(1).Len() != 1 { t.Error("B") }
if array.New(10).Len() != 10 { t.Error("C") }
}
-export func Val(i int) int {
+func Val(i int) int {
return i*991 - 1234
}
-export func TestAccess(t *testing.T) {
+func TestAccess(t *testing.T) {
const n = 100;
var a array.Array;
a.Init(n);
@@ -42,7 +42,7 @@ export func TestAccess(t *testing.T) {
}
-export func TestInsertRemoveClear(t *testing.T) {
+func TestInsertRemoveClear(t *testing.T) {
const n = 100;
a := array.New(0);
@@ -81,7 +81,7 @@ export func TestInsertRemoveClear(t *testing.T) {
/* currently doesn't compile due to linker bug
-export func TestSorting(t *testing.T) {
+func TestSorting(t *testing.T) {
const n = 100;
a := array.NewIntArray(n);
for i := n-1; i >= 0; i-- {
diff --git a/src/lib/container/array/intarray.go b/src/lib/container/array/intarray.go
index eb7e83907..7aefa7852 100644
--- a/src/lib/container/array/intarray.go
+++ b/src/lib/container/array/intarray.go
@@ -6,7 +6,7 @@ package array
import "array"
-export type IntArray struct {
+type IntArray struct {
// TODO do not export field
array.Array;
}
@@ -18,7 +18,7 @@ func (p *IntArray) Init(len int) *IntArray {
}
-export func NewIntArray(len int) *IntArray {
+func NewIntArray(len int) *IntArray {
return new(IntArray).Init(len)
}
diff --git a/src/lib/flag.go b/src/lib/flag.go
index 90784e711..94bbbb49e 100644
--- a/src/lib/flag.go
+++ b/src/lib/flag.go
@@ -218,7 +218,7 @@ type _Value interface {
}
// -- Flag structure (internal)
-export type Flag struct {
+type Flag struct {
name string;
usage string;
value _Value;
@@ -232,13 +232,13 @@ type allFlags struct {
var flags *allFlags = &allFlags{make(map[string] *Flag), make(map[string] *Flag), 1}
-export func PrintDefaults() {
+func PrintDefaults() {
for k, f := range flags.formal {
print(" -", f.name, "=", f.value.str(), ": ", f.usage, "\n");
}
}
-export func Usage() {
+func Usage() {
if len(sys.Args) > 0 {
print("Usage of ", sys.Args[0], ": \n");
} else {
@@ -248,11 +248,11 @@ export func Usage() {
sys.Exit(1);
}
-export func NFlag() int {
+func NFlag() int {
return len(flags.actual)
}
-export func Arg(i int) string {
+func Arg(i int) string {
i += flags.first_arg;
if i < 0 || i >= len(sys.Args) {
return "";
@@ -260,7 +260,7 @@ export func Arg(i int) string {
return sys.Args[i]
}
-export func NArg() int {
+func NArg() int {
return len(sys.Args) - flags.first_arg
}
@@ -277,63 +277,63 @@ func add(name string, value _Value, usage string) {
flags.formal[name] = f;
}
-export func Bool(name string, value bool, usage string) *bool {
+func Bool(name string, value bool, usage string) *bool {
p := new(bool);
add(name, newBoolValue(value, p), usage);
return p;
}
-export func BoolVar(p *bool, name string, value bool, usage string) {
+func BoolVar(p *bool, name string, value bool, usage string) {
add(name, newBoolValue(value, p), usage);
}
-export func Int(name string, value int, usage string) *int {
+func Int(name string, value int, usage string) *int {
p := new(int);
add(name, newIntValue(value, p), usage);
return p;
}
-export func IntVar(p *int, name string, value int, usage string) {
+func IntVar(p *int, name string, value int, usage string) {
add(name, newIntValue(value, p), usage);
}
-export func Int64(name string, value int64, usage string) *int64 {
+func Int64(name string, value int64, usage string) *int64 {
p := new(int64);
add(name, newInt64Value(value, p), usage);
return p;
}
-export func Int64Var(p *int64, name string, value int64, usage string) {
+func Int64Var(p *int64, name string, value int64, usage string) {
add(name, newInt64Value(value, p), usage);
}
-export func Uint(name string, value uint, usage string) *uint {
+func Uint(name string, value uint, usage string) *uint {
p := new(uint);
add(name, newUintValue(value, p), usage);
return p;
}
-export func UintVar(p *uint, name string, value uint, usage string) {
+func UintVar(p *uint, name string, value uint, usage string) {
add(name, newUintValue(value, p), usage);
}
-export func Uint64(name string, value uint64, usage string) *uint64 {
+func Uint64(name string, value uint64, usage string) *uint64 {
p := new(uint64);
add(name, newUint64Value(value, p), usage);
return p;
}
-export func Uint64Var(p *uint64, name string, value uint64, usage string) {
+func Uint64Var(p *uint64, name string, value uint64, usage string) {
add(name, newUint64Value(value, p), usage);
}
-export func String(name, value string, usage string) *string {
+func String(name, value string, usage string) *string {
p := new(string);
add(name, newStringValue(value, p), usage);
return p;
}
-export func StringVar(p *string, name, value string, usage string) {
+func StringVar(p *string, name, value string, usage string) {
add(name, newStringValue(value, p), usage);
}
@@ -432,7 +432,7 @@ func (f *allFlags) ParseOne(index int) (ok bool, next int)
return true, index + 1
}
-export func Parse() {
+func Parse() {
for i := 1; i < len(sys.Args); {
ok, next := flags.ParseOne(i);
if next > 0 {
diff --git a/src/lib/fmt/fmt_test.go b/src/lib/fmt/fmt_test.go
index 98bbcff2d..881fd1a36 100644
--- a/src/lib/fmt/fmt_test.go
+++ b/src/lib/fmt/fmt_test.go
@@ -11,7 +11,7 @@ import (
"testing";
)
-export func TestFmtInterface(t *testing.T) {
+func TestFmtInterface(t *testing.T) {
var i1 interface{};
i1 = "abc";
s := fmt.Sprintf("%s", i1);
@@ -150,7 +150,7 @@ var fmttests = []fmtTest{
fmtTest{ "%20g", sys.NaN(), " NaN" },
}
-export func TestSprintf(t *testing.T) {
+func TestSprintf(t *testing.T) {
for i := 0; i < len(fmttests); i++ {
tt := fmttests[i];
s := fmt.Sprintf(tt.fmt, tt.val);
@@ -204,7 +204,7 @@ var flagtests = []flagTest {
flagTest{ "%-1.2abc", "[%-1.2a]bc" },
}
-export func TestFlagParser(t *testing.T) {
+func TestFlagParser(t *testing.T) {
var flagprinter flagPrinter;
for i := 0; i < len(flagtests); i++ {
tt := flagtests[i];
@@ -215,7 +215,7 @@ export func TestFlagParser(t *testing.T) {
}
}
-export func TestStructPrinter(t *testing.T) {
+func TestStructPrinter(t *testing.T) {
var s struct {
a string;
b string;
@@ -241,7 +241,7 @@ export func TestStructPrinter(t *testing.T) {
}
}
-export func TestArrayPrinter(t *testing.T) {
+func TestArrayPrinter(t *testing.T) {
a := []int{1, 2, 3, 4, 5};
want := "[1 2 3 4 5]";
out := fmt.Sprintf("%v", a);
diff --git a/src/lib/fmt/format.go b/src/lib/fmt/format.go
index ef8477764..e230ec99c 100644
--- a/src/lib/fmt/format.go
+++ b/src/lib/fmt/format.go
@@ -33,7 +33,7 @@ func init() {
}
}
-export type Fmt struct {
+type Fmt struct {
buf string;
wid int;
wid_present bool;
@@ -68,7 +68,7 @@ func (f *Fmt) init() {
f.clearflags();
}
-export func New() *Fmt {
+func New() *Fmt {
f := new(Fmt);
f.init();
return f;
diff --git a/src/lib/fmt/print.go b/src/lib/fmt/print.go
index 0e7569731..a75e0fff2 100644
--- a/src/lib/fmt/print.go
+++ b/src/lib/fmt/print.go
@@ -20,7 +20,7 @@ import (
// Representation of printer state passed to custom formatters.
// Provides access to the io.Write interface plus information about
// the active formatting verb.
-export type Formatter interface {
+type Formatter interface {
Write(b []byte) (ret int, err *os.Error);
Width() (wid int, ok bool);
Precision() (prec int, ok bool);
@@ -29,11 +29,11 @@ export type Formatter interface {
Flag(int) bool;
}
-export type Format interface {
+type Format interface {
Format(f Formatter, c int);
}
-export type String interface {
+type String interface {
String() string
}
@@ -129,7 +129,7 @@ func (p *pp) doprint(v reflect.StructValue, addspace, addnewline bool);
// These routines end in 'f' and take a format string.
-export func Fprintf(w io.Write, format string, a ...) (n int, error *os.Error) {
+func Fprintf(w io.Write, format string, a ...) (n int, error *os.Error) {
v := reflect.NewValue(a).(reflect.PtrValue).Sub().(reflect.StructValue);
p := newPrinter();
p.doprintf(format, v);
@@ -137,12 +137,12 @@ export func Fprintf(w io.Write, format string, a ...) (n int, error *os.Error) {
return n, error;
}
-export func Printf(format string, v ...) (n int, errno *os.Error) {
+func Printf(format string, v ...) (n int, errno *os.Error) {
n, errno = Fprintf(os.Stdout, format, v);
return n, errno;
}
-export func Sprintf(format string, a ...) string {
+func Sprintf(format string, a ...) string {
v := reflect.NewValue(a).(reflect.PtrValue).Sub().(reflect.StructValue);
p := newPrinter();
p.doprintf(format, v);
@@ -153,7 +153,7 @@ export func Sprintf(format string, a ...) string {
// These routines do not take a format string and add spaces only
// when the operand on neither side is a string.
-export func Fprint(w io.Write, a ...) (n int, error *os.Error) {
+func Fprint(w io.Write, a ...) (n int, error *os.Error) {
v := reflect.NewValue(a).(reflect.PtrValue).Sub().(reflect.StructValue);
p := newPrinter();
p.doprint(v, false, false);
@@ -161,12 +161,12 @@ export func Fprint(w io.Write, a ...) (n int, error *os.Error) {
return n, error;
}
-export func Print(v ...) (n int, errno *os.Error) {
+func Print(v ...) (n int, errno *os.Error) {
n, errno = Fprint(os.Stdout, v);
return n, errno;
}
-export func Sprint(a ...) string {
+func Sprint(a ...) string {
v := reflect.NewValue(a).(reflect.PtrValue).Sub().(reflect.StructValue);
p := newPrinter();
p.doprint(v, false, false);
@@ -178,7 +178,7 @@ export func Sprint(a ...) string {
// always add spaces between operands, and add a newline
// after the last operand.
-export func Fprintln(w io.Write, a ...) (n int, error *os.Error) {
+func Fprintln(w io.Write, a ...) (n int, error *os.Error) {
v := reflect.NewValue(a).(reflect.PtrValue).Sub().(reflect.StructValue);
p := newPrinter();
p.doprint(v, true, true);
@@ -186,12 +186,12 @@ export func Fprintln(w io.Write, a ...) (n int, error *os.Error) {
return n, error;
}
-export func Println(v ...) (n int, errno *os.Error) {
+func Println(v ...) (n int, errno *os.Error) {
n, errno = Fprintln(os.Stdout, v);
return n, errno;
}
-export func Sprintln(a ...) string {
+func Sprintln(a ...) string {
v := reflect.NewValue(a).(reflect.PtrValue).Sub().(reflect.StructValue);
p := newPrinter();
p.doprint(v, true, true);
diff --git a/src/lib/hash/adler32.go b/src/lib/hash/adler32.go
index 22d82bc64..07818992e 100644
--- a/src/lib/hash/adler32.go
+++ b/src/lib/hash/adler32.go
@@ -14,7 +14,7 @@ package adler32
import "os"
-export type Digest struct {
+type Digest struct {
a, b uint32;
n int;
}
@@ -24,7 +24,7 @@ const (
_MaxIter = 5552; // max mod-free iterations before would overflow uint32
)
-export func NewDigest() *Digest {
+func NewDigest() *Digest {
return &Digest{1, 0, 0};
}
diff --git a/src/lib/hash/adler32_test.go b/src/lib/hash/adler32_test.go
index 92aae5760..97b918f13 100644
--- a/src/lib/hash/adler32_test.go
+++ b/src/lib/hash/adler32_test.go
@@ -49,7 +49,7 @@ var golden = []_Adler32Test {
_Adler32Test{ 0x2e5d1316, "How can you write a big system without C++? -Paul Glick" },
}
-export func TestGolden(t *testing.T) {
+func TestGolden(t *testing.T) {
for i := 0; i < len(golden); i++ {
g := golden[i];
c := NewDigest();
diff --git a/src/lib/hash/crc32.go b/src/lib/hash/crc32.go
index 63e6b8cd6..7bfca39d3 100644
--- a/src/lib/hash/crc32.go
+++ b/src/lib/hash/crc32.go
@@ -9,7 +9,7 @@ package crc32
import "os"
-export const (
+const (
// Far and away the most common CRC-32 polynomial.
// Used by ethernet (IEEE 802.3), v.42, fddi, gzip, zip, png, mpeg-2, ...
IEEE = 0xedb88320;
@@ -26,9 +26,9 @@ export const (
)
// TODO(rsc): Change to [256]uint32 once 6g can handle it.
-export type Table []uint32
+type Table []uint32
-export func MakeTable(poly uint32) Table {
+func MakeTable(poly uint32) Table {
t := make(Table, 256);
for i := 0; i < 256; i++ {
crc := uint32(i);
@@ -44,18 +44,18 @@ export func MakeTable(poly uint32) Table {
return t;
}
-export var IEEETable = MakeTable(IEEE);
+var IEEETable = MakeTable(IEEE);
-export type Digest struct {
+type Digest struct {
crc uint32;
tab Table;
}
-export func NewDigest(tab Table) *Digest {
+func NewDigest(tab Table) *Digest {
return &Digest{0, tab};
}
-export func NewIEEEDigest() *Digest {
+func NewIEEEDigest() *Digest {
return NewDigest(IEEETable);
}
diff --git a/src/lib/hash/crc32_test.go b/src/lib/hash/crc32_test.go
index a5a206f8b..a2a37cf4a 100644
--- a/src/lib/hash/crc32_test.go
+++ b/src/lib/hash/crc32_test.go
@@ -49,7 +49,7 @@ var golden = []_Crc32Test {
_Crc32Test{ 0x8e0bb443, "How can you write a big system without C++? -Paul Glick" },
}
-export func TestGolden(t *testing.T) {
+func TestGolden(t *testing.T) {
for i := 0; i < len(golden); i++ {
g := golden[i];
c := NewIEEEDigest();
diff --git a/src/lib/hash/md5.go b/src/lib/hash/md5.go
index b9a79dec3..98dae6f83 100644
--- a/src/lib/hash/md5.go
+++ b/src/lib/hash/md5.go
@@ -17,14 +17,14 @@ const (
_Init3 = 0x10325476;
)
-export type Digest struct {
+type Digest struct {
s [4]uint32;
x [_Chunk]byte;
nx int;
len uint64;
}
-export func NewDigest() *Digest {
+func NewDigest() *Digest {
d := new(Digest);
d.s[0] = _Init0;
d.s[1] = _Init1;
diff --git a/src/lib/hash/md5_test.go b/src/lib/hash/md5_test.go
index 377df0375..641034694 100644
--- a/src/lib/hash/md5_test.go
+++ b/src/lib/hash/md5_test.go
@@ -50,7 +50,7 @@ var golden = []md5Test {
md5Test{ "132f7619d33b523b1d9e5bd8e0928355", "How can you write a big system without C++? -Paul Glick" },
}
-export func TestGolden(t *testing.T) {
+func TestGolden(t *testing.T) {
for i := 0; i < len(golden); i++ {
g := golden[i];
c := NewDigest();
diff --git a/src/lib/hash/sha1.go b/src/lib/hash/sha1.go
index 1cb766840..dab477cd4 100644
--- a/src/lib/hash/sha1.go
+++ b/src/lib/hash/sha1.go
@@ -18,14 +18,14 @@ const (
_Init4 = 0xC3D2E1F0;
)
-export type Digest struct {
+type Digest struct {
h [5]uint32;
x [_Chunk]byte;
nx int;
len uint64;
}
-export func NewDigest() *Digest {
+func NewDigest() *Digest {
d := new(Digest);
d.h[0] = _Init0;
d.h[1] = _Init1;
diff --git a/src/lib/hash/sha1_test.go b/src/lib/hash/sha1_test.go
index 21194f346..2dde3973d 100644
--- a/src/lib/hash/sha1_test.go
+++ b/src/lib/hash/sha1_test.go
@@ -52,7 +52,7 @@ var golden = []sha1Test {
sha1Test{ "6627d6904d71420b0bf3886ab629623538689f45", "How can you write a big system without C++? -Paul Glick" },
}
-export func TestGolden(t *testing.T) {
+func TestGolden(t *testing.T) {
for i := 0; i < len(golden); i++ {
g := golden[i];
c := NewDigest();
diff --git a/src/lib/http/conn.go b/src/lib/http/conn.go
index 15c0707f3..909863ef5 100644
--- a/src/lib/http/conn.go
+++ b/src/lib/http/conn.go
@@ -12,7 +12,7 @@ import (
)
// Active HTTP connection (server side).
-export type Conn struct {
+type Conn struct {
rwc io.ReadWriteClose;
br *bufio.BufRead;
bw *bufio.BufWrite;
@@ -21,7 +21,7 @@ export type Conn struct {
}
// Create new connection from rwc.
-export func NewConn(rwc io.ReadWriteClose) (c *Conn, err *os.Error) {
+func NewConn(rwc io.ReadWriteClose) (c *Conn, err *os.Error) {
c = new(Conn);
c.rwc = rwc;
if c.br, err = bufio.NewBufRead(rwc); err != nil {
diff --git a/src/lib/http/request.go b/src/lib/http/request.go
index 1335c48b4..ba1a7a694 100644
--- a/src/lib/http/request.go
+++ b/src/lib/http/request.go
@@ -19,7 +19,7 @@ const (
_MaxHeaderLines = 1024;
)
-export var (
+var (
LineTooLong = os.NewError("http header line too long");
ValueTooLong = os.NewError("http header value too long");
HeaderTooLong = os.NewError("http header too long");
@@ -29,7 +29,7 @@ export var (
)
// HTTP Request
-export type Request struct {
+type Request struct {
method string; // GET, PUT,etc.
rawurl string;
url *URL; // URI after GET, PUT etc.
@@ -180,7 +180,7 @@ func parseHTTPVersion(vers string) (int, int, bool) {
}
// Read and parse a request from b.
-export func ReadRequest(b *bufio.BufRead) (req *Request, err *os.Error) {
+func ReadRequest(b *bufio.BufRead) (req *Request, err *os.Error) {
req = new(Request);
// First line: GET /index.html HTTP/1.0
diff --git a/src/lib/http/server.go b/src/lib/http/server.go
index 20bfef43b..13648ad58 100644
--- a/src/lib/http/server.go
+++ b/src/lib/http/server.go
@@ -36,7 +36,7 @@ func serveConnection(fd net.Conn, raddr string, f *(*Conn, *Request)) {
}
// Web server: already listening on l, call f for each request.
-export func Serve(l net.Listener, f *(*Conn, *Request)) *os.Error {
+func Serve(l net.Listener, f *(*Conn, *Request)) *os.Error {
// TODO: Make this unnecessary
s, e := os.Getenv("GOMAXPROCS");
if n, ok := strconv.Atoi(s); n < 3 {
@@ -54,7 +54,7 @@ export func Serve(l net.Listener, f *(*Conn, *Request)) *os.Error {
}
// Web server: listen on address, call f for each request.
-export func ListenAndServe(addr string, f *(*Conn, *Request)) *os.Error {
+func ListenAndServe(addr string, f *(*Conn, *Request)) *os.Error {
l, e := net.Listen("tcp", addr);
if e != nil {
return e
diff --git a/src/lib/http/url.go b/src/lib/http/url.go
index 865b7864a..9c1a94e2b 100644
--- a/src/lib/http/url.go
+++ b/src/lib/http/url.go
@@ -12,7 +12,7 @@ import (
"strings"
)
-export var (
+var (
BadURL = os.NewError("bad url syntax")
)
@@ -41,7 +41,7 @@ func unhex(c byte) byte {
}
// Unescape %xx into hex.
-export func URLUnescape(s string) (string, *os.Error) {
+func URLUnescape(s string) (string, *os.Error) {
// Count %, check that they're well-formed.
n := 0;
for i := 0; i < len(s); {
@@ -76,7 +76,7 @@ export func URLUnescape(s string) (string, *os.Error) {
return string(t), nil;
}
-export type URL struct {
+type URL struct {
raw string;
scheme string;
rawpath string;
@@ -127,7 +127,7 @@ func split(s string, c byte, cutc bool) (string, string) {
}
// Parse rawurl into a URL structure.
-export func ParseURL(rawurl string) (url *URL, err *os.Error) {
+func ParseURL(rawurl string) (url *URL, err *os.Error) {
if rawurl == "" {
return nil, BadURL
}
@@ -172,7 +172,7 @@ export func ParseURL(rawurl string) (url *URL, err *os.Error) {
}
// A URL reference is a URL with #frag potentially added. Parse it.
-export func ParseURLReference(rawurlref string) (url *URL, err *os.Error) {
+func ParseURLReference(rawurlref string) (url *URL, err *os.Error) {
// Cut off #frag.
rawurl, frag := split(rawurlref, '#', true);
if url, err = ParseURL(rawurl); err != nil {
diff --git a/src/lib/io/bytebuffer.go b/src/lib/io/bytebuffer.go
index 5faeff9eb..fa11b37ee 100644
--- a/src/lib/io/bytebuffer.go
+++ b/src/lib/io/bytebuffer.go
@@ -24,7 +24,7 @@ func bytecopy(dst []byte, doff int, src []byte, soff int, count int) {
}
}
-export type ByteBuffer struct {
+type ByteBuffer struct {
buf []byte;
off int; // Read from here
len int; // Write to here
@@ -87,8 +87,7 @@ func (b *ByteBuffer) AllData() []byte {
return b.buf[0:b.len]
}
-
-export func NewByteBufferFromArray(buf []byte) *ByteBuffer {
+func NewByteBufferFromArray(buf []byte) *ByteBuffer {
b := new(ByteBuffer);
b.buf = buf;
b.off = 0;
diff --git a/src/lib/io/io.go b/src/lib/io/io.go
index 7c57f842f..cbacbe095 100644
--- a/src/lib/io/io.go
+++ b/src/lib/io/io.go
@@ -9,28 +9,28 @@ import (
"syscall";
)
-export var ErrEOF = os.NewError("EOF")
+var ErrEOF = os.NewError("EOF")
-export type Read interface {
+type Read interface {
Read(p []byte) (n int, err *os.Error);
}
-export type Write interface {
+type Write interface {
Write(p []byte) (n int, err *os.Error);
}
-export type ReadWrite interface {
+type ReadWrite interface {
Read(p []byte) (n int, err *os.Error);
Write(p []byte) (n int, err *os.Error);
}
-export type ReadWriteClose interface {
+type ReadWriteClose interface {
Read(p []byte) (n int, err *os.Error);
Write(p []byte) (n int, err *os.Error);
Close() *os.Error;
}
-export func WriteString(w Write, s string) (n int, err *os.Error) {
+func WriteString(w Write, s string) (n int, err *os.Error) {
b := make([]byte, len(s)+1);
if !syscall.StringToBytes(b, s) {
return -1, os.EINVAL
@@ -41,7 +41,7 @@ export func WriteString(w Write, s string) (n int, err *os.Error) {
}
// Read until buffer is full, EOF, or error
-export func Readn(fd Read, buf []byte) (n int, err *os.Error) {
+func Readn(fd Read, buf []byte) (n int, err *os.Error) {
n = 0;
for n < len(buf) {
nn, e := fd.Read(buf[n:len(buf)]);
@@ -69,7 +69,7 @@ func (fd *_FullRead) Read(p []byte) (n int, err *os.Error) {
return n, err
}
-export func Make_FullReader(fd Read) Read {
+func Make_FullReader(fd Read) Read {
if fr, ok := fd.(*_FullRead); ok {
// already a _FullRead
return fd
@@ -79,7 +79,7 @@ export func Make_FullReader(fd Read) Read {
// Copies n bytes (or until EOF is reached) from src to dst.
// Returns the number of bytes copied and the error, if any.
-export func Copyn(src Read, dst Write, n int64) (written int64, err *os.Error) {
+func Copyn(src Read, dst Write, n int64) (written int64, err *os.Error) {
buf := make([]byte, 32*1024);
for written < n {
l := len(buf);
@@ -115,7 +115,7 @@ export func Copyn(src Read, dst Write, n int64) (written int64, err *os.Error) {
// Copies from src to dst until EOF is reached.
// Returns the number of bytes copied and the error, if any.
-export func Copy(src Read, dst Write) (written int64, err *os.Error) {
+func Copy(src Read, dst Write) (written int64, err *os.Error) {
buf := make([]byte, 32*1024);
for {
nr, er := src.Read(buf);
@@ -147,7 +147,7 @@ export func Copy(src Read, dst Write) (written int64, err *os.Error) {
// Convert a string to an array of bytes for easy marshaling.
// Could fill with syscall.StringToBytes but it adds an unnecessary \000
// so the length would be wrong.
-export func StringBytes(s string) []byte {
+func StringBytes(s string) []byte {
b := make([]byte, len(s));
for i := 0; i < len(s); i++ {
b[i] = s[i];
diff --git a/src/lib/json/generic.go b/src/lib/json/generic.go
index 5333c8320..b57fcb12e 100644
--- a/src/lib/json/generic.go
+++ b/src/lib/json/generic.go
@@ -15,7 +15,7 @@ import (
"strings";
)
-export const (
+const (
StringKind = iota;
NumberKind;
MapKind; // JSON term is "Object", but in Go, it's a map
@@ -24,7 +24,7 @@ export const (
NullKind;
)
-export type Json interface {
+type Json interface {
Kind() int;
String() string;
Number() float64;
@@ -34,7 +34,7 @@ export type Json interface {
Len() int;
}
-export func JsonToString(j Json) string {
+func JsonToString(j Json) string {
if j == nil {
return "null"
}
@@ -45,7 +45,7 @@ export func JsonToString(j Json) string {
}
type _Null struct { }
-export var Null Json = &_Null{}
+var Null Json = &_Null{}
func (*_Null) Kind() int { return NullKind }
func (*_Null) String() string { return "null" }
func (*_Null) Number() float64 { return 0 }
@@ -128,7 +128,7 @@ func (j *_Map) String() string {
return s;
}
-export func Walk(j Json, path string) Json {
+func Walk(j Json, path string) Json {
for len(path) > 0 {
var elem string;
if i := strings.Index(path, "/"); i >= 0 {
@@ -154,7 +154,7 @@ export func Walk(j Json, path string) Json {
return j
}
-export func Equal(a, b Json) bool {
+func Equal(a, b Json) bool {
switch {
case a == nil && b == nil:
return true;
@@ -290,7 +290,7 @@ func (b *_JsonBuilder) Key(k string) Builder {
return bb
}
-export func StringToJson(s string) (json Json, ok bool, errtok string) {
+func StringToJson(s string) (json Json, ok bool, errtok string) {
var errindx int;
var j Json;
b := new(_JsonBuilder);
diff --git a/src/lib/json/generic_test.go b/src/lib/json/generic_test.go
index 41685b405..ab3e24fb8 100644
--- a/src/lib/json/generic_test.go
+++ b/src/lib/json/generic_test.go
@@ -24,7 +24,7 @@ var jsontests = []string {
`{"a":1}`,
}
-export func TestJson(t *testing.T) {
+func TestJson(t *testing.T) {
for i := 0; i < len(jsontests); i++ {
val, ok, errtok := StringToJson(jsontests[i]);
if !ok {
@@ -39,7 +39,7 @@ export func TestJson(t *testing.T) {
}
}
-export func TestJsonMap(t *testing.T) {
+func TestJsonMap(t *testing.T) {
values := make(map[string]Json);
mapstr := "{";
for i := 0; i < len(jsontests); i++ {
diff --git a/src/lib/json/parse.go b/src/lib/json/parse.go
index e712655ad..13d345e5e 100644
--- a/src/lib/json/parse.go
+++ b/src/lib/json/parse.go
@@ -44,7 +44,7 @@ func _UnHex(p string, r, l int) (v int, ok bool) {
return v, true;
}
-export func Unquote(s string) (t string, ok bool) {
+func Unquote(s string) (t string, ok bool) {
if len(s) < 2 || s[0] != '"' || s[len(s)-1] != '"' {
return
}
@@ -117,7 +117,7 @@ export func Unquote(s string) (t string, ok bool) {
return string(b[0:w]), true
}
-export func Quote(s string) string {
+func Quote(s string) string {
chr := make([]byte, utf8.UTFMax);
chr0 := chr[0:1];
b := new(io.ByteBuffer);
@@ -272,7 +272,7 @@ func (t *_Lexer) Next() {
type _Value interface {}
-export type Builder interface {
+type Builder interface {
// Set value
Int64(i int64);
Uint64(i uint64);
@@ -386,7 +386,7 @@ Switch:
return ok;
}
-export func Parse(s string, build Builder) (ok bool, errindx int, errtok string) {
+func Parse(s string, build Builder) (ok bool, errindx int, errtok string) {
lex := new(_Lexer);
lex.s = s;
lex.Next();
diff --git a/src/lib/json/struct.go b/src/lib/json/struct.go
index 97a2ad18a..167fcbff0 100644
--- a/src/lib/json/struct.go
+++ b/src/lib/json/struct.go
@@ -202,7 +202,7 @@ func (b *_StructBuilder) Key(k string) Builder {
return nobuilder
}
-export func Unmarshal(s string, val interface{}) (ok bool, errtok string) {
+func Unmarshal(s string, val interface{}) (ok bool, errtok string) {
var errindx int;
var val1 interface{};
b := &_StructBuilder{ reflect.NewValue(val) };
diff --git a/src/lib/json/struct_test.go b/src/lib/json/struct_test.go
index d0c15c297..88d9e9ec4 100644
--- a/src/lib/json/struct_test.go
+++ b/src/lib/json/struct_test.go
@@ -46,7 +46,7 @@ func _Check(t *testing.T, ok bool, name string, v interface{}) {
}
}
-export func TestUnmarshal(t *testing.T) {
+func TestUnmarshal(t *testing.T) {
var m _MyStruct;
m.f = true;
ok, errtok := Unmarshal(_Encoded, &m);
diff --git a/src/lib/malloc.go b/src/lib/malloc.go
index 3d3f420d0..e3896e94f 100644
--- a/src/lib/malloc.go
+++ b/src/lib/malloc.go
@@ -8,12 +8,12 @@
package malloc
-export type Stats struct {
+type Stats struct {
Alloc uint64;
Sys uint64;
};
-export func Alloc(uint64) *byte;
-export func Free(*byte);
-export func GetStats() *Stats;
-export func Lookup(*byte) (*byte, uintptr);
+func Alloc(uint64) *byte;
+func Free(*byte);
+func GetStats() *Stats;
+func Lookup(*byte) (*byte, uintptr);
diff --git a/src/lib/math/all_test.go b/src/lib/math/all_test.go
index fa0cc7c86..c5d5c01c4 100644
--- a/src/lib/math/all_test.go
+++ b/src/lib/math/all_test.go
@@ -175,7 +175,7 @@ func veryclose(a,b float64) bool {
return tolerance(a, b, 4e-16);
}
-export func TestAsin(t *testing.T) {
+func TestAsin(t *testing.T) {
for i := 0; i < len(vf); i++ {
if f := math.Asin(vf[i]/10); !veryclose(asin[i], f) {
t.Errorf("math.Asin(%g) = %g, want %g\n", vf[i]/10, f, asin[i]);
@@ -183,7 +183,7 @@ export func TestAsin(t *testing.T) {
}
}
-export func TestAtan(t *testing.T) {
+func TestAtan(t *testing.T) {
for i := 0; i < len(vf); i++ {
if f := math.Atan(vf[i]); !veryclose(atan[i], f) {
t.Errorf("math.Atan(%g) = %g, want %g\n", vf[i], f, atan[i]);
@@ -191,7 +191,7 @@ export func TestAtan(t *testing.T) {
}
}
-export func TestExp(t *testing.T) {
+func TestExp(t *testing.T) {
for i := 0; i < len(vf); i++ {
if f := math.Exp(vf[i]); !veryclose(exp[i], f) {
t.Errorf("math.Exp(%g) = %g, want %g\n", vf[i], f, exp[i]);
@@ -199,7 +199,7 @@ export func TestExp(t *testing.T) {
}
}
-export func TestFloor(t *testing.T) {
+func TestFloor(t *testing.T) {
for i := 0; i < len(vf); i++ {
if f := math.Floor(vf[i]); floor[i] != f {
t.Errorf("math.Floor(%g) = %g, want %g\n", vf[i], f, floor[i]);
@@ -207,7 +207,7 @@ export func TestFloor(t *testing.T) {
}
}
-export func TestLog(t *testing.T) {
+func TestLog(t *testing.T) {
for i := 0; i < len(vf); i++ {
a := math.Fabs(vf[i]);
if f := math.Log(a); log[i] != f {
@@ -219,7 +219,7 @@ export func TestLog(t *testing.T) {
}
}
-export func TestPow(t *testing.T) {
+func TestPow(t *testing.T) {
for i := 0; i < len(vf); i++ {
if f := math.Pow(10, vf[i]); !close(pow[i], f) {
t.Errorf("math.Pow(10, %.17g) = %.17g, want %.17g\n", vf[i], f, pow[i]);
@@ -227,7 +227,7 @@ export func TestPow(t *testing.T) {
}
}
-export func TestSin(t *testing.T) {
+func TestSin(t *testing.T) {
for i := 0; i < len(vf); i++ {
if f := math.Sin(vf[i]); !close(sin[i], f) {
t.Errorf("math.Sin(%g) = %g, want %g\n", vf[i], f, sin[i]);
@@ -235,7 +235,7 @@ export func TestSin(t *testing.T) {
}
}
-export func TestSinh(t *testing.T) {
+func TestSinh(t *testing.T) {
for i := 0; i < len(vf); i++ {
if f := math.Sinh(vf[i]); !veryclose(sinh[i], f) {
t.Errorf("math.Sinh(%g) = %g, want %g\n", vf[i], f, sinh[i]);
@@ -243,7 +243,7 @@ export func TestSinh(t *testing.T) {
}
}
-export func TestSqrt(t *testing.T) {
+func TestSqrt(t *testing.T) {
for i := 0; i < len(vf); i++ {
a := math.Fabs(vf[i]);
if f := math.Sqrt(a); !veryclose(sqrt[i], f) {
@@ -252,7 +252,7 @@ export func TestSqrt(t *testing.T) {
}
}
-export func TestTan(t *testing.T) {
+func TestTan(t *testing.T) {
for i := 0; i < len(vf); i++ {
if f := math.Tan(vf[i]); !close(tan[i], f) {
t.Errorf("math.Tan(%g) = %g, want %g\n", vf[i], f, tan[i]);
@@ -260,7 +260,7 @@ export func TestTan(t *testing.T) {
}
}
-export func TestTanh(t *testing.T) {
+func TestTanh(t *testing.T) {
for i := 0; i < len(vf); i++ {
if f := math.Tanh(vf[i]); !veryclose(tanh[i], f) {
t.Errorf("math.Tanh(%g) = %g, want %g\n", vf[i], f, tanh[i]);
@@ -268,7 +268,7 @@ export func TestTanh(t *testing.T) {
}
}
-export func TestHypot(t *testing.T) {
+func TestHypot(t *testing.T) {
for i := 0; i < len(vf); i++ {
a := math.Fabs(tanh[i]*math.Sqrt(2));
if f := math.Hypot(tanh[i], tanh[i]); !veryclose(a, f) {
diff --git a/src/lib/math/asin.go b/src/lib/math/asin.go
index e866d95c6..d39339ea1 100644
--- a/src/lib/math/asin.go
+++ b/src/lib/math/asin.go
@@ -13,7 +13,7 @@ import "math"
* Arctan is called after appropriate range reduction.
*/
-export func Asin(arg float64) float64 {
+func Asin(arg float64) float64 {
var temp, x float64;
var sign bool;
@@ -40,7 +40,7 @@ export func Asin(arg float64) float64 {
return temp;
}
-export func Acos(arg float64) float64 {
+func Acos(arg float64) float64 {
if arg > 1 || arg < -1 {
return sys.NaN();
}
diff --git a/src/lib/math/atan.go b/src/lib/math/atan.go
index 730d50a51..41c1705e0 100644
--- a/src/lib/math/atan.go
+++ b/src/lib/math/atan.go
@@ -57,7 +57,7 @@ func satan(arg float64) float64 {
* atan makes its argument positive and
* calls the inner routine satan.
*/
-export func Atan(arg float64) float64 {
+func Atan(arg float64) float64 {
if arg > 0 {
return satan(arg);
}
diff --git a/src/lib/math/atan2.go b/src/lib/math/atan2.go
index f8c00aa24..1dc5d325e 100644
--- a/src/lib/math/atan2.go
+++ b/src/lib/math/atan2.go
@@ -10,7 +10,7 @@ import "math"
* atan2 discovers what quadrant the angle
* is in and calls atan.
*/
-export func Atan2(arg1, arg2 float64) float64 {
+func Atan2(arg1, arg2 float64) float64 {
if arg1+arg2 == arg1 {
if arg1 >= 0 {
return Pi/2;
diff --git a/src/lib/math/const.go b/src/lib/math/const.go
index 927d6daf2..21822f90a 100644
--- a/src/lib/math/const.go
+++ b/src/lib/math/const.go
@@ -4,7 +4,7 @@
package math
-export const (
+const (
// Mathematical constants.
// Reference: http://www.research.att.com/~njas/sequences/Axxxxxx
diff --git a/src/lib/math/exp.go b/src/lib/math/exp.go
index b2697195e..0d06ff9cb 100644
--- a/src/lib/math/exp.go
+++ b/src/lib/math/exp.go
@@ -82,7 +82,7 @@ import "math"
// compiler will convert from decimal to binary accurately enough
// to produce the hexadecimal values shown.
-export func Exp(x float64) float64 {
+func Exp(x float64) float64 {
const (
Ln2Hi = 6.93147180369123816490e-01;
Ln2Lo = 1.90821492927058770002e-10;
diff --git a/src/lib/math/fabs.go b/src/lib/math/fabs.go
index 7117db0b7..dec9a7feb 100644
--- a/src/lib/math/fabs.go
+++ b/src/lib/math/fabs.go
@@ -4,7 +4,7 @@
package math
-export func Fabs(arg float64) float64 {
+func Fabs(arg float64) float64 {
if arg < 0 {
return -arg;
}
diff --git a/src/lib/math/floor.go b/src/lib/math/floor.go
index 14b390841..1cbdded47 100644
--- a/src/lib/math/floor.go
+++ b/src/lib/math/floor.go
@@ -9,7 +9,7 @@ package math
* (resp least >=)
*/
-export func Floor(arg float64) float64 {
+func Floor(arg float64) float64 {
if arg < 0 {
d, fract := sys.Modf(-arg);
if fract != 0.0 {
@@ -21,6 +21,6 @@ export func Floor(arg float64) float64 {
return d;
}
-export func Ceil(arg float64) float64 {
+func Ceil(arg float64) float64 {
return -Floor(-arg);
}
diff --git a/src/lib/math/fmod.go b/src/lib/math/fmod.go
index ae35e719f..f30ae3563 100644
--- a/src/lib/math/fmod.go
+++ b/src/lib/math/fmod.go
@@ -8,7 +8,7 @@ package math
* floating-point mod func without infinity or NaN checking
*/
-export func Fmod(x, y float64) float64 {
+func Fmod(x, y float64) float64 {
if y == 0 {
return x;
}
diff --git a/src/lib/math/hypot.go b/src/lib/math/hypot.go
index 6295c124a..c0ea5a1f7 100644
--- a/src/lib/math/hypot.go
+++ b/src/lib/math/hypot.go
@@ -12,7 +12,7 @@ package math
* Vol. 27, Number 6, pp. 577-581, Nov. 1983
*/
-export func Hypot(p, q float64) float64 {
+func Hypot(p, q float64) float64 {
if p < 0 {
p = -p;
}
diff --git a/src/lib/math/log.go b/src/lib/math/log.go
index 259ecd202..76b5231e5 100644
--- a/src/lib/math/log.go
+++ b/src/lib/math/log.go
@@ -70,7 +70,7 @@ import "math"
// compiler will convert from decimal to binary accurately enough
// to produce the hexadecimal values shown.
-export func Log(x float64) float64 {
+func Log(x float64) float64 {
const (
Ln2Hi = 6.93147180369123816490e-01; /* 3fe62e42 fee00000 */
Ln2Lo = 1.90821492927058770002e-10; /* 3dea39ef 35793c76 */
@@ -113,7 +113,7 @@ export func Log(x float64) float64 {
return k*Ln2Hi - ((hfsq-(s*(hfsq+R)+k*Ln2Lo)) - f);
}
-export func Log10(arg float64) float64 {
+func Log10(arg float64) float64 {
if arg <= 0 {
return sys.NaN();
}
diff --git a/src/lib/math/pow.go b/src/lib/math/pow.go
index b5c67d88c..3ab218d5e 100644
--- a/src/lib/math/pow.go
+++ b/src/lib/math/pow.go
@@ -7,7 +7,7 @@ package math
import "math"
// x^y: exponentiation
-export func Pow(x, y float64) float64 {
+func Pow(x, y float64) float64 {
// TODO: x or y NaN, ±Inf, maybe ±0.
switch {
case y == 0:
diff --git a/src/lib/math/pow10.go b/src/lib/math/pow10.go
index 1d0a0e0cc..30e5a6ee5 100644
--- a/src/lib/math/pow10.go
+++ b/src/lib/math/pow10.go
@@ -15,7 +15,7 @@ package math
var pow10tab [70]float64;
-export func Pow10(e int) float64 {
+func Pow10(e int) float64 {
if e < 0 {
return 1/Pow10(-e);
}
diff --git a/src/lib/math/sin.go b/src/lib/math/sin.go
index b6a074242..fc8a05d4b 100644
--- a/src/lib/math/sin.go
+++ b/src/lib/math/sin.go
@@ -52,13 +52,13 @@ func sinus(arg float64, quad int) float64 {
return temp1/temp2;
}
-export func Cos(arg float64) float64 {
+func Cos(arg float64) float64 {
if arg < 0 {
arg = -arg;
}
return sinus(arg, 1);
}
-export func Sin(arg float64) float64 {
+func Sin(arg float64) float64 {
return sinus(arg, 0);
}
diff --git a/src/lib/math/sinh.go b/src/lib/math/sinh.go
index e0201eef3..e79e8161b 100644
--- a/src/lib/math/sinh.go
+++ b/src/lib/math/sinh.go
@@ -19,7 +19,7 @@ import "math"
* all arguments.
*/
-export func Sinh(arg float64) float64 {
+func Sinh(arg float64) float64 {
// The coefficients are #2029 from Hart & Cheney. (20.36D)
const
(
@@ -58,7 +58,7 @@ export func Sinh(arg float64) float64 {
return temp;
}
-export func Cosh(arg float64) float64 {
+func Cosh(arg float64) float64 {
if arg < 0 {
arg = - arg;
}
diff --git a/src/lib/math/sqrt.go b/src/lib/math/sqrt.go
index 698639781..cf256b25c 100644
--- a/src/lib/math/sqrt.go
+++ b/src/lib/math/sqrt.go
@@ -11,7 +11,7 @@ package math
* calls frexp
*/
-export func Sqrt(arg float64) float64 {
+func Sqrt(arg float64) float64 {
if sys.IsInf(arg, 1) {
return arg;
}
diff --git a/src/lib/math/tan.go b/src/lib/math/tan.go
index bae194bcb..4910fa3a4 100644
--- a/src/lib/math/tan.go
+++ b/src/lib/math/tan.go
@@ -10,7 +10,7 @@ import "math"
* floating point tangent
*/
-export func Tan(arg float64) float64 {
+func Tan(arg float64) float64 {
// Coefficients are #4285 from Hart & Cheney. (19.74D)
const
(
diff --git a/src/lib/math/tanh.go b/src/lib/math/tanh.go
index 45f7723ee..2e9d74ee4 100644
--- a/src/lib/math/tanh.go
+++ b/src/lib/math/tanh.go
@@ -14,7 +14,7 @@ import "math"
* would cause overflow improperly.
*/
-export func Tanh(arg float64) float64 {
+func Tanh(arg float64) float64 {
if arg < 0 {
arg = -arg;
if arg > 21 {
diff --git a/src/lib/net/dialgoogle_test.go b/src/lib/net/dialgoogle_test.go
index c323e1e30..de7158a7b 100644
--- a/src/lib/net/dialgoogle_test.go
+++ b/src/lib/net/dialgoogle_test.go
@@ -64,7 +64,7 @@ var googleaddrs = []string {
"[2001:4860:0:2001::68]:80" // ipv6.google.com; removed if ipv6 flag not set
}
-export func TestDialGoogle(t *testing.T) {
+func TestDialGoogle(t *testing.T) {
// If no ipv6 tunnel, don't try the last address.
if !*ipv6 {
googleaddrs[len(googleaddrs)-1] = ""
diff --git a/src/lib/net/dnsclient.go b/src/lib/net/dnsclient.go
index 67af9b752..5c26d51c5 100644
--- a/src/lib/net/dnsclient.go
+++ b/src/lib/net/dnsclient.go
@@ -25,7 +25,7 @@ import (
"strings";
)
-export var (
+var (
DNS_InternalError = os.NewError("internal dns error");
DNS_MissingConfig = os.NewError("no dns configuration");
DNS_No_Answer = os.NewError("dns got no answer");
@@ -171,7 +171,7 @@ func _LoadConfig() {
cfg = DNS_ReadConfig();
}
-export func LookupHost(name string) (name1 string, addrs []string, err *os.Error) {
+func LookupHost(name string) (name1 string, addrs []string, err *os.Error) {
// TODO(rsc): Pick out obvious non-DNS names to avoid
// sending stupid requests to the server?
diff --git a/src/lib/net/dnsconfig.go b/src/lib/net/dnsconfig.go
index 3de9e2494..e57ce59c6 100644
--- a/src/lib/net/dnsconfig.go
+++ b/src/lib/net/dnsconfig.go
@@ -13,7 +13,7 @@ import (
"strconv";
)
-export type DNS_Config struct {
+type DNS_Config struct {
servers []string; // servers to use
search []string; // suffixes to append to local name
ndots int; // number of dots in name to trigger absolute lookup
@@ -26,7 +26,7 @@ export type DNS_Config struct {
// TODO(rsc): Supposed to call uname() and chop the beginning
// of the host name to get the default search domain.
// We assume it's in resolv.conf anyway.
-export func DNS_ReadConfig() *DNS_Config {
+func DNS_ReadConfig() *DNS_Config {
file := _Open("/etc/resolv.conf");
if file == nil {
return nil
diff --git a/src/lib/net/dnsmsg.go b/src/lib/net/dnsmsg.go
index 159ea7bb2..2cd8b2ffb 100644
--- a/src/lib/net/dnsmsg.go
+++ b/src/lib/net/dnsmsg.go
@@ -32,7 +32,7 @@ import (
// _Packet formats
// Wire constants.
-export const (
+const (
// valid DNS_RR_Header.rrtype and DNS_Question.qtype
DNS_TypeA = 1;
DNS_TypeNS = 2;
@@ -90,7 +90,7 @@ const (
)
// DNS queries.
-export type DNS_Question struct {
+type DNS_Question struct {
name string "domain-name"; // "domain-name" specifies encoding; see packers below
qtype uint16;
qclass uint16;
@@ -99,7 +99,7 @@ export type DNS_Question struct {
// DNS responses (resource records).
// There are many types of messages,
// but they all share the same header.
-export type DNS_RR_Header struct {
+type DNS_RR_Header struct {
name string "domain-name";
rrtype uint16;
class uint16;
@@ -111,62 +111,62 @@ func (h *DNS_RR_Header) Header() *DNS_RR_Header {
return h
}
-export type DNS_RR interface {
+type DNS_RR interface {
Header() *DNS_RR_Header
}
// Specific DNS RR formats for each query type.
-export type DNS_RR_CNAME struct {
+type DNS_RR_CNAME struct {
DNS_RR_Header;
cname string "domain-name";
}
-export type DNS_RR_HINFO struct {
+type DNS_RR_HINFO struct {
DNS_RR_Header;
cpu string;
os string;
}
-export type DNS_RR_MB struct {
+type DNS_RR_MB struct {
DNS_RR_Header;
mb string "domain-name";
}
-export type DNS_RR_MG struct {
+type DNS_RR_MG struct {
DNS_RR_Header;
mg string "domain-name";
}
-export type DNS_RR_MINFO struct {
+type DNS_RR_MINFO struct {
DNS_RR_Header;
rmail string "domain-name";
email string "domain-name";
}
-export type DNS_RR_MR struct {
+type DNS_RR_MR struct {
DNS_RR_Header;
mr string "domain-name";
}
-export type DNS_RR_MX struct {
+type DNS_RR_MX struct {
DNS_RR_Header;
pref uint16;
mx string "domain-name";
}
-export type DNS_RR_NS struct {
+type DNS_RR_NS struct {
DNS_RR_Header;
ns string "domain-name";
}
-export type DNS_RR_PTR struct {
+type DNS_RR_PTR struct {
DNS_RR_Header;
ptr string "domain-name";
}
-export type DNS_RR_SOA struct {
+type DNS_RR_SOA struct {
DNS_RR_Header;
ns string "domain-name";
mbox string "domain-name";
@@ -177,12 +177,12 @@ export type DNS_RR_SOA struct {
minttl uint32;
}
-export type DNS_RR_TXT struct {
+type DNS_RR_TXT struct {
DNS_RR_Header;
txt string; // not domain name
}
-export type DNS_RR_A struct {
+type DNS_RR_A struct {
DNS_RR_Header;
a uint32 "ipv4";
}
@@ -537,7 +537,7 @@ type _DNS_Msg_Top struct {
rcode int;
}
-export type DNS_Msg struct {
+type DNS_Msg struct {
_DNS_Msg_Top;
question []DNS_Question;
answer []DNS_RR;
diff --git a/src/lib/net/fd.go b/src/lib/net/fd.go
index b93f04189..ce18ccabb 100644
--- a/src/lib/net/fd.go
+++ b/src/lib/net/fd.go
@@ -15,7 +15,7 @@ import (
// Network file descriptor. Only intended to be used internally,
// but have to export to make it available in other files implementing package net.
-export type FD struct {
+type FD struct {
// immutable until Close
fd int64;
osfd *os.FD;
@@ -207,7 +207,7 @@ func _StartServer() {
pollserver = p
}
-export func NewFD(fd int64) (f *FD, err *os.Error) {
+func NewFD(fd int64) (f *FD, err *os.Error) {
if pollserver == nil {
once.Do(&_StartServer);
}
diff --git a/src/lib/net/fd_darwin.go b/src/lib/net/fd_darwin.go
index 34fd90f0a..342f9c9d9 100644
--- a/src/lib/net/fd_darwin.go
+++ b/src/lib/net/fd_darwin.go
@@ -12,13 +12,13 @@ import (
"syscall";
)
-export type Pollster struct {
+type Pollster struct {
kq int64;
eventbuf [10]syscall.Kevent_t;
events []syscall.Kevent_t;
}
-export func NewPollster() (p *Pollster, err *os.Error) {
+func NewPollster() (p *Pollster, err *os.Error) {
p = new(Pollster);
var e int64;
if p.kq, e = syscall.Kqueue(); e != 0 {
diff --git a/src/lib/net/fd_linux.go b/src/lib/net/fd_linux.go
index 5060e99cb..cef0edabc 100644
--- a/src/lib/net/fd_linux.go
+++ b/src/lib/net/fd_linux.go
@@ -17,14 +17,14 @@ const (
writeFlags = syscall.EPOLLOUT
)
-export type Pollster struct {
+type Pollster struct {
epfd int64;
// Events we're already waiting for
events map[int64] uint32;
}
-export func NewPollster() (p *Pollster, err *os.Error) {
+func NewPollster() (p *Pollster, err *os.Error) {
p = new(Pollster);
var e int64;
diff --git a/src/lib/net/ip.go b/src/lib/net/ip.go
index 15d09a3d3..89bbeba94 100644
--- a/src/lib/net/ip.go
+++ b/src/lib/net/ip.go
@@ -16,7 +16,7 @@ import (
"net"
)
-export const (
+const (
IPv4len = 4;
IPv6len = 16
)
@@ -37,7 +37,7 @@ func _MakeIPv4(a, b, c, d byte) []byte {
}
// Well-known IP addresses
-export var IPv4bcast, IPv4allsys, IPv4allrouter, IPv4prefix, IPallbits, IPnoaddr []byte
+var IPv4bcast, IPv4allsys, IPv4allrouter, IPv4prefix, IPallbits, IPnoaddr []byte
func init() {
IPv4bcast = _MakeIPv4(0xff, 0xff, 0xff, 0xff);
@@ -63,7 +63,7 @@ func _IsZeros(p []byte) bool {
// Is p an IPv4 address (perhaps in IPv6 form)?
// If so, return the 4-byte V4 array.
-export func ToIPv4(p []byte) []byte {
+func ToIPv4(p []byte) []byte {
if len(p) == IPv4len {
return p
}
@@ -77,7 +77,7 @@ export func ToIPv4(p []byte) []byte {
}
// Convert p to IPv6 form.
-export func ToIPv6(p []byte) []byte {
+func ToIPv6(p []byte) []byte {
if len(p) == IPv4len {
return _MakeIPv4(p[0], p[1], p[2], p[3])
}
@@ -88,13 +88,13 @@ export func ToIPv6(p []byte) []byte {
}
// Default route masks for IPv4.
-export var (
+var (
ClassAMask = _MakeIPv4(0xff, 0, 0, 0);
ClassBMask = _MakeIPv4(0xff, 0xff, 0, 0);
ClassCMask = _MakeIPv4(0xff, 0xff, 0xff, 0);
)
-export func DefaultMask(p []byte) []byte {
+func DefaultMask(p []byte) []byte {
if p = ToIPv4(p); p == nil {
return nil
}
@@ -110,7 +110,7 @@ export func DefaultMask(p []byte) []byte {
}
// Apply mask to ip, returning new address.
-export func Mask(ip []byte, mask []byte) []byte {
+func Mask(ip []byte, mask []byte) []byte {
n := len(ip);
if n != len(mask) {
return nil
@@ -159,7 +159,7 @@ func itox(i uint) string {
}
// Convert IP address to string.
-export func IPToString(p []byte) string {
+func IPToString(p []byte) string {
// If IPv4, use dotted notation.
if p4 := ToIPv4(p); len(p4) == 4 {
return itod(uint(p4[0]))+"."
@@ -228,7 +228,7 @@ func _SimpleMaskLength(mask []byte) int {
return n
}
-export func MaskToString(mask []byte) string {
+func MaskToString(mask []byte) string {
switch len(mask) {
case 4:
n := _SimpleMaskLength(mask);
@@ -377,7 +377,7 @@ L: for j < IPv6len {
return p
}
-export func ParseIP(s string) []byte {
+func ParseIP(s string) []byte {
p := _ParseIPv4(s);
if p != nil {
return p
diff --git a/src/lib/net/ip_test.go b/src/lib/net/ip_test.go
index a6b6c6f2d..9788db243 100644
--- a/src/lib/net/ip_test.go
+++ b/src/lib/net/ip_test.go
@@ -43,7 +43,7 @@ var parseiptests = []parseIPTest {
parseIPTest{"::ffff:4a7d:1363", _IPv4(74, 125, 19, 99)},
}
-export func TestParseIP(t *testing.T) {
+func TestParseIP(t *testing.T) {
for i := 0; i < len(parseiptests); i++ {
tt := parseiptests[i];
if out := ParseIP(tt.in); !isEqual(out, tt.out) {
diff --git a/src/lib/net/net.go b/src/lib/net/net.go
index 240d5dc58..44172047b 100644
--- a/src/lib/net/net.go
+++ b/src/lib/net/net.go
@@ -11,7 +11,7 @@ import (
"syscall";
)
-export var (
+var (
BadAddress = os.NewError("malformed address");
MissingAddress = os.NewError("missing address");
UnknownNetwork = os.NewError("unknown network");
@@ -21,7 +21,7 @@ export var (
Unknown_SocketFamily = os.NewError("unknown socket family");
)
-export func LookupHost(name string) (name1 string, addrs []string, err *os.Error)
+func LookupHost(name string) (name1 string, addrs []string, err *os.Error)
// Split "host:port" into "host" and "port".
// Host cannot contain colons unless it is bracketed.
@@ -358,7 +358,7 @@ func _InternetSocket(net, laddr, raddr string, proto int64, mode string) (fd *FD
// TCP connections.
-export type ConnTCP struct {
+type ConnTCP struct {
_ConnBase
}
@@ -377,7 +377,7 @@ func _NewConnTCP(fd *FD, raddr string) *ConnTCP {
return c
}
-export func DialTCP(net, laddr, raddr string) (c *ConnTCP, err *os.Error) {
+func DialTCP(net, laddr, raddr string) (c *ConnTCP, err *os.Error) {
if raddr == "" {
return nil, MissingAddress
}
@@ -393,7 +393,7 @@ export func DialTCP(net, laddr, raddr string) (c *ConnTCP, err *os.Error) {
// TODO(rsc): UDP headers mode
-export type ConnUDP struct {
+type ConnUDP struct {
_ConnBase
}
@@ -404,7 +404,7 @@ func _NewConnUDP(fd *FD, raddr string) *ConnUDP {
return c
}
-export func DialUDP(net, laddr, raddr string) (c *ConnUDP, err *os.Error) {
+func DialUDP(net, laddr, raddr string) (c *ConnUDP, err *os.Error) {
if raddr == "" {
return nil, MissingAddress
}
@@ -422,7 +422,7 @@ export func DialUDP(net, laddr, raddr string) (c *ConnUDP, err *os.Error) {
// TODO: raw ethernet connections
-export type Conn interface {
+type Conn interface {
Read(b []byte) (n int, err *os.Error);
Write(b []byte) (n int, err *os.Error);
ReadFrom(b []byte) (n int, addr string, err *os.Error);
@@ -450,7 +450,7 @@ export type Conn interface {
// Eventually, we plan to allow names in addition to IP addresses,
// but that requires writing a DNS library.
-export func Dial(net, laddr, raddr string) (c Conn, err *os.Error) {
+func Dial(net, laddr, raddr string) (c Conn, err *os.Error) {
switch net {
case "tcp", "tcp4", "tcp6":
c, err := DialTCP(net, laddr, raddr);
@@ -477,17 +477,17 @@ export func Dial(net, laddr, raddr string) (c Conn, err *os.Error) {
}
-export type Listener interface {
+type Listener interface {
Accept() (c Conn, raddr string, err *os.Error);
Close() *os.Error;
}
-export type ListenerTCP struct {
+type ListenerTCP struct {
fd *FD;
laddr string
}
-export func ListenTCP(net, laddr string) (l *ListenerTCP, err *os.Error) {
+func ListenTCP(net, laddr string) (l *ListenerTCP, err *os.Error) {
fd, e := _InternetSocket(net, laddr, "", syscall.SOCK_STREAM, "listen");
if e != nil {
return nil, e
@@ -534,7 +534,7 @@ func (l *ListenerTCP) Close() *os.Error {
return l.fd.Close()
}
-export func Listen(net, laddr string) (l Listener, err *os.Error) {
+func Listen(net, laddr string) (l Listener, err *os.Error) {
switch net {
case "tcp", "tcp4", "tcp6":
l, err := ListenTCP(net, laddr);
diff --git a/src/lib/net/net_darwin.go b/src/lib/net/net_darwin.go
index 062f5ea79..2d5d11ee9 100644
--- a/src/lib/net/net_darwin.go
+++ b/src/lib/net/net_darwin.go
@@ -11,7 +11,7 @@ import (
"unsafe";
)
-export func IPv4ToSockaddr(p []byte, port int) (sa1 *syscall.Sockaddr, err *os.Error) {
+func IPv4ToSockaddr(p []byte, port int) (sa1 *syscall.Sockaddr, err *os.Error) {
p = ToIPv4(p);
if p == nil || port < 0 || port > 0xFFFF {
return nil, os.EINVAL
@@ -24,10 +24,10 @@ export func IPv4ToSockaddr(p []byte, port int) (sa1 *syscall.Sockaddr, err *os.E
for i := 0; i < IPv4len; i++ {
sa.Addr[i] = p[i]
}
- return unsafe.pointer(sa).(*syscall.Sockaddr), nil
+ return unsafe.Pointer(sa).(*syscall.Sockaddr), nil
}
-export func IPv6ToSockaddr(p []byte, port int) (sa1 *syscall.Sockaddr, err *os.Error) {
+func IPv6ToSockaddr(p []byte, port int) (sa1 *syscall.Sockaddr, err *os.Error) {
p = ToIPv6(p);
if p == nil || port < 0 || port > 0xFFFF {
return nil, os.EINVAL
@@ -40,21 +40,21 @@ export func IPv6ToSockaddr(p []byte, port int) (sa1 *syscall.Sockaddr, err *os.E
for i := 0; i < IPv6len; i++ {
sa.Addr[i] = p[i]
}
- return unsafe.pointer(sa).(*syscall.Sockaddr), nil
+ return unsafe.Pointer(sa).(*syscall.Sockaddr), nil
}
-export func SockaddrToIP(sa1 *syscall.Sockaddr) (p []byte, port int, err *os.Error) {
+func SockaddrToIP(sa1 *syscall.Sockaddr) (p []byte, port int, err *os.Error) {
switch sa1.Family {
case syscall.AF_INET:
- sa := unsafe.pointer(sa1).(*syscall.SockaddrInet4);
+ sa := unsafe.Pointer(sa1).(*syscall.SockaddrInet4);
a := ToIPv6(sa.Addr);
if a == nil {
return nil, 0, os.EINVAL
}
return a, int(sa.Port[0])<<8 + int(sa.Port[1]), nil;
case syscall.AF_INET6:
- sa := unsafe.pointer(sa1).(*syscall.SockaddrInet6);
+ sa := unsafe.Pointer(sa1).(*syscall.SockaddrInet6);
a := ToIPv6(sa.Addr);
if a == nil {
return nil, 0, os.EINVAL
@@ -66,7 +66,7 @@ export func SockaddrToIP(sa1 *syscall.Sockaddr) (p []byte, port int, err *os.Err
return nil, 0, nil // not reached
}
-export func ListenBacklog() int64 {
+func ListenBacklog() int64 {
return syscall.SOMAXCONN
}
diff --git a/src/lib/net/net_linux.go b/src/lib/net/net_linux.go
index c384711b1..7538f62bd 100644
--- a/src/lib/net/net_linux.go
+++ b/src/lib/net/net_linux.go
@@ -11,7 +11,7 @@ import (
"unsafe";
)
-export func IPv4ToSockaddr(p []byte, port int) (sa1 *syscall.Sockaddr, err *os.Error) {
+func IPv4ToSockaddr(p []byte, port int) (sa1 *syscall.Sockaddr, err *os.Error) {
p = ToIPv4(p);
if p == nil || port < 0 || port > 0xFFFF {
return nil, os.EINVAL
@@ -23,12 +23,12 @@ export func IPv4ToSockaddr(p []byte, port int) (sa1 *syscall.Sockaddr, err *os.E
for i := 0; i < IPv4len; i++ {
sa.Addr[i] = p[i]
}
- return unsafe.pointer(sa).(*syscall.Sockaddr), nil
+ return unsafe.Pointer(sa).(*syscall.Sockaddr), nil
}
var _IPv6zero [16]byte;
-export func IPv6ToSockaddr(p []byte, port int) (sa1 *syscall.Sockaddr, err *os.Error) {
+func IPv6ToSockaddr(p []byte, port int) (sa1 *syscall.Sockaddr, err *os.Error) {
p = ToIPv6(p);
if p == nil || port < 0 || port > 0xFFFF {
return nil, os.EINVAL
@@ -48,20 +48,20 @@ export func IPv6ToSockaddr(p []byte, port int) (sa1 *syscall.Sockaddr, err *os.E
for i := 0; i < IPv6len; i++ {
sa.Addr[i] = p[i]
}
- return unsafe.pointer(sa).(*syscall.Sockaddr), nil
+ return unsafe.Pointer(sa).(*syscall.Sockaddr), nil
}
-export func SockaddrToIP(sa1 *syscall.Sockaddr) (p []byte, port int, err *os.Error) {
+func SockaddrToIP(sa1 *syscall.Sockaddr) (p []byte, port int, err *os.Error) {
switch sa1.Family {
case syscall.AF_INET:
- sa := unsafe.pointer(sa1).(*syscall.SockaddrInet4);
+ sa := unsafe.Pointer(sa1).(*syscall.SockaddrInet4);
a := ToIPv6(sa.Addr);
if a == nil {
return nil, 0, os.EINVAL
}
return a, int(sa.Port[0])<<8 + int(sa.Port[1]), nil;
case syscall.AF_INET6:
- sa := unsafe.pointer(sa1).(*syscall.SockaddrInet6);
+ sa := unsafe.Pointer(sa1).(*syscall.SockaddrInet6);
a := ToIPv6(sa.Addr);
if a == nil {
return nil, 0, os.EINVAL
@@ -73,7 +73,7 @@ export func SockaddrToIP(sa1 *syscall.Sockaddr) (p []byte, port int, err *os.Err
return nil, 0, nil // not reached
}
-export func ListenBacklog() int64 {
+func ListenBacklog() int64 {
// TODO: Read the limit from /proc/sys/net/core/somaxconn,
// to take advantage of kernels that have raised the limit.
return syscall.SOMAXCONN
diff --git a/src/lib/net/parse_test.go b/src/lib/net/parse_test.go
index 874982617..633a45718 100644
--- a/src/lib/net/parse_test.go
+++ b/src/lib/net/parse_test.go
@@ -11,7 +11,7 @@ import (
"testing";
)
-export func TestReadLine(t *testing.T) {
+func TestReadLine(t *testing.T) {
filename := "/etc/services"; // a nice big file
fd, err := os.Open(filename, os.O_RDONLY, 0);
diff --git a/src/lib/net/port.go b/src/lib/net/port.go
index d8ac8c7e3..03c0ccee2 100644
--- a/src/lib/net/port.go
+++ b/src/lib/net/port.go
@@ -48,7 +48,7 @@ func _ReadServices() {
file.Close();
}
-export func LookupPort(netw, name string) (port int, ok bool) {
+func LookupPort(netw, name string) (port int, ok bool) {
once.Do(&_ReadServices);
switch netw {
diff --git a/src/lib/net/port_test.go b/src/lib/net/port_test.go
index 0bfff496d..f6123fd8d 100644
--- a/src/lib/net/port_test.go
+++ b/src/lib/net/port_test.go
@@ -48,7 +48,7 @@ var porttests = []portTest {
portTest{ "tcp", "--badport--", 0, false },
}
-export func TestLookupPort(t *testing.T) {
+func TestLookupPort(t *testing.T) {
for i := 0; i < len(porttests); i++ {
tt := porttests[i];
if port, ok := LookupPort(tt.netw, tt.name); port != tt.port || ok != tt.ok {
diff --git a/src/lib/net/tcpserver_test.go b/src/lib/net/tcpserver_test.go
index 400374732..820220b03 100644
--- a/src/lib/net/tcpserver_test.go
+++ b/src/lib/net/tcpserver_test.go
@@ -75,7 +75,7 @@ func doTest(t *testing.T, network, listenaddr, dialaddr string) {
<-done; // make sure server stopped
}
-export func TestTcpServer(t *testing.T) {
+func TestTcpServer(t *testing.T) {
doTest(t, "tcp", "0.0.0.0:9997", "127.0.0.1:9997");
doTest(t, "tcp", "[::]:9997", "[::ffff:127.0.0.1]:9997");
doTest(t, "tcp", "[::]:9997", "127.0.0.1:9997");
diff --git a/src/lib/once.go b/src/lib/once.go
index 901fa4872..6019df515 100644
--- a/src/lib/once.go
+++ b/src/lib/once.go
@@ -42,7 +42,7 @@ func server() {
}
}
-export func Do(f *()) {
+func Do(f *()) {
// Look for job in map (avoids channel communication).
// If not there, ask map server to make one.
// TODO: Uncomment use of jobmap[f] once
diff --git a/src/lib/once_test.go b/src/lib/once_test.go
index 865c661da..a19d34dca 100644
--- a/src/lib/once_test.go
+++ b/src/lib/once_test.go
@@ -14,7 +14,7 @@ func call() {
ncall++
}
-export func TestOnce(t *testing.T) {
+func TestOnce(t *testing.T) {
ncall = 0;
once.Do(&call);
if ncall != 1 {
diff --git a/src/lib/os/os_env.go b/src/lib/os/os_env.go
index 26cb11a47..dd4970dea 100644
--- a/src/lib/os/os_env.go
+++ b/src/lib/os/os_env.go
@@ -9,11 +9,11 @@ package os
import os "os"
-export var (
+var (
ENOENV = NewError("no such environment variable");
)
-export func Getenv(s string) (v string, err *Error) {
+func Getenv(s string) (v string, err *Error) {
n := len(s);
if n == 0 {
return "", EINVAL
diff --git a/src/lib/os/os_error.go b/src/lib/os/os_error.go
index f01b95db9..63b2dbcca 100644
--- a/src/lib/os/os_error.go
+++ b/src/lib/os/os_error.go
@@ -8,7 +8,7 @@ import syscall "syscall"
// Errors are singleton structures. Use the String() method to get their contents --
// it handles the nil (no error) case.
-export type Error struct {
+type Error struct {
s string
}
@@ -25,7 +25,7 @@ var errorStringTab = make(map[string] *Error);
// errors simultaneously but the consequences are unimportant.
// Allocate an Error object, but if it's been seen before, share that one.
-export func NewError(s string) *Error {
+func NewError(s string) *Error {
if s == "" {
return nil
}
@@ -39,7 +39,7 @@ export func NewError(s string) *Error {
}
// Allocate an Error objecct, but if it's been seen before, share that one.
-export func ErrnoToError(errno int64) *Error {
+func ErrnoToError(errno int64) *Error {
if errno == 0 {
return nil
}
@@ -53,7 +53,7 @@ export func ErrnoToError(errno int64) *Error {
return err;
}
-export var (
+var (
ENONE = ErrnoToError(syscall.ENONE);
EPERM = ErrnoToError(syscall.EPERM);
ENOENT = ErrnoToError(syscall.ENOENT);
diff --git a/src/lib/os/os_file.go b/src/lib/os/os_file.go
index f875d64d4..71fbbec9c 100644
--- a/src/lib/os/os_file.go
+++ b/src/lib/os/os_file.go
@@ -8,24 +8,24 @@ import syscall "syscall"
import os "os"
// FDs are wrappers for file descriptors
-export type FD struct {
+type FD struct {
fd int64
}
-export func NewFD(fd int64) *FD {
+func NewFD(fd int64) *FD {
if fd < 0 {
return nil
}
return &FD{fd}
}
-export var (
+var (
Stdin = NewFD(0);
Stdout = NewFD(1);
Stderr = NewFD(2);
)
-export const (
+const (
O_RDONLY = syscall.O_RDONLY;
O_WRONLY = syscall.O_WRONLY;
O_RDWR = syscall.O_RDWR;
@@ -39,7 +39,7 @@ export const (
O_TRUNC = syscall.O_TRUNC;
)
-export func Open(name string, mode int, flags int) (fd *FD, err *Error) {
+func Open(name string, mode int, flags int) (fd *FD, err *Error) {
r, e := syscall.Open(name, int64(mode), int64(flags));
return NewFD(r), ErrnoToError(e)
}
@@ -96,7 +96,7 @@ func (fd *FD) WriteString(s string) (ret int, err *Error) {
return int(r), ErrnoToError(e)
}
-export func Pipe() (fd1 *FD, fd2 *FD, err *Error) {
+func Pipe() (fd1 *FD, fd2 *FD, err *Error) {
var p [2]int64;
r, e := syscall.Pipe(&p);
if e != 0 {
@@ -105,7 +105,7 @@ export func Pipe() (fd1 *FD, fd2 *FD, err *Error) {
return NewFD(p[0]), NewFD(p[1]), nil
}
-export func Mkdir(name string, perm int) *Error {
+func Mkdir(name string, perm int) *Error {
r, e := syscall.Mkdir(name, int64(perm));
return ErrnoToError(e)
}
diff --git a/src/lib/os/os_time.go b/src/lib/os/os_time.go
index b5cc64336..0f5fdfda8 100644
--- a/src/lib/os/os_time.go
+++ b/src/lib/os/os_time.go
@@ -9,7 +9,7 @@ import (
"syscall"
)
-export func Time() (sec int64, nsec int64, err *Error) {
+func Time() (sec int64, nsec int64, err *Error) {
var errno int64;
sec, nsec, errno = syscall.Gettimeofday();
if errno != 0 {
diff --git a/src/lib/rand.go b/src/lib/rand.go
index 68f53c5e2..a22d32593 100644
--- a/src/lib/rand.go
+++ b/src/lib/rand.go
@@ -44,7 +44,7 @@ func seedrand(x int32) int32 {
return x;
}
-export func Seed(seed int32) {
+func Seed(seed int32) {
rng_tap = 0;
rng_feed = _LEN-_TAP;
@@ -72,7 +72,7 @@ export func Seed(seed int32) {
}
}
-export func Int63() int64 {
+func Int63() int64 {
rng_tap--;
if rng_tap < 0 {
rng_tap += _LEN;
@@ -88,20 +88,20 @@ export func Int63() int64 {
return x;
}
-export func Uint32() uint32 {
+func Uint32() uint32 {
return uint32(Int63() >> 31);
}
-export func Int31() int32 {
+func Int31() int32 {
return int32(Int63() >> 32);
}
-export func Int() int {
+func Int() int {
u := uint(Int63());
return int(u << 1 >> 1); // clear sign bit if int == int32
}
-export func Int63n(n int64) int64 {
+func Int63n(n int64) int64 {
if n <= 0 {
return 0
}
@@ -113,15 +113,15 @@ export func Int63n(n int64) int64 {
return v % n
}
-export func Int31n(n int32) int32 {
+func Int31n(n int32) int32 {
return int32(Int63n(int64(n)))
}
-export func Intn(n int) int {
+func Intn(n int) int {
return int(Int63n(int64(n)))
}
-export func Float64() float64 {
+func Float64() float64 {
x := float64(Int63()) / float64(_MASK);
for x >= 1 {
x = float64(Int63()) / float64(_MASK);
@@ -129,16 +129,16 @@ export func Float64() float64 {
return x;
}
-export func Float32() float32 {
+func Float32() float32 {
return float32(Float64())
}
-export func Float() float
+func Float() float
{
return float(Float64())
}
-export func Perm(n int) []int {
+func Perm(n int) []int {
m := make([]int, n);
for i:=0; i<n; i++ {
m[i] = i;
diff --git a/src/lib/reflect/all_test.go b/src/lib/reflect/all_test.go
index 4ad8abd74..631a5662c 100644
--- a/src/lib/reflect/all_test.go
+++ b/src/lib/reflect/all_test.go
@@ -87,9 +87,9 @@ func valuedump(s, t string) {
assert(reflect.ValueToString(v), t);
}
-export type T struct { a int; b float64; c string; d *int }
+type T struct { a int; b float64; c string; d *int }
-export func TestAll(tt *testing.T) { // TODO(r): wrap up better
+func TestAll(tt *testing.T) { // TODO(r): wrap up better
var s string;
var t reflect.Type;
@@ -285,7 +285,7 @@ export func TestAll(tt *testing.T) { // TODO(r): wrap up better
}
}
-export func TestInterfaceGet(t *testing.T) {
+func TestInterfaceGet(t *testing.T) {
var inter struct { e interface{ } };
inter.e = 123.456;
v1 := reflect.NewValue(&inter);
@@ -296,7 +296,7 @@ export func TestInterfaceGet(t *testing.T) {
assert(v3.Type().String(), "float");
}
-export func TestCopyArray(t *testing.T) {
+func TestCopyArray(t *testing.T) {
a := []int{ 1, 2, 3, 4, 10, 9, 8, 7 };
b := []int{ 11, 22, 33, 44, 1010, 99, 88, 77, 66, 55, 44 };
c := []int{ 11, 22, 33, 44, 1010, 99, 88, 77, 66, 55, 44 };
@@ -331,7 +331,7 @@ export func TestCopyArray(t *testing.T) {
}
}
-export func TestBigUnnamedStruct(t *testing.T) {
+func TestBigUnnamedStruct(t *testing.T) {
b := struct{a,b,c,d int64}{1, 2, 3, 4};
v := NewValue(b);
b1 := v.Interface().(struct{a,b,c,d int64});
@@ -343,7 +343,7 @@ export func TestBigUnnamedStruct(t *testing.T) {
type big struct {
a, b, c, d, e int64
}
-export func TestBigStruct(t *testing.T) {
+func TestBigStruct(t *testing.T) {
b := big{1, 2, 3, 4, 5};
v := NewValue(b);
b1 := v.Interface().(big);
diff --git a/src/lib/reflect/tostring.go b/src/lib/reflect/tostring.go
index d451e552f..38d9d9135 100644
--- a/src/lib/reflect/tostring.go
+++ b/src/lib/reflect/tostring.go
@@ -12,8 +12,8 @@ import (
"strconv";
)
-export func TypeToString(typ Type, expand bool) string
-export func ValueToString(val Value) string
+func TypeToString(typ Type, expand bool) string
+func ValueToString(val Value) string
func doubleQuote(s string) string {
out := "\"";
@@ -62,7 +62,7 @@ func typeFieldsToString(t hasFields, sep string) string {
return str;
}
-export func TypeToString(typ Type, expand bool) string {
+func TypeToString(typ Type, expand bool) string {
var str string;
if name := typ.Name(); !expand && name != "" {
return name
@@ -126,7 +126,7 @@ func integer(v int64) string {
return strconv.Itoa64(v);
}
-export func ValueToString(val Value) string {
+func ValueToString(val Value) string {
var str string;
typ := val.Type();
switch(val.Kind()) {
diff --git a/src/lib/reflect/type.go b/src/lib/reflect/type.go
index a7e8f7f31..1095ccb49 100644
--- a/src/lib/reflect/type.go
+++ b/src/lib/reflect/type.go
@@ -12,13 +12,13 @@ import (
"sync";
)
-export type Type interface
+type Type interface
-export func ExpandType(name string) Type
+func ExpandType(name string) Type
func typestrings() string // implemented in C; declared here
-export const (
+const (
MissingKind = iota;
ArrayKind;
BoolKind;
@@ -54,7 +54,7 @@ var interfacesize int
var missingString = "$missing$" // syntactic name for undefined type names
var dotDotDotString = "..."
-export type Type interface {
+type Type interface {
Kind() int;
Name() string;
String() string;
@@ -102,7 +102,7 @@ func newBasicType(name string, kind int, size int) Type {
}
// Prebuilt basic types
-export var (
+var (
Missing = newBasicType(missingString, MissingKind, 1);
DotDotDot = newBasicType(dotDotDotString, DotDotDotKind, 16); // TODO(r): size of interface?
Bool = newBasicType("bool", BoolKind, 1); // TODO: need to know how big a bool is
@@ -145,7 +145,7 @@ func (t *stubType) Get() Type {
// -- Pointer
-export type PtrType interface {
+type PtrType interface {
Sub() Type
}
@@ -164,7 +164,7 @@ func (t *ptrTypeStruct) Sub() Type {
// -- Array
-export type ArrayType interface {
+type ArrayType interface {
Open() bool;
Len() int;
Elem() Type;
@@ -203,7 +203,7 @@ func (t *arrayTypeStruct) Elem() Type {
// -- Map
-export type MapType interface {
+type MapType interface {
Key() Type;
Elem() Type;
}
@@ -228,12 +228,12 @@ func (t *mapTypeStruct) Elem() Type {
// -- Chan
-export type ChanType interface {
+type ChanType interface {
Dir() int;
Elem() Type;
}
-export const ( // channel direction
+const ( // channel direction
SendDir = 1 << iota;
RecvDir;
BothDir = SendDir | RecvDir;
@@ -259,7 +259,7 @@ func (t *chanTypeStruct) Elem() Type {
// -- Struct
-export type StructType interface {
+type StructType interface {
Field(int) (name string, typ Type, tag string, offset int);
Len() int;
}
@@ -319,7 +319,7 @@ func (t *structTypeStruct) Len() int {
// -- Interface
-export type InterfaceType interface {
+type InterfaceType interface {
Field(int) (name string, typ Type, tag string, offset int);
Len() int;
}
@@ -345,7 +345,7 @@ var nilInterface = newInterfaceTypeStruct("nil", "", make([]structField, 0));
// -- Func
-export type FuncType interface {
+type FuncType interface {
In() StructType;
Out() StructType;
}
@@ -842,7 +842,7 @@ func (p *typeParser) Type(name string) *stubType {
return s;
}
-export func ParseTypeString(name, typestring string) Type {
+func ParseTypeString(name, typestring string) Type {
if typestring == "" {
// If the typestring is empty, it represents (the type of) a nil interface value
return nilInterface
@@ -902,7 +902,7 @@ func typeNameToTypeString(name string) string {
}
// Type is known by name. Find (and create if necessary) its real type.
-export func ExpandType(name string) Type {
+func ExpandType(name string) Type {
lock();
t, ok := types[name];
if ok {
diff --git a/src/lib/reflect/value.go b/src/lib/reflect/value.go
index ebd3c5f4a..f1651a28c 100644
--- a/src/lib/reflect/value.go
+++ b/src/lib/reflect/value.go
@@ -12,13 +12,13 @@ import (
"unsafe";
)
-export type Addr unsafe.pointer
+type Addr unsafe.Pointer
func equalType(a, b Type) bool {
return a.String() == b.String()
}
-export type Value interface {
+type Value interface {
Kind() int;
Type() Type;
Addr() Addr;
@@ -65,7 +65,7 @@ type creatorFn *(typ Type, addr Addr) Value
// -- Missing
-export type MissingValue interface {
+type MissingValue interface {
Kind() int;
Type() Type;
Addr() Addr;
@@ -81,7 +81,7 @@ func missingCreator(typ Type, addr Addr) Value {
// -- Int
-export type IntValue interface {
+type IntValue interface {
Kind() int;
Get() int;
Set(int);
@@ -106,7 +106,7 @@ func (v *intValueStruct) Set(i int) {
// -- Int8
-export type Int8Value interface {
+type Int8Value interface {
Kind() int;
Get() int8;
Set(int8);
@@ -131,7 +131,7 @@ func (v *int8ValueStruct) Set(i int8) {
// -- Int16
-export type Int16Value interface {
+type Int16Value interface {
Kind() int;
Get() int16;
Set(int16);
@@ -156,7 +156,7 @@ func (v *int16ValueStruct) Set(i int16) {
// -- Int32
-export type Int32Value interface {
+type Int32Value interface {
Kind() int;
Get() int32;
Set(int32);
@@ -181,7 +181,7 @@ func (v *int32ValueStruct) Set(i int32) {
// -- Int64
-export type Int64Value interface {
+type Int64Value interface {
Kind() int;
Get() int64;
Set(int64);
@@ -206,7 +206,7 @@ func (v *int64ValueStruct) Set(i int64) {
// -- Uint
-export type UintValue interface {
+type UintValue interface {
Kind() int;
Get() uint;
Set(uint);
@@ -231,7 +231,7 @@ func (v *uintValueStruct) Set(i uint) {
// -- Uint8
-export type Uint8Value interface {
+type Uint8Value interface {
Kind() int;
Get() uint8;
Set(uint8);
@@ -256,7 +256,7 @@ func (v *uint8ValueStruct) Set(i uint8) {
// -- Uint16
-export type Uint16Value interface {
+type Uint16Value interface {
Kind() int;
Get() uint16;
Set(uint16);
@@ -281,7 +281,7 @@ func (v *uint16ValueStruct) Set(i uint16) {
// -- Uint32
-export type Uint32Value interface {
+type Uint32Value interface {
Kind() int;
Get() uint32;
Set(uint32);
@@ -306,7 +306,7 @@ func (v *uint32ValueStruct) Set(i uint32) {
// -- Uint64
-export type Uint64Value interface {
+type Uint64Value interface {
Kind() int;
Get() uint64;
Set(uint64);
@@ -331,7 +331,7 @@ func (v *uint64ValueStruct) Set(i uint64) {
// -- Uintptr
-export type UintptrValue interface {
+type UintptrValue interface {
Kind() int;
Get() uintptr;
Set(uintptr);
@@ -356,7 +356,7 @@ func (v *uintptrValueStruct) Set(i uintptr) {
// -- Float
-export type FloatValue interface {
+type FloatValue interface {
Kind() int;
Get() float;
Set(float);
@@ -381,7 +381,7 @@ func (v *floatValueStruct) Set(f float) {
// -- Float32
-export type Float32Value interface {
+type Float32Value interface {
Kind() int;
Get() float32;
Set(float32);
@@ -406,7 +406,7 @@ func (v *float32ValueStruct) Set(f float32) {
// -- Float64
-export type Float64Value interface {
+type Float64Value interface {
Kind() int;
Get() float64;
Set(float64);
@@ -431,7 +431,7 @@ func (v *float64ValueStruct) Set(f float64) {
// -- Float80
-export type Float80Value interface {
+type Float80Value interface {
Kind() int;
Get() float80;
Set(float80);
@@ -459,7 +459,7 @@ func (v *Float80ValueStruct) Set(f float80) {
// -- String
-export type StringValue interface {
+type StringValue interface {
Kind() int;
Get() string;
Set(string);
@@ -484,7 +484,7 @@ func (v *stringValueStruct) Set(s string) {
// -- Bool
-export type BoolValue interface {
+type BoolValue interface {
Kind() int;
Get() bool;
Set(bool);
@@ -509,7 +509,7 @@ func (v *boolValueStruct) Set(b bool) {
// -- Pointer
-export type PtrValue interface {
+type PtrValue interface {
Kind() int;
Type() Type;
Sub() Value;
@@ -545,7 +545,7 @@ func ptrCreator(typ Type, addr Addr) Value {
// -- Array
-export type ArrayValue interface {
+type ArrayValue interface {
Kind() int;
Type() Type;
Open() bool;
@@ -652,7 +652,7 @@ func arrayCreator(typ Type, addr Addr) Value {
// -- Map TODO: finish and test
-export type MapValue interface {
+type MapValue interface {
Kind() int;
Type() Type;
Len() int;
@@ -678,7 +678,7 @@ func (v *mapValueStruct) Elem(key Value) Value {
// -- Chan
-export type ChanValue interface {
+type ChanValue interface {
Kind() int;
Type() Type;
}
@@ -693,7 +693,7 @@ func chanCreator(typ Type, addr Addr) Value {
// -- Struct
-export type StructValue interface {
+type StructValue interface {
Kind() int;
Type() Type;
Len() int;
@@ -728,7 +728,7 @@ func structCreator(typ Type, addr Addr) Value {
// -- Interface
-export type InterfaceValue interface {
+type InterfaceValue interface {
Kind() int;
Type() Type;
Get() interface {};
@@ -748,7 +748,7 @@ func interfaceCreator(typ Type, addr Addr) Value {
// -- Func
-export type FuncValue interface {
+type FuncValue interface {
Kind() int;
Type() Type;
}
@@ -799,7 +799,7 @@ func newValueAddr(typ Type, addr Addr) Value {
return c(typ, addr);
}
-export func NewInitValue(typ Type) Value {
+func NewInitValue(typ Type) Value {
// Some values cannot be made this way.
switch typ.Kind() {
case FuncKind: // must be pointers, at least for now (TODO?)
@@ -825,7 +825,7 @@ export func NewInitValue(typ Type) Value {
uint32 cap; // allocated number of elements
};
*/
-export func NewOpenArrayValue(typ ArrayType, len, cap int) ArrayValue {
+func NewOpenArrayValue(typ ArrayType, len, cap int) ArrayValue {
if !typ.Open() {
return nil
}
@@ -843,7 +843,7 @@ export func NewOpenArrayValue(typ ArrayType, len, cap int) ArrayValue {
return newValueAddr(typ, Addr(array));
}
-export func CopyArray(dst ArrayValue, src ArrayValue, n int) {
+func CopyArray(dst ArrayValue, src ArrayValue, n int) {
if n == 0 {
return
}
@@ -875,7 +875,7 @@ export func CopyArray(dst ArrayValue, src ArrayValue, n int) {
}
-export func NewValue(e interface {}) Value {
+func NewValue(e interface {}) Value {
value, typestring, indir := sys.Reflect(e);
typ, ok := typecache[typestring];
if !ok {
diff --git a/src/lib/regexp/all_test.go b/src/lib/regexp/all_test.go
index f72671ccf..5e9754934 100644
--- a/src/lib/regexp/all_test.go
+++ b/src/lib/regexp/all_test.go
@@ -36,16 +36,16 @@ type stringError struct {
}
var bad_re = []stringError{
stringError{ `*`, regexp.ErrBareClosure },
- stringError{ `(abc`, regexp.ErrUnmatchedLpar },
- stringError{ `abc)`, regexp.ErrUnmatchedRpar },
- stringError{ `x[a-z`, regexp.ErrUnmatchedLbkt },
- stringError{ `abc]`, regexp.ErrUnmatchedRbkt },
- stringError{ `[z-a]`, regexp.ErrBadRange },
- stringError{ `abc\`, regexp.ErrExtraneousBackslash },
- stringError{ `a**`, regexp.ErrBadClosure },
- stringError{ `a*+`, regexp.ErrBadClosure },
- stringError{ `a??`, regexp.ErrBadClosure },
- stringError{ `*`, regexp.ErrBareClosure },
+ stringError{ `(abc`, regexp.ErrUnmatchedLpar },
+ stringError{ `abc)`, regexp.ErrUnmatchedRpar },
+ stringError{ `x[a-z`, regexp.ErrUnmatchedLbkt },
+ stringError{ `abc]`, regexp.ErrUnmatchedRbkt },
+ stringError{ `[z-a]`, regexp.ErrBadRange },
+ stringError{ `abc\`, regexp.ErrExtraneousBackslash },
+ stringError{ `a**`, regexp.ErrBadClosure },
+ stringError{ `a*+`, regexp.ErrBadClosure },
+ stringError{ `a??`, regexp.ErrBadClosure },
+ stringError{ `*`, regexp.ErrBareClosure },
stringError{ `\x`, regexp.ErrBadBackslash },
}
@@ -155,19 +155,19 @@ func executeTest(t *testing.T, expr string, str string, match []int) {
}
}
-export func TestGoodCompile(t *testing.T) {
+func TestGoodCompile(t *testing.T) {
for i := 0; i < len(good_re); i++ {
compileTest(t, good_re[i], nil);
}
}
-export func TestBadCompile(t *testing.T) {
+func TestBadCompile(t *testing.T) {
for i := 0; i < len(bad_re); i++ {
compileTest(t, bad_re[i].re, bad_re[i].err)
}
}
-export func TestExecute(t *testing.T) {
+func TestExecute(t *testing.T) {
for i := 0; i < len(matches); i++ {
test := &matches[i];
executeTest(t, test.re, test.text, test.match)
@@ -185,7 +185,7 @@ func matchTest(t *testing.T, expr string, str string, match []int) {
}
}
-export func TestMatch(t *testing.T) {
+func TestMatch(t *testing.T) {
for i := 0; i < len(matches); i++ {
test := &matches[i];
matchTest(t, test.re, test.text, test.match)
@@ -210,7 +210,7 @@ func matchStringsTest(t *testing.T, expr string, str string, match []int) {
}
}
-export func TestMatchStrings(t *testing.T) {
+func TestMatchStrings(t *testing.T) {
for i := 0; i < len(matches); i++ {
test := &matches[i];
matchTest(t, test.re, test.text, test.match)
@@ -227,7 +227,7 @@ func matchFunctionTest(t *testing.T, expr string, str string, match []int) {
}
}
-export func TestMatchFunction(t *testing.T) {
+func TestMatchFunction(t *testing.T) {
for i := 0; i < len(matches); i++ {
test := &matches[i];
matchFunctionTest(t, test.re, test.text, test.match)
diff --git a/src/lib/regexp/regexp.go b/src/lib/regexp/regexp.go
index e83860314..b406443f5 100644
--- a/src/lib/regexp/regexp.go
+++ b/src/lib/regexp/regexp.go
@@ -15,16 +15,16 @@ import (
var debug = false;
-export var ErrInternal = os.NewError("internal error");
-export var ErrUnmatchedLpar = os.NewError("unmatched '('");
-export var ErrUnmatchedRpar = os.NewError("unmatched ')'");
-export var ErrUnmatchedLbkt = os.NewError("unmatched '['");
-export var ErrUnmatchedRbkt = os.NewError("unmatched ']'");
-export var ErrBadRange = os.NewError("bad range in character class");
-export var ErrExtraneousBackslash = os.NewError("extraneous backslash");
-export var ErrBadClosure = os.NewError("repeated closure (**, ++, etc.)");
-export var ErrBareClosure = os.NewError("closure applies to nothing");
-export var ErrBadBackslash = os.NewError("illegal backslash escape");
+var ErrInternal = os.NewError("internal error");
+var ErrUnmatchedLpar = os.NewError("unmatched '('");
+var ErrUnmatchedRpar = os.NewError("unmatched ')'");
+var ErrUnmatchedLbkt = os.NewError("unmatched '['");
+var ErrUnmatchedRbkt = os.NewError("unmatched ']'");
+var ErrBadRange = os.NewError("bad range in character class");
+var ErrExtraneousBackslash = os.NewError("extraneous backslash");
+var ErrBadClosure = os.NewError("repeated closure (**, ++, etc.)");
+var ErrBareClosure = os.NewError("closure applies to nothing");
+var ErrBadBackslash = os.NewError("illegal backslash escape");
// An instruction executed by the NFA
type instr interface {
@@ -582,14 +582,14 @@ func compiler(str string, ch chan *_RE) {
}
// Public interface has only execute functionality
-export type Regexp interface {
+type Regexp interface {
Execute(s string) []int;
Match(s string) bool;
MatchStrings(s string) []string;
}
// Compile in separate goroutine; wait for result
-export func Compile(str string) (regexp Regexp, error *os.Error) {
+func Compile(str string) (regexp Regexp, error *os.Error) {
ch := make(chan *_RE);
go compiler(str, ch);
re := <-ch;
@@ -739,7 +739,7 @@ func (re *_RE) MatchStrings(s string) []string {
// Exported function for simple boolean check. Anything more fancy
// needs a call to Compile.
-export func Match(pattern string, s string) (matched bool, error *os.Error) {
+func Match(pattern string, s string) (matched bool, error *os.Error) {
re, err := Compile(pattern);
if err != nil {
return false, err
diff --git a/src/lib/sort.go b/src/lib/sort.go
index 45726d80a..0caf4ec12 100644
--- a/src/lib/sort.go
+++ b/src/lib/sort.go
@@ -4,7 +4,7 @@
package sort
-export type SortInterface interface {
+type SortInterface interface {
Len() int;
Less(i, j int) bool;
Swap(i, j int);
@@ -116,12 +116,12 @@ func quickSort(data SortInterface, a, b int) {
}
}
-export func Sort(data SortInterface) {
+func Sort(data SortInterface) {
quickSort(data, 0, data.Len());
}
-export func IsSorted(data SortInterface) bool {
+func IsSorted(data SortInterface) bool {
n := data.Len();
for i := n - 1; i > 0; i-- {
if data.Less(i, i - 1) {
@@ -134,21 +134,21 @@ export func IsSorted(data SortInterface) bool {
// Convenience types for common cases
-export type IntArray []int
+type IntArray []int
func (p IntArray) Len() int { return len(p); }
func (p IntArray) Less(i, j int) bool { return p[i] < p[j]; }
func (p IntArray) Swap(i, j int) { p[i], p[j] = p[j], p[i]; }
-export type FloatArray []float
+type FloatArray []float
func (p FloatArray) Len() int { return len(p); }
func (p FloatArray) Less(i, j int) bool { return p[i] < p[j]; }
func (p FloatArray) Swap(i, j int) { p[i], p[j] = p[j], p[i]; }
-export type StringArray []string
+type StringArray []string
func (p StringArray) Len() int { return len(p); }
func (p StringArray) Less(i, j int) bool { return p[i] < p[j]; }
@@ -157,11 +157,11 @@ func (p StringArray) Swap(i, j int) { p[i], p[j] = p[j], p[i]; }
// Convenience wrappers for common cases
-export func SortInts(a []int) { Sort(IntArray(a)); }
-export func SortFloats(a []float) { Sort(FloatArray(a)); }
-export func SortStrings(a []string) { Sort(StringArray(a)); }
+func SortInts(a []int) { Sort(IntArray(a)); }
+func SortFloats(a []float) { Sort(FloatArray(a)); }
+func SortStrings(a []string) { Sort(StringArray(a)); }
-export func IntsAreSorted(a []int) bool { return IsSorted(IntArray(a)); }
-export func FloatsAreSorted(a []float) bool { return IsSorted(FloatArray(a)); }
-export func StringsAreSorted(a []string) bool { return IsSorted(StringArray(a)); }
+func IntsAreSorted(a []int) bool { return IsSorted(IntArray(a)); }
+func FloatsAreSorted(a []float) bool { return IsSorted(FloatArray(a)); }
+func StringsAreSorted(a []string) bool { return IsSorted(StringArray(a)); }
diff --git a/src/lib/sort_test.go b/src/lib/sort_test.go
index d3a8238f6..aa80aa10e 100644
--- a/src/lib/sort_test.go
+++ b/src/lib/sort_test.go
@@ -16,7 +16,7 @@ var ints = [...]int{74, 59, 238, -784, 9845, 959, 905, 0, 0, 42, 7586, -5467984,
var floats = [...]float{74.3, 59.0, 238.2, -784.0, 2.3, 9845.768, -959.7485, 905, 7.8, 7.8}
var strings = [...]string{"", "Hello", "foo", "bar", "foo", "f00", "%*&^*&^&", "***"}
-export func TestSortIntArray(t *testing.T) {
+func TestSortIntArray(t *testing.T) {
data := ints;
a := IntArray(data);
sort.Sort(a);
@@ -26,7 +26,7 @@ export func TestSortIntArray(t *testing.T) {
}
}
-export func TestSortFloatArray(t *testing.T) {
+func TestSortFloatArray(t *testing.T) {
data := floats;
a := FloatArray(data);
sort.Sort(a);
@@ -36,7 +36,7 @@ export func TestSortFloatArray(t *testing.T) {
}
}
-export func TestSortStringArray(t *testing.T) {
+func TestSortStringArray(t *testing.T) {
data := strings;
a := StringArray(data);
sort.Sort(a);
@@ -46,7 +46,7 @@ export func TestSortStringArray(t *testing.T) {
}
}
-export func TestSortInts(t *testing.T) {
+func TestSortInts(t *testing.T) {
data := ints;
sort.SortInts(data);
if !sort.IntsAreSorted(data) {
@@ -55,7 +55,7 @@ export func TestSortInts(t *testing.T) {
}
}
-export func TestSortFloats(t *testing.T) {
+func TestSortFloats(t *testing.T) {
data := floats;
sort.SortFloats(data);
if !sort.FloatsAreSorted(data) {
@@ -64,7 +64,7 @@ export func TestSortFloats(t *testing.T) {
}
}
-export func TestSortStrings(t *testing.T) {
+func TestSortStrings(t *testing.T) {
data := strings;
sort.SortStrings(data);
if !sort.StringsAreSorted(data) {
@@ -73,7 +73,7 @@ export func TestSortStrings(t *testing.T) {
}
}
-export func TestSortLarge_Random(t *testing.T) {
+func TestSortLarge_Random(t *testing.T) {
data := make([]int, 1000000);
for i := 0; i < len(data); i++ {
data[i] = rand.Intn(100);
@@ -133,7 +133,7 @@ func lg(n int) int {
return i;
}
-export func TestBentleyMcIlroy(t *testing.T) {
+func TestBentleyMcIlroy(t *testing.T) {
sizes := []int{100, 1023, 1024, 1025};
dists := []string{"sawtooth", "rand", "stagger", "plateau", "shuffle"};
modes := []string{"copy", "reverse", "reverse1", "reverse2", "sort", "dither"};
diff --git a/src/lib/strconv/atof.go b/src/lib/strconv/atof.go
index 147b7955b..e562bfdb3 100644
--- a/src/lib/strconv/atof.go
+++ b/src/lib/strconv/atof.go
@@ -318,7 +318,7 @@ func decimalAtof32(neg bool, d *decimal, trunc bool) (f float32, ok bool) {
// If s is syntactically well-formed but is more than 1/2 ULP
// away from the largest floating point number of the given size,
// returns f = ±Inf, err = os.ERANGE.
-export func Atof64(s string) (f float64, err *os.Error) {
+func Atof64(s string) (f float64, err *os.Error) {
neg, d, trunc, ok := stringToDecimal(s);
if !ok {
return 0, os.EINVAL;
@@ -336,7 +336,7 @@ export func Atof64(s string) (f float64, err *os.Error) {
return f, err
}
-export func Atof32(s string) (f float32, err *os.Error) {
+func Atof32(s string) (f float32, err *os.Error) {
neg, d, trunc, ok := stringToDecimal(s);
if !ok {
return 0, os.EINVAL;
@@ -354,7 +354,7 @@ export func Atof32(s string) (f float32, err *os.Error) {
return f, err
}
-export func Atof(s string) (f float, err *os.Error) {
+func Atof(s string) (f float, err *os.Error) {
if FloatSize == 32 {
f1, err1 := Atof32(s);
return float(f1), err1;
diff --git a/src/lib/strconv/atof_test.go b/src/lib/strconv/atof_test.go
index 493829b57..7f1f0a131 100644
--- a/src/lib/strconv/atof_test.go
+++ b/src/lib/strconv/atof_test.go
@@ -124,10 +124,10 @@ func testAtof(t *testing.T, opt bool) {
strconv.optimize = oldopt;
}
-export func TestAtof(t *testing.T) {
+func TestAtof(t *testing.T) {
testAtof(t, true);
}
-export func TestAtofSlow(t *testing.T) {
+func TestAtofSlow(t *testing.T) {
testAtof(t, false);
}
diff --git a/src/lib/strconv/atoi.go b/src/lib/strconv/atoi.go
index 1c5d112cf..b41d08e14 100644
--- a/src/lib/strconv/atoi.go
+++ b/src/lib/strconv/atoi.go
@@ -15,7 +15,7 @@ func computeIntsize() uint {
var intsize = computeIntsize();
// Convert decimal string to unsigned integer.
-export func Atoui64(s string) (i uint64, err *os.Error) {
+func Atoui64(s string) (i uint64, err *os.Error) {
// empty string bad
if len(s) == 0 {
return 0, os.EINVAL
@@ -52,7 +52,7 @@ export func Atoui64(s string) (i uint64, err *os.Error) {
}
// Convert decimal string to integer.
-export func Atoi64(s string) (i int64, err *os.Error) {
+func Atoi64(s string) (i int64, err *os.Error) {
// empty string bad
if len(s) == 0 {
return 0, os.EINVAL
@@ -85,7 +85,7 @@ export func Atoi64(s string) (i int64, err *os.Error) {
return n, nil
}
-export func Atoui(s string) (i uint, err *os.Error) {
+func Atoui(s string) (i uint, err *os.Error) {
i1, e1 := Atoui64(s);
if e1 != nil && e1 != os.ERANGE {
return 0, e1
@@ -99,7 +99,7 @@ export func Atoui(s string) (i uint, err *os.Error) {
return i, nil
}
-export func Atoi(s string) (i int, err *os.Error) {
+func Atoi(s string) (i int, err *os.Error) {
i1, e1 := Atoi64(s);
if e1 != nil && e1 != os.ERANGE {
return 0, e1
diff --git a/src/lib/strconv/atoi_test.go b/src/lib/strconv/atoi_test.go
index 41a6f4b76..5ffda142e 100644
--- a/src/lib/strconv/atoi_test.go
+++ b/src/lib/strconv/atoi_test.go
@@ -103,7 +103,7 @@ var atoi32tests = []atoi32Test {
atoi32Test{ "-2147483649", -1<<31, os.ERANGE },
}
-export func TestAtoui64(t *testing.T) {
+func TestAtoui64(t *testing.T) {
for i := 0; i < len(atoui64tests); i++ {
test := &atoui64tests[i];
out, err := strconv.Atoui64(test.in);
@@ -114,7 +114,7 @@ export func TestAtoui64(t *testing.T) {
}
}
-export func TestAtoi64(t *testing.T) {
+func TestAtoi64(t *testing.T) {
for i := 0; i < len(atoi64test); i++ {
test := &atoi64test[i];
out, err := strconv.Atoi64(test.in);
@@ -125,7 +125,7 @@ export func TestAtoi64(t *testing.T) {
}
}
-export func TestAtoui(t *testing.T) {
+func TestAtoui(t *testing.T) {
switch intsize {
case 32:
for i := 0; i < len(atoui32tests); i++ {
@@ -148,7 +148,7 @@ export func TestAtoui(t *testing.T) {
}
}
-export func TestAtoi(t *testing.T) {
+func TestAtoi(t *testing.T) {
switch intsize {
case 32:
for i := 0; i < len(atoi32tests); i++ {
diff --git a/src/lib/strconv/decimal_test.go b/src/lib/strconv/decimal_test.go
index 55fcbdd6b..bc82861bd 100644
--- a/src/lib/strconv/decimal_test.go
+++ b/src/lib/strconv/decimal_test.go
@@ -29,7 +29,7 @@ var shifttests = []shiftTest {
shiftTest{ 1953125, 9, "1000000000" },
}
-export func TestDecimalShift(t *testing.T) {
+func TestDecimalShift(t *testing.T) {
ok := true;
for i := 0; i < len(shifttests); i++ {
test := &shifttests[i];
@@ -66,7 +66,7 @@ var roundtests = []roundTest {
roundTest{ 12999999, 4, "12990000", "13000000", "13000000", 13000000 },
}
-export func TestDecimalRound(t *testing.T) {
+func TestDecimalRound(t *testing.T) {
for i := 0; i < len(roundtests); i++ {
test := &roundtests[i];
s := strconv.newDecimal(test.i).RoundDown(test.nd).String();
@@ -106,7 +106,7 @@ var roundinttests = []roundIntTest {
roundIntTest{ 1000, 0, 1000 },
}
-export func TestDecimalRoundedInteger(t *testing.T) {
+func TestDecimalRoundedInteger(t *testing.T) {
for i := 0; i < len(roundinttests); i++ {
test := roundinttests[i];
// TODO: should be able to use int := here.
diff --git a/src/lib/strconv/fp_test.go b/src/lib/strconv/fp_test.go
index f0cfad0bb..6738ed75e 100644
--- a/src/lib/strconv/fp_test.go
+++ b/src/lib/strconv/fp_test.go
@@ -92,7 +92,7 @@ func myatof32(s string) (f float32, ok bool) {
return f1, true;
}
-export func TestFp(t *testing.T) {
+func TestFp(t *testing.T) {
fd, err := os.Open("testfp.txt", os.O_RDONLY, 0);
if err != nil {
panicln("testfp: open testfp.txt:", err.String());
diff --git a/src/lib/strconv/ftoa.go b/src/lib/strconv/ftoa.go
index 355680fb7..c4951873d 100644
--- a/src/lib/strconv/ftoa.go
+++ b/src/lib/strconv/ftoa.go
@@ -38,17 +38,17 @@ func floatsize() int {
}
return 64;
}
-export var FloatSize = floatsize()
+var FloatSize = floatsize()
-export func Ftoa32(f float32, fmt byte, prec int) string {
+func Ftoa32(f float32, fmt byte, prec int) string {
return genericFtoa(uint64(sys.Float32bits(f)), fmt, prec, &float32info);
}
-export func Ftoa64(f float64, fmt byte, prec int) string {
+func Ftoa64(f float64, fmt byte, prec int) string {
return genericFtoa(sys.Float64bits(f), fmt, prec, &float64info);
}
-export func Ftoa(f float, fmt byte, prec int) string {
+func Ftoa(f float, fmt byte, prec int) string {
if FloatSize == 32 {
return Ftoa32(float32(f), fmt, prec);
}
diff --git a/src/lib/strconv/ftoa_test.go b/src/lib/strconv/ftoa_test.go
index 61ce38cff..309f02870 100644
--- a/src/lib/strconv/ftoa_test.go
+++ b/src/lib/strconv/ftoa_test.go
@@ -98,7 +98,7 @@ var ftoatests = []ftoaTest {
ftoaTest{ -1, 'b', -1, "-4503599627370496p-52" },
}
-export func TestFtoa(t *testing.T) {
+func TestFtoa(t *testing.T) {
if strconv.FloatSize != 32 {
panic("floatsize: ", strconv.FloatSize);
}
diff --git a/src/lib/strconv/itoa.go b/src/lib/strconv/itoa.go
index 256289ada..7409d0836 100644
--- a/src/lib/strconv/itoa.go
+++ b/src/lib/strconv/itoa.go
@@ -4,7 +4,7 @@
package strconv
-export func Itoa64(i int64) string {
+func Itoa64(i int64) string {
if i == 0 {
return "0"
}
@@ -31,7 +31,7 @@ export func Itoa64(i int64) string {
return string(b[bp:len(b)])
}
-export func Itoa(i int) string {
+func Itoa(i int) string {
return Itoa64(int64(i));
}
diff --git a/src/lib/strconv/itoa_test.go b/src/lib/strconv/itoa_test.go
index b0e4ed7fa..e965a1c16 100644
--- a/src/lib/strconv/itoa_test.go
+++ b/src/lib/strconv/itoa_test.go
@@ -40,7 +40,7 @@ var itoa64tests = []itoa64Test {
itoa64Test{ -1<<63, "-9223372036854775808" },
}
-export func TestItoa(t *testing.T) {
+func TestItoa(t *testing.T) {
for i := 0; i < len(itoa64tests); i++ {
test := itoa64tests[i];
s := strconv.Itoa64(test.in);
diff --git a/src/lib/strconv/quote.go b/src/lib/strconv/quote.go
index 987545052..b11d73817 100644
--- a/src/lib/strconv/quote.go
+++ b/src/lib/strconv/quote.go
@@ -10,7 +10,7 @@ import (
const lowerhex = "0123456789abcdef"
-export func Quote(s string) string {
+func Quote(s string) string {
t := `"`;
for i := 0; i < len(s); i++ {
switch {
@@ -67,7 +67,7 @@ export func Quote(s string) string {
return t;
}
-export func CanBackquote(s string) bool {
+func CanBackquote(s string) bool {
for i := 0; i < len(s); i++ {
if s[i] < ' ' || s[i] == '`' {
return false;
diff --git a/src/lib/strconv/quote_test.go b/src/lib/strconv/quote_test.go
index ac2c8e706..8421fcde4 100644
--- a/src/lib/strconv/quote_test.go
+++ b/src/lib/strconv/quote_test.go
@@ -23,7 +23,7 @@ var quotetests = []quoteTest {
quoteTest{ "\x04", `"\x04"` },
}
-export func TestQuote(t *testing.T) {
+func TestQuote(t *testing.T) {
for i := 0; i < len(quotetests); i++ {
tt := quotetests[i];
if out := Quote(tt.in); out != tt.out {
@@ -78,7 +78,7 @@ var canbackquotetests = []canBackquoteTest {
canBackquoteTest{ `☺`, true },
}
-export func TestCanBackquote(t *testing.T) {
+func TestCanBackquote(t *testing.T) {
for i := 0; i < len(canbackquotetests); i++ {
tt := canbackquotetests[i];
if out := CanBackquote(tt.in); out != tt.out {
diff --git a/src/lib/strings.go b/src/lib/strings.go
index 2dc386a35..782ecbc5f 100644
--- a/src/lib/strings.go
+++ b/src/lib/strings.go
@@ -7,7 +7,7 @@ package strings
import "utf8"
// Split string into array of UTF-8 sequences (still strings)
-export func Explode(s string) []string {
+func Explode(s string) []string {
a := make([]string, utf8.RuneCountInString(s, 0, len(s)));
j := 0;
var size, rune int;
@@ -20,7 +20,7 @@ export func Explode(s string) []string {
}
// Count non-overlapping instances of sep in s.
-export func Count(s, sep string) int {
+func Count(s, sep string) int {
if sep == "" {
return utf8.RuneCountInString(s, 0, len(s))+1
}
@@ -36,7 +36,7 @@ export func Count(s, sep string) int {
}
// Return index of first instance of sep in s.
-export func Index(s, sep string) int {
+func Index(s, sep string) int {
if sep == "" {
return 0
}
@@ -50,7 +50,7 @@ export func Index(s, sep string) int {
}
// Split string into list of strings at separators
-export func Split(s, sep string) []string {
+func Split(s, sep string) []string {
if sep == "" {
return Explode(s)
}
@@ -72,7 +72,7 @@ export func Split(s, sep string) []string {
}
// Join list of strings with separators between them.
-export func Join(a []string, sep string) string {
+func Join(a []string, sep string) string {
if len(a) == 0 {
return ""
}
diff --git a/src/lib/strings_test.go b/src/lib/strings_test.go
index 3bece666f..2cbf70b93 100644
--- a/src/lib/strings_test.go
+++ b/src/lib/strings_test.go
@@ -26,7 +26,7 @@ var faces = "☺☻☹";
var commas = "1,2,3,4";
var dots = "1....2....3....4";
-export type ExplodeTest struct {
+type ExplodeTest struct {
s string;
a []string;
}
@@ -34,7 +34,7 @@ var explodetests = []ExplodeTest {
ExplodeTest{ abcd, []string{"a", "b", "c", "d"} },
ExplodeTest{ faces, []string{"☺", "☻", "☹" } },
}
-export func TestExplode(t *testing.T) {
+func TestExplode(t *testing.T) {
for i := 0; i < len(explodetests); i++ {
tt := explodetests[i];
a := Explode(tt.s);
@@ -49,7 +49,7 @@ export func TestExplode(t *testing.T) {
}
}
-export type SplitTest struct {
+type SplitTest struct {
s string;
sep string;
a []string;
@@ -64,7 +64,7 @@ var splittests = []SplitTest {
SplitTest{ faces, "~", []string{faces} },
SplitTest{ faces, "", []string{"☺", "☻", "☹"} },
}
-export func TestSplit(t *testing.T) {
+func TestSplit(t *testing.T) {
for i := 0; i < len(splittests); i++ {
tt := splittests[i];
a := Split(tt.s, tt.sep);
diff --git a/src/lib/sync/mutex.go b/src/lib/sync/mutex.go
index 68db0b697..1269027e1 100644
--- a/src/lib/sync/mutex.go
+++ b/src/lib/sync/mutex.go
@@ -8,7 +8,7 @@ func cas(val *int32, old, new int32) bool
func semacquire(*int32)
func semrelease(*int32)
-export type Mutex struct {
+type Mutex struct {
key int32;
sema int32;
}
diff --git a/src/lib/sync/mutex_test.go b/src/lib/sync/mutex_test.go
index b9c063dbc..819dbb9de 100644
--- a/src/lib/sync/mutex_test.go
+++ b/src/lib/sync/mutex_test.go
@@ -11,7 +11,7 @@ import (
"testing"
)
-export func HammerSemaphore(s *int32, cdone chan bool) {
+func HammerSemaphore(s *int32, cdone chan bool) {
for i := 0; i < 1000; i++ {
semacquire(s);
semrelease(s);
@@ -19,7 +19,7 @@ export func HammerSemaphore(s *int32, cdone chan bool) {
cdone <- true;
}
-export func TestSemaphore(t *testing.T) {
+func TestSemaphore(t *testing.T) {
s := new(int32);
*s = 1;
c := make(chan bool);
@@ -32,7 +32,7 @@ export func TestSemaphore(t *testing.T) {
}
-export func HammerMutex(m *Mutex, cdone chan bool) {
+func HammerMutex(m *Mutex, cdone chan bool) {
for i := 0; i < 1000; i++ {
m.Lock();
m.Unlock();
@@ -40,7 +40,7 @@ export func HammerMutex(m *Mutex, cdone chan bool) {
cdone <- true;
}
-export func TestMutex(t *testing.T) {
+func TestMutex(t *testing.T) {
m := new(Mutex);
c := make(chan bool);
for i := 0; i < 10; i++ {
diff --git a/src/lib/syscall/errstr_darwin.go b/src/lib/syscall/errstr_darwin.go
index 65f970b67..780ce71b1 100644
--- a/src/lib/syscall/errstr_darwin.go
+++ b/src/lib/syscall/errstr_darwin.go
@@ -4,7 +4,7 @@
package syscall
-export const (
+const (
ENONE=0;
EPERM=1;
ENOENT=2;
@@ -234,7 +234,7 @@ func str(val int64) string { // do it here rather than with fmt to avoid depend
return string(buf)[i:len(buf)];
}
-export func Errstr(errno int64) string {
+func Errstr(errno int64) string {
if errno < 0 || errno >= len(error) {
return "Error " + str(errno)
}
diff --git a/src/lib/syscall/errstr_linux.go b/src/lib/syscall/errstr_linux.go
index df1f87e3e..2a6a5b813 100644
--- a/src/lib/syscall/errstr_linux.go
+++ b/src/lib/syscall/errstr_linux.go
@@ -4,7 +4,7 @@
package syscall
-export const (
+const (
ENONE=0;
EPERM=1;
ENOENT=2;
@@ -284,7 +284,7 @@ func str(val int64) string { // do it here rather than with fmt to avoid depend
return string(buf)[i:len(buf)];
}
-export func Errstr(errno int64) string {
+func Errstr(errno int64) string {
if errno < 0 || errno >= len(error) {
return "Error " + str(errno)
}
diff --git a/src/lib/syscall/file_darwin.go b/src/lib/syscall/file_darwin.go
index f11618226..f3e6c3163 100644
--- a/src/lib/syscall/file_darwin.go
+++ b/src/lib/syscall/file_darwin.go
@@ -13,40 +13,40 @@ import (
const nameBufsize = 512
-export func Open(name string, mode int64, perm int64) (ret int64, errno int64) {
+func Open(name string, mode int64, perm int64) (ret int64, errno int64) {
var namebuf [nameBufsize]byte;
if !StringToBytes(namebuf, name) {
return -1, ENAMETOOLONG
}
- r1, r2, err := Syscall(SYS_OPEN, int64(uintptr(unsafe.pointer(&namebuf[0]))), mode, perm);
+ r1, r2, err := Syscall(SYS_OPEN, int64(uintptr(unsafe.Pointer(&namebuf[0]))), mode, perm);
return r1, err;
}
-export func Creat(name string, perm int64) (ret int64, errno int64) {
+func Creat(name string, perm int64) (ret int64, errno int64) {
var namebuf [nameBufsize]byte;
if !StringToBytes(namebuf, name) {
return -1, ENAMETOOLONG
}
- r1, r2, err := Syscall(SYS_OPEN, int64(uintptr(unsafe.pointer(&namebuf[0]))), O_CREAT|O_WRONLY|O_TRUNC, perm);
+ r1, r2, err := Syscall(SYS_OPEN, int64(uintptr(unsafe.Pointer(&namebuf[0]))), O_CREAT|O_WRONLY|O_TRUNC, perm);
return r1, err;
}
-export func Close(fd int64) (ret int64, errno int64) {
+func Close(fd int64) (ret int64, errno int64) {
r1, r2, err := Syscall(SYS_CLOSE, fd, 0, 0);
return r1, err;
}
-export func Read(fd int64, buf *byte, nbytes int64) (ret int64, errno int64) {
- r1, r2, err := Syscall(SYS_READ, fd, int64(uintptr(unsafe.pointer(buf))), nbytes);
+func Read(fd int64, buf *byte, nbytes int64) (ret int64, errno int64) {
+ r1, r2, err := Syscall(SYS_READ, fd, int64(uintptr(unsafe.Pointer(buf))), nbytes);
return r1, err;
}
-export func Write(fd int64, buf *byte, nbytes int64) (ret int64, errno int64) {
- r1, r2, err := Syscall(SYS_WRITE, fd, int64(uintptr(unsafe.pointer(buf))), nbytes);
+func Write(fd int64, buf *byte, nbytes int64) (ret int64, errno int64) {
+ r1, r2, err := Syscall(SYS_WRITE, fd, int64(uintptr(unsafe.Pointer(buf))), nbytes);
return r1, err;
}
-export func Pipe(fds *[2]int64) (ret int64, errno int64) {
+func Pipe(fds *[2]int64) (ret int64, errno int64) {
r1, r2, err := Syscall(SYS_PIPE, 0, 0, 0);
if r1 < 0 {
return r1, err;
@@ -56,49 +56,49 @@ export func Pipe(fds *[2]int64) (ret int64, errno int64) {
return 0, 0;
}
-export func Stat(name string, buf *Stat_t) (ret int64, errno int64) {
+func Stat(name string, buf *Stat_t) (ret int64, errno int64) {
var namebuf [nameBufsize]byte;
if !StringToBytes(namebuf, name) {
return -1, ENAMETOOLONG
}
- r1, r2, err := Syscall(SYS_STAT64, int64(uintptr(unsafe.pointer(&namebuf[0]))), int64(uintptr(unsafe.pointer(buf))), 0);
+ r1, r2, err := Syscall(SYS_STAT64, int64(uintptr(unsafe.Pointer(&namebuf[0]))), int64(uintptr(unsafe.Pointer(buf))), 0);
return r1, err;
}
-export func Lstat(name *byte, buf *Stat_t) (ret int64, errno int64) {
- r1, r2, err := Syscall(SYS_LSTAT, int64(uintptr(unsafe.pointer(name))), int64(uintptr(unsafe.pointer(buf))), 0);
+func Lstat(name *byte, buf *Stat_t) (ret int64, errno int64) {
+ r1, r2, err := Syscall(SYS_LSTAT, int64(uintptr(unsafe.Pointer(name))), int64(uintptr(unsafe.Pointer(buf))), 0);
return r1, err;
}
-export func Fstat(fd int64, buf *Stat_t) (ret int64, errno int64) {
- r1, r2, err := Syscall(SYS_FSTAT, fd, int64(uintptr(unsafe.pointer(buf))), 0);
+func Fstat(fd int64, buf *Stat_t) (ret int64, errno int64) {
+ r1, r2, err := Syscall(SYS_FSTAT, fd, int64(uintptr(unsafe.Pointer(buf))), 0);
return r1, err;
}
-export func Unlink(name string) (ret int64, errno int64) {
+func Unlink(name string) (ret int64, errno int64) {
var namebuf [nameBufsize]byte;
if !StringToBytes(namebuf, name) {
return -1, ENAMETOOLONG
}
- r1, r2, err := Syscall(SYS_UNLINK, int64(uintptr(unsafe.pointer(&namebuf[0]))), 0, 0);
+ r1, r2, err := Syscall(SYS_UNLINK, int64(uintptr(unsafe.Pointer(&namebuf[0]))), 0, 0);
return r1, err;
}
-export func Fcntl(fd, cmd, arg int64) (ret int64, errno int64) {
+func Fcntl(fd, cmd, arg int64) (ret int64, errno int64) {
r1, r2, err := Syscall(SYS_FCNTL, fd, cmd, arg);
return r1, err
}
-export func Mkdir(name string, perm int64) (ret int64, errno int64) {
+func Mkdir(name string, perm int64) (ret int64, errno int64) {
var namebuf [nameBufsize]byte;
if !StringToBytes(namebuf, name) {
return -1, ENAMETOOLONG
}
- r1, r2, err := Syscall(SYS_MKDIR, int64(uintptr(unsafe.pointer(&namebuf[0]))), perm, 0);
+ r1, r2, err := Syscall(SYS_MKDIR, int64(uintptr(unsafe.Pointer(&namebuf[0]))), perm, 0);
return r1, err;
}
-export func Dup2(fd1, fd2 int64) (ret int64, errno int64) {
+func Dup2(fd1, fd2 int64) (ret int64, errno int64) {
r1, r2, err := Syscall(SYS_DUP2, fd1, fd2, 0);
return r1, err;
}
diff --git a/src/lib/syscall/file_linux.go b/src/lib/syscall/file_linux.go
index f048c1b71..ef30faac9 100644
--- a/src/lib/syscall/file_linux.go
+++ b/src/lib/syscall/file_linux.go
@@ -13,42 +13,42 @@ import (
const nameBufsize = 512
-export func Open(name string, mode int64, perm int64) (ret int64, errno int64) {
+func Open(name string, mode int64, perm int64) (ret int64, errno int64) {
var namebuf [nameBufsize]byte;
if !StringToBytes(namebuf, name) {
return -1, ENAMETOOLONG
}
- r1, r2, err := Syscall(SYS_OPEN, int64(uintptr(unsafe.pointer(&namebuf[0]))), mode, perm);
+ r1, r2, err := Syscall(SYS_OPEN, int64(uintptr(unsafe.Pointer(&namebuf[0]))), mode, perm);
return r1, err;
}
-export func Creat(name string, perm int64) (ret int64, errno int64) {
+func Creat(name string, perm int64) (ret int64, errno int64) {
var namebuf [nameBufsize]byte;
if !StringToBytes(namebuf, name) {
return -1, ENAMETOOLONG
}
- r1, r2, err := Syscall(SYS_OPEN, int64(uintptr(unsafe.pointer(&namebuf[0]))), O_CREAT|O_WRONLY|O_TRUNC, perm);
+ r1, r2, err := Syscall(SYS_OPEN, int64(uintptr(unsafe.Pointer(&namebuf[0]))), O_CREAT|O_WRONLY|O_TRUNC, perm);
return r1, err;
}
-export func Close(fd int64) (ret int64, errno int64) {
+func Close(fd int64) (ret int64, errno int64) {
r1, r2, err := Syscall(SYS_CLOSE, fd, 0, 0);
return r1, err;
}
-export func Read(fd int64, buf *byte, nbytes int64) (ret int64, errno int64) {
- r1, r2, err := Syscall(SYS_READ, fd, int64(uintptr(unsafe.pointer(buf))), nbytes);
+func Read(fd int64, buf *byte, nbytes int64) (ret int64, errno int64) {
+ r1, r2, err := Syscall(SYS_READ, fd, int64(uintptr(unsafe.Pointer(buf))), nbytes);
return r1, err;
}
-export func Write(fd int64, buf *byte, nbytes int64) (ret int64, errno int64) {
- r1, r2, err := Syscall(SYS_WRITE, fd, int64(uintptr(unsafe.pointer(buf))), nbytes);
+func Write(fd int64, buf *byte, nbytes int64) (ret int64, errno int64) {
+ r1, r2, err := Syscall(SYS_WRITE, fd, int64(uintptr(unsafe.Pointer(buf))), nbytes);
return r1, err;
}
-export func Pipe(fds *[2]int64) (ret int64, errno int64) {
+func Pipe(fds *[2]int64) (ret int64, errno int64) {
var t [2] int32;
- r1, r2, err := Syscall(SYS_PIPE, int64(uintptr(unsafe.pointer(&t[0]))), 0, 0);
+ r1, r2, err := Syscall(SYS_PIPE, int64(uintptr(unsafe.Pointer(&t[0]))), 0, 0);
if r1 < 0 {
return r1, err;
}
@@ -57,49 +57,49 @@ export func Pipe(fds *[2]int64) (ret int64, errno int64) {
return 0, 0;
}
-export func Stat(name string, buf *Stat_t) (ret int64, errno int64) {
+func Stat(name string, buf *Stat_t) (ret int64, errno int64) {
var namebuf [nameBufsize]byte;
if !StringToBytes(namebuf, name) {
return -1, ENAMETOOLONG
}
- r1, r2, err := Syscall(SYS_STAT, int64(uintptr(unsafe.pointer(&namebuf[0]))), int64(uintptr(unsafe.pointer(buf))), 0);
+ r1, r2, err := Syscall(SYS_STAT, int64(uintptr(unsafe.Pointer(&namebuf[0]))), int64(uintptr(unsafe.Pointer(buf))), 0);
return r1, err;
}
-export func Lstat(name *byte, buf *Stat_t) (ret int64, errno int64) {
- r1, r2, err := Syscall(SYS_LSTAT, int64(uintptr(unsafe.pointer(name))), int64(uintptr(unsafe.pointer(buf))), 0);
+func Lstat(name *byte, buf *Stat_t) (ret int64, errno int64) {
+ r1, r2, err := Syscall(SYS_LSTAT, int64(uintptr(unsafe.Pointer(name))), int64(uintptr(unsafe.Pointer(buf))), 0);
return r1, err;
}
-export func Fstat(fd int64, buf *Stat_t) (ret int64, errno int64) {
- r1, r2, err := Syscall(SYS_FSTAT, fd, int64(uintptr(unsafe.pointer(buf))), 0);
+func Fstat(fd int64, buf *Stat_t) (ret int64, errno int64) {
+ r1, r2, err := Syscall(SYS_FSTAT, fd, int64(uintptr(unsafe.Pointer(buf))), 0);
return r1, err;
}
-export func Unlink(name string) (ret int64, errno int64) {
+func Unlink(name string) (ret int64, errno int64) {
var namebuf [nameBufsize]byte;
if !StringToBytes(namebuf, name) {
return -1, ENAMETOOLONG
}
- r1, r2, err := Syscall(SYS_UNLINK, int64(uintptr(unsafe.pointer(&namebuf[0]))), 0, 0);
+ r1, r2, err := Syscall(SYS_UNLINK, int64(uintptr(unsafe.Pointer(&namebuf[0]))), 0, 0);
return r1, err;
}
-export func Fcntl(fd, cmd, arg int64) (ret int64, errno int64) {
+func Fcntl(fd, cmd, arg int64) (ret int64, errno int64) {
r1, r2, err := Syscall(SYS_FCNTL, fd, cmd, arg);
return r1, err
}
-export func Mkdir(name string, perm int64) (ret int64, errno int64) {
+func Mkdir(name string, perm int64) (ret int64, errno int64) {
var namebuf [nameBufsize]byte;
if !StringToBytes(namebuf, name) {
return -1, ENAMETOOLONG
}
- r1, r2, err := Syscall(SYS_MKDIR, int64(uintptr(unsafe.pointer(&namebuf[0]))), perm, 0);
+ r1, r2, err := Syscall(SYS_MKDIR, int64(uintptr(unsafe.Pointer(&namebuf[0]))), perm, 0);
return r1, err;
}
-export func Dup2(fd1, fd2 int64) (ret int64, errno int64) {
+func Dup2(fd1, fd2 int64) (ret int64, errno int64) {
r1, r2, err := Syscall(SYS_DUP2, fd1, fd2, 0);
return r1, err;
}
diff --git a/src/lib/syscall/signal_amd64_darwin.go b/src/lib/syscall/signal_amd64_darwin.go
index 892255eea..3d96b3fdc 100644
--- a/src/lib/syscall/signal_amd64_darwin.go
+++ b/src/lib/syscall/signal_amd64_darwin.go
@@ -7,7 +7,7 @@
package syscall
-export const(
+const(
SIGHUP = 1;
SIGINT = 2;
SIGQUIT = 3;
diff --git a/src/lib/syscall/signal_amd64_linux.go b/src/lib/syscall/signal_amd64_linux.go
index af55028dc..500666a8f 100644
--- a/src/lib/syscall/signal_amd64_linux.go
+++ b/src/lib/syscall/signal_amd64_linux.go
@@ -7,7 +7,7 @@
package syscall
-export const(
+const(
SIGHUP = 1;
SIGINT = 2;
SIGQUIT = 3;
diff --git a/src/lib/syscall/socket_darwin.go b/src/lib/syscall/socket_darwin.go
index c4323a6ba..a0567e5c3 100644
--- a/src/lib/syscall/socket_darwin.go
+++ b/src/lib/syscall/socket_darwin.go
@@ -12,38 +12,38 @@ import (
"unsafe";
)
-export func SockaddrToSockaddrInet4(s *Sockaddr) *SockaddrInet4;
-export func SockaddrToSockaddrInet6(s *Sockaddr) *SockaddrInet6;
-export func SockaddrInet4ToSockaddr(s *SockaddrInet4) *Sockaddr;
-export func SockaddrInet6ToSockaddr(s *SockaddrInet6) *Sockaddr;
+func SockaddrToSockaddrInet4(s *Sockaddr) *SockaddrInet4;
+func SockaddrToSockaddrInet6(s *Sockaddr) *SockaddrInet6;
+func SockaddrInet4ToSockaddr(s *SockaddrInet4) *Sockaddr;
+func SockaddrInet6ToSockaddr(s *SockaddrInet6) *Sockaddr;
-export func Socket(domain, proto, typ int64) (ret int64, err int64) {
+func Socket(domain, proto, typ int64) (ret int64, err int64) {
r1, r2, e := Syscall(SYS_SOCKET, domain, proto, typ);
return r1, e
}
-export func Connect(fd int64, sa *Sockaddr) (ret int64, err int64) {
- r1, r2, e := Syscall(SYS_CONNECT, fd, int64(uintptr(unsafe.pointer(sa))), int64(sa.Len));
+func Connect(fd int64, sa *Sockaddr) (ret int64, err int64) {
+ r1, r2, e := Syscall(SYS_CONNECT, fd, int64(uintptr(unsafe.Pointer(sa))), int64(sa.Len));
return r1, e
}
-export func Bind(fd int64, sa *Sockaddr) (ret int64, err int64) {
- r1, r2, e := Syscall(SYS_BIND, fd, int64(uintptr(unsafe.pointer(sa))), int64(sa.Len));
+func Bind(fd int64, sa *Sockaddr) (ret int64, err int64) {
+ r1, r2, e := Syscall(SYS_BIND, fd, int64(uintptr(unsafe.Pointer(sa))), int64(sa.Len));
return r1, e
}
-export func Listen(fd, n int64) (ret int64, err int64) {
+func Listen(fd, n int64) (ret int64, err int64) {
r1, r2, e := Syscall(SYS_LISTEN, fd, n, 0);
return r1, e
}
-export func Accept(fd int64, sa *Sockaddr) (ret int64, err int64) {
+func Accept(fd int64, sa *Sockaddr) (ret int64, err int64) {
var n int32 = SizeofSockaddr;
- r1, r2, e := Syscall(SYS_ACCEPT, fd, int64(uintptr(unsafe.pointer(sa))), int64(uintptr(unsafe.pointer(&n))));
+ r1, r2, e := Syscall(SYS_ACCEPT, fd, int64(uintptr(unsafe.Pointer(sa))), int64(uintptr(unsafe.Pointer(&n))));
return r1, e
}
-export func Setsockopt(fd, level, opt, valueptr, length int64) (ret int64, err int64) {
+func Setsockopt(fd, level, opt, valueptr, length int64) (ret int64, err int64) {
if fd < 0 {
return -1, EINVAL
}
@@ -51,22 +51,22 @@ export func Setsockopt(fd, level, opt, valueptr, length int64) (ret int64, err i
return r1, e
}
-export func Setsockopt_int(fd, level, opt int64, value int) int64 {
+func Setsockopt_int(fd, level, opt int64, value int) int64 {
var n int32 = int32(opt);
- r1, e := Setsockopt(fd, level, opt, int64(uintptr(unsafe.pointer(&n))), 4);
+ r1, e := Setsockopt(fd, level, opt, int64(uintptr(unsafe.Pointer(&n))), 4);
return e
}
-export func Setsockopt_tv(fd, level, opt, nsec int64) int64 {
+func Setsockopt_tv(fd, level, opt, nsec int64) int64 {
var tv Timeval;
nsec += 999;
tv.Sec = int64(nsec/1000000000);
tv.Usec = uint32(nsec%1000000000);
- r1, e := Setsockopt(fd, level, opt, int64(uintptr(unsafe.pointer(&tv))), 4);
+ r1, e := Setsockopt(fd, level, opt, int64(uintptr(unsafe.Pointer(&tv))), 4);
return e
}
-export func Setsockopt_linger(fd, level, opt int64, sec int) int64 {
+func Setsockopt_linger(fd, level, opt int64, sec int) int64 {
var l Linger;
if sec != 0 {
l.Yes = 1;
@@ -75,38 +75,38 @@ export func Setsockopt_linger(fd, level, opt int64, sec int) int64 {
l.Yes = 0;
l.Sec = 0;
}
- r1, err := Setsockopt(fd, level, opt, int64(uintptr(unsafe.pointer(&l))), 8);
+ r1, err := Setsockopt(fd, level, opt, int64(uintptr(unsafe.Pointer(&l))), 8);
return err
}
/*
-export func Getsockopt(fd, level, opt, valueptr, lenptr int64) (ret int64, errno int64) {
+func Getsockopt(fd, level, opt, valueptr, lenptr int64) (ret int64, errno int64) {
r1, r2, err := Syscall6(SYS_GETSOCKOPT, fd, level, opt, valueptr, lenptr, 0);
return r1, err;
}
*/
-export func Kqueue() (ret int64, errno int64) {
+func Kqueue() (ret int64, errno int64) {
r1, r2, err := Syscall(SYS_KQUEUE, 0, 0, 0);
return r1, err
}
-export func Kevent(kq int64, changes, events []Kevent_t, timeout *Timespec) (ret int64, errno int64) {
+func Kevent(kq int64, changes, events []Kevent_t, timeout *Timespec) (ret int64, errno int64) {
var nchange, changeptr, nevent, eventptr int64;
nchange = 0;
changeptr = 0;
nevent = 0;
eventptr = 0;
if len(changes) > 0 {
- changeptr = int64(uintptr(unsafe.pointer(&changes[0])));
+ changeptr = int64(uintptr(unsafe.Pointer(&changes[0])));
nchange = int64(len(changes))
}
if len(events) > 0 {
- eventptr = int64(uintptr(unsafe.pointer(&events[0])));
+ eventptr = int64(uintptr(unsafe.Pointer(&events[0])));
nevent = int64(len(events))
}
r1, r2, err := Syscall6(SYS_KEVENT, kq, changeptr, nchange,
- eventptr, nevent, int64(uintptr(unsafe.pointer(timeout))));
+ eventptr, nevent, int64(uintptr(unsafe.Pointer(timeout))));
return r1, err
}
diff --git a/src/lib/syscall/socket_linux.go b/src/lib/syscall/socket_linux.go
index 458e363f6..a06157784 100644
--- a/src/lib/syscall/socket_linux.go
+++ b/src/lib/syscall/socket_linux.go
@@ -12,10 +12,10 @@ import (
"unsafe";
)
-export func SockaddrToSockaddrInet4(s *Sockaddr) *SockaddrInet4;
-export func SockaddrToSockaddrInet6(s *Sockaddr) *SockaddrInet6;
-export func SockaddrInet4ToSockaddr(s *SockaddrInet4) *Sockaddr;
-export func SockaddrInet6ToSockaddr(s *SockaddrInet6) *Sockaddr;
+func SockaddrToSockaddrInet4(s *Sockaddr) *SockaddrInet4;
+func SockaddrToSockaddrInet6(s *Sockaddr) *SockaddrInet6;
+func SockaddrInet4ToSockaddr(s *SockaddrInet4) *Sockaddr;
+func SockaddrInet6ToSockaddr(s *SockaddrInet6) *Sockaddr;
func saLen(s *Sockaddr) int64 {
switch s.Family {
@@ -29,33 +29,33 @@ func saLen(s *Sockaddr) int64 {
return 0
}
-export func Socket(domain, proto, typ int64) (ret int64, err int64) {
+func Socket(domain, proto, typ int64) (ret int64, err int64) {
r1, r2, e := Syscall(SYS_SOCKET, domain, proto, typ);
return r1, e
}
-export func Connect(fd int64, sa *Sockaddr) (ret int64, err int64) {
- r1, r2, e := Syscall(SYS_CONNECT, fd, int64(uintptr(unsafe.pointer(sa))), saLen(sa));
+func Connect(fd int64, sa *Sockaddr) (ret int64, err int64) {
+ r1, r2, e := Syscall(SYS_CONNECT, fd, int64(uintptr(unsafe.Pointer(sa))), saLen(sa));
return r1, e
}
-export func Bind(fd int64, sa *Sockaddr) (ret int64, err int64) {
- r1, r2, e := Syscall(SYS_BIND, fd, int64(uintptr(unsafe.pointer(sa))), saLen(sa));
+func Bind(fd int64, sa *Sockaddr) (ret int64, err int64) {
+ r1, r2, e := Syscall(SYS_BIND, fd, int64(uintptr(unsafe.Pointer(sa))), saLen(sa));
return r1, e
}
-export func Listen(fd, n int64) (ret int64, err int64) {
+func Listen(fd, n int64) (ret int64, err int64) {
r1, r2, e := Syscall(SYS_LISTEN, fd, n, 0);
return r1, e
}
-export func Accept(fd int64, sa *Sockaddr) (ret int64, err int64) {
+func Accept(fd int64, sa *Sockaddr) (ret int64, err int64) {
var n int32 = SizeofSockaddr;
- r1, r2, e := Syscall(SYS_ACCEPT, fd, int64(uintptr(unsafe.pointer(sa))), int64(uintptr(unsafe.pointer(&n))));
+ r1, r2, e := Syscall(SYS_ACCEPT, fd, int64(uintptr(unsafe.Pointer(sa))), int64(uintptr(unsafe.Pointer(&n))));
return r1, e
}
-export func Setsockopt(fd, level, opt, valueptr, length int64) (ret int64, err int64) {
+func Setsockopt(fd, level, opt, valueptr, length int64) (ret int64, err int64) {
if fd < 0 {
return -1, EINVAL
}
@@ -63,22 +63,22 @@ export func Setsockopt(fd, level, opt, valueptr, length int64) (ret int64, err i
return r1, e
}
-export func Setsockopt_int(fd, level, opt int64, value int) int64 {
+func Setsockopt_int(fd, level, opt int64, value int) int64 {
n := int32(opt);
- r1, e := Setsockopt(fd, level, opt, int64(uintptr(unsafe.pointer(&n))), 4);
+ r1, e := Setsockopt(fd, level, opt, int64(uintptr(unsafe.Pointer(&n))), 4);
return e
}
-export func Setsockopt_tv(fd, level, opt, nsec int64) int64 {
+func Setsockopt_tv(fd, level, opt, nsec int64) int64 {
var tv Timeval;
nsec += 999;
tv.Sec = int64(nsec/1000000000);
tv.Usec = uint64(nsec%1000000000);
- r1, e := Setsockopt(fd, level, opt, int64(uintptr(unsafe.pointer(&tv))), 4);
+ r1, e := Setsockopt(fd, level, opt, int64(uintptr(unsafe.Pointer(&tv))), 4);
return e
}
-export func Setsockopt_linger(fd, level, opt int64, sec int) int64 {
+func Setsockopt_linger(fd, level, opt int64, sec int) int64 {
var l Linger;
if sec != 0 {
l.Yes = 1;
@@ -87,32 +87,32 @@ export func Setsockopt_linger(fd, level, opt int64, sec int) int64 {
l.Yes = 0;
l.Sec = 0
}
- r1, err := Setsockopt(fd, level, opt, int64(uintptr(unsafe.pointer(&l))), 8);
+ r1, err := Setsockopt(fd, level, opt, int64(uintptr(unsafe.Pointer(&l))), 8);
return err
}
/*
-export func getsockopt(fd, level, opt, valueptr, lenptr int64) (ret int64, errno int64) {
+func getsockopt(fd, level, opt, valueptr, lenptr int64) (ret int64, errno int64) {
r1, r2, err := Syscall6(GETSOCKOPT, fd, level, opt, valueptr, lenptr, 0);
return r1, err;
}
*/
-export func Epoll_create(size int64) (ret int64, errno int64) {
+func Epoll_create(size int64) (ret int64, errno int64) {
r1, r2, err := syscall.Syscall(SYS_EPOLL_CREATE, size, 0, 0);
return r1, err
}
-export func Epoll_ctl(epfd, op, fd int64, ev *EpollEvent) int64 {
- r1, r2, err := syscall.Syscall6(SYS_EPOLL_CTL, epfd, op, fd, int64(uintptr(unsafe.pointer(ev))), 0, 0);
+func Epoll_ctl(epfd, op, fd int64, ev *EpollEvent) int64 {
+ r1, r2, err := syscall.Syscall6(SYS_EPOLL_CTL, epfd, op, fd, int64(uintptr(unsafe.Pointer(ev))), 0, 0);
return err
}
-export func Epoll_wait(epfd int64, ev []EpollEvent, msec int64) (ret int64, err int64) {
+func Epoll_wait(epfd int64, ev []EpollEvent, msec int64) (ret int64, err int64) {
var evptr, nev int64;
if ev != nil && len(ev) > 0 {
nev = int64(len(ev));
- evptr = int64(uintptr(unsafe.pointer(&ev[0])))
+ evptr = int64(uintptr(unsafe.Pointer(&ev[0])))
}
r1, r2, err1 := syscall.Syscall6(SYS_EPOLL_WAIT, epfd, evptr, nev, msec, 0, 0);
return r1, err1
diff --git a/src/lib/syscall/syscall.go b/src/lib/syscall/syscall.go
index 9cef40d25..780f0f262 100644
--- a/src/lib/syscall/syscall.go
+++ b/src/lib/syscall/syscall.go
@@ -8,15 +8,15 @@ package syscall
* Foundation of system call interface.
*/
-export func Syscall(trap int64, a1, a2, a3 int64) (r1, r2, err int64);
-export func Syscall6(trap int64, a1, a2, a3, a4, a5, a6 int64) (r1, r2, err int64);
-export func RawSyscall(trap int64, a1, a2, a3 int64) (r1, r2, err int64);
+func Syscall(trap int64, a1, a2, a3 int64) (r1, r2, err int64);
+func Syscall6(trap int64, a1, a2, a3, a4, a5, a6 int64) (r1, r2, err int64);
+func RawSyscall(trap int64, a1, a2, a3 int64) (r1, r2, err int64);
/*
* Used to convert file names to byte arrays for passing to kernel,
* but useful elsewhere too.
*/
-export func StringToBytes(b []byte, s string) bool {
+func StringToBytes(b []byte, s string) bool {
if len(s) >= len(b) {
return false
}
diff --git a/src/lib/syscall/syscall_amd64_darwin.go b/src/lib/syscall/syscall_amd64_darwin.go
index c3f72d857..b378f56e0 100644
--- a/src/lib/syscall/syscall_amd64_darwin.go
+++ b/src/lib/syscall/syscall_amd64_darwin.go
@@ -7,7 +7,7 @@
package syscall
-export const (
+const (
// SYS_NOSYS = 0; // { int nosys(void); } { indirect syscall }
SYS_EXIT = 1; // { void exit(int rval); }
SYS_FORK = 2; // { int fork(void); }
diff --git a/src/lib/syscall/syscall_amd64_linux.go b/src/lib/syscall/syscall_amd64_linux.go
index 1e1f498dd..cd75cb53c 100644
--- a/src/lib/syscall/syscall_amd64_linux.go
+++ b/src/lib/syscall/syscall_amd64_linux.go
@@ -7,7 +7,7 @@
package syscall
-export const(
+const(
SYS_READ = 0;
SYS_WRITE = 1;
SYS_OPEN = 2;
diff --git a/src/lib/syscall/time_amd64_darwin.go b/src/lib/syscall/time_amd64_darwin.go
index 4e55c8ddd..8253171ca 100644
--- a/src/lib/syscall/time_amd64_darwin.go
+++ b/src/lib/syscall/time_amd64_darwin.go
@@ -6,7 +6,7 @@ package syscall
import syscall "syscall"
-export func Gettimeofday() (sec, nsec, errno int64) {
+func Gettimeofday() (sec, nsec, errno int64) {
// The "1" in the call is the timeval pointer, which must be
// non-zero but is otherwise unused. The results
// are returned in r1, r2.
@@ -17,7 +17,7 @@ export func Gettimeofday() (sec, nsec, errno int64) {
return r1, r2*1000, 0
}
-export func Nstotimeval(ns int64, tv *Timeval) {
+func Nstotimeval(ns int64, tv *Timeval) {
ns += 999; // round up
tv.Sec = int64(ns/1000000000);
tv.Usec = uint32(ns%1000000000 / 1000);
diff --git a/src/lib/syscall/time_amd64_linux.go b/src/lib/syscall/time_amd64_linux.go
index 17e885111..67fc51231 100644
--- a/src/lib/syscall/time_amd64_linux.go
+++ b/src/lib/syscall/time_amd64_linux.go
@@ -9,16 +9,16 @@ import (
"unsafe";
)
-export func Gettimeofday() (sec, nsec, errno int64) {
+func Gettimeofday() (sec, nsec, errno int64) {
var tv Timeval;
- r1, r2, e := Syscall(SYS_GETTIMEOFDAY, int64(uintptr(unsafe.pointer(&tv))), 0, 0);
+ r1, r2, e := Syscall(SYS_GETTIMEOFDAY, int64(uintptr(unsafe.Pointer(&tv))), 0, 0);
if e != 0 {
return 0, 0, e
}
return int64(tv.Sec), int64(tv.Usec*1000), 0
}
-export func Nstotimeval(ns int64, tv *Timeval) {
+func Nstotimeval(ns int64, tv *Timeval) {
ns += 999; // round up
tv.Sec = int64(ns/1000000000);
tv.Usec = uint64(ns%1000000000 / 1000);
diff --git a/src/lib/syscall/types_amd64_darwin.go b/src/lib/syscall/types_amd64_darwin.go
index b5120197e..963759bc6 100644
--- a/src/lib/syscall/types_amd64_darwin.go
+++ b/src/lib/syscall/types_amd64_darwin.go
@@ -10,12 +10,12 @@ package syscall
// Time
-export type Timespec struct {
+type Timespec struct {
Sec int64;
Nsec uint64;
}
-export type Timeval struct {
+type Timeval struct {
Sec int64;
Usec uint32;
}
@@ -23,7 +23,7 @@ export type Timeval struct {
// Processes
-export type Rusage struct {
+type Rusage struct {
Utime Timeval;
Stime Timeval;
Maxrss int64;
@@ -45,7 +45,7 @@ export type Rusage struct {
// Files
-export const (
+const (
O_RDONLY = 0x0;
O_WRONLY = 0x1;
O_RDWR = 0x2;
@@ -67,7 +67,7 @@ export const (
FD_CLOEXEC = 1;
)
-export type Stat_t struct {
+type Stat_t struct {
Dev uint32;
Mode uint16;
Nlink uint16;
@@ -92,7 +92,7 @@ export type Stat_t struct {
// Sockets
-export const (
+const (
AF_UNIX = 1;
AF_INET = 2;
AF_DATAKIT = 9;
@@ -127,23 +127,23 @@ export const (
SOMAXCONN = 128;
)
-export type SockaddrUnix struct {
+type SockaddrUnix struct {
Len byte;
Family byte;
Path [104]byte
}
-export const SizeofSockaddrUnix = 106
+const SizeofSockaddrUnix = 106
-export type SockaddrInet4 struct {
+type SockaddrInet4 struct {
Len byte;
Family byte;
Port [2]byte;
Addr [4]byte;
Zero [8]byte
}
-export const SizeofSockaddrInet4 = 16
+const SizeofSockaddrInet4 = 16
-export type SockaddrInet6 struct {
+type SockaddrInet6 struct {
Len byte;
Family byte;
Port [2]byte;
@@ -151,16 +151,16 @@ export type SockaddrInet6 struct {
Addr [16]byte;
Scopeid [4]byte;
}
-export const SizeofSockaddrInet6 = 28
+const SizeofSockaddrInet6 = 28
-export type Sockaddr struct {
+type Sockaddr struct {
Len byte;
Family byte;
Opaque [126]byte
}
-export const SizeofSockaddr = 128
+const SizeofSockaddr = 128
-export type Linger struct {
+type Linger struct {
Yes int32;
Sec int32;
}
@@ -168,7 +168,7 @@ export type Linger struct {
// Events (kqueue, kevent)
-export const (
+const (
// filters
EVFILT_READ = -1;
EVFILT_WRITE = -2;
@@ -201,7 +201,7 @@ export const (
EV_ERROR = 0x4000
)
-export type Kevent_t struct {
+type Kevent_t struct {
Ident int64;
Filter int16;
Flags uint16;
diff --git a/src/lib/syscall/types_amd64_linux.go b/src/lib/syscall/types_amd64_linux.go
index 371f839ab..2961a338a 100644
--- a/src/lib/syscall/types_amd64_linux.go
+++ b/src/lib/syscall/types_amd64_linux.go
@@ -10,12 +10,12 @@ package syscall
// Time
-export type Timespec struct {
+type Timespec struct {
Sec int64;
Nsec uint64;
}
-export type Timeval struct {
+type Timeval struct {
Sec int64;
Usec uint64;
}
@@ -23,7 +23,7 @@ export type Timeval struct {
// Processes
-export type Rusage struct {
+type Rusage struct {
Utime Timeval;
Stime Timeval;
Maxrss int64;
@@ -45,7 +45,7 @@ export type Rusage struct {
// Files
-export const (
+const (
O_RDONLY = 0x0;
O_WRONLY = 0x1;
O_RDWR = 0x2;
@@ -67,7 +67,7 @@ export const (
FD_CLOEXEC = 1;
)
-export type Stat_t struct {
+type Stat_t struct {
Dev uint64;
Ino uint64;
Nlink uint64;
@@ -88,7 +88,7 @@ export type Stat_t struct {
// Sockets
-export const (
+const (
AF_UNIX = 1;
AF_INET = 2;
AF_INET6 = 10;
@@ -133,36 +133,36 @@ export const (
SOMAXCONN = 128;
)
-export type SockaddrUnix struct {
+type SockaddrUnix struct {
Family uint16;
Path [108]byte
}
-export const SizeofSockaddrUnix = 110
+const SizeofSockaddrUnix = 110
-export type SockaddrInet4 struct {
+type SockaddrInet4 struct {
Family uint16;
Port [2]byte;
Addr [4]byte;
Zero [8]byte
}
-export const SizeofSockaddrInet4 = 16
+const SizeofSockaddrInet4 = 16
-export type SockaddrInet6 struct {
+type SockaddrInet6 struct {
Family uint16;
Port [2]byte;
Flowinfo [4]byte;
Addr [16]byte;
Scopeid [4]byte;
}
-export const SizeofSockaddrInet6 = 28
+const SizeofSockaddrInet6 = 28
-export type Sockaddr struct {
+type Sockaddr struct {
Family uint16;
Opaque [126]byte
}
-export const SizeofSockaddr = 128
+const SizeofSockaddr = 128
-export type Linger struct {
+type Linger struct {
Yes int32;
Sec int32;
}
@@ -170,7 +170,7 @@ export type Linger struct {
// Events (epoll)
-export const (
+const (
// EpollEvent.events
EPOLLIN = 0x1;
EPOLLOUT = 0x4;
@@ -186,7 +186,7 @@ export const (
EPOLL_CTL_DEL = 0x2;
)
-export type EpollEvent struct {
+type EpollEvent struct {
Events uint32;
Fd int32;
Pad int32;
diff --git a/src/lib/tabwriter/tabwriter.go b/src/lib/tabwriter/tabwriter.go
index bfd552441..9a3eeb9a2 100644
--- a/src/lib/tabwriter/tabwriter.go
+++ b/src/lib/tabwriter/tabwriter.go
@@ -93,7 +93,7 @@ func (b *byteArray) append(s []byte) {
// filter_html ignores html tags and handles entities (starting with '&'
// and ending in ';') as single characters (width = 1)
-export type Writer struct {
+type Writer struct {
// TODO should not export any of the fields
// configuration
writer io.Write;
@@ -445,6 +445,6 @@ func (b *Writer) append(buf []byte) {
}
-export func New(writer io.Write, cellwidth, padding int, padchar byte, align_left, filter_html bool) *Writer {
+func New(writer io.Write, cellwidth, padding int, padchar byte, align_left, filter_html bool) *Writer {
return new(Writer).Init(writer, cellwidth, padding, padchar, align_left, filter_html)
}
diff --git a/src/lib/tabwriter/tabwriter_test.go b/src/lib/tabwriter/tabwriter_test.go
index 064772611..d06c409f5 100644
--- a/src/lib/tabwriter/tabwriter_test.go
+++ b/src/lib/tabwriter/tabwriter_test.go
@@ -103,7 +103,7 @@ func check(t *testing.T, tabwidth, padding int, padchar byte, align_left, filter
}
-export func Test(t *testing.T) {
+func Test(t *testing.T) {
check(
t, 8, 1, '.', true, false,
"",
diff --git a/src/lib/testing.go b/src/lib/testing.go
index 01924ef44..1ab85839b 100644
--- a/src/lib/testing.go
+++ b/src/lib/testing.go
@@ -21,7 +21,7 @@ func tabify(s string) string {
return s
}
-export type T struct {
+type T struct {
errors string;
failed bool;
ch chan *T;
@@ -69,7 +69,7 @@ func (t *T) Fatalf(format string, args ...) {
t.FailNow();
}
-export type Test struct {
+type Test struct {
Name string;
F *(*T);
}
@@ -79,7 +79,7 @@ func tRunner(t *T, test *Test) {
t.ch <- t;
}
-export func Main(tests []Test) {
+func Main(tests []Test) {
flag.Parse();
ok := true;
if len(tests) == 0 {
diff --git a/src/lib/time/tick.go b/src/lib/time/tick.go
index f200f30dd..814e2bac1 100644
--- a/src/lib/time/tick.go
+++ b/src/lib/time/tick.go
@@ -43,13 +43,13 @@ func ticker(ns int64, c chan int64) {
}
syscall.Nstotimeval(when - now, &tv);
- syscall.Syscall6(syscall.SYS_SELECT, 0, 0, 0, 0, int64(uintptr(unsafe.pointer(&tv))), 0);
+ syscall.Syscall6(syscall.SYS_SELECT, 0, 0, 0, 0, int64(uintptr(unsafe.Pointer(&tv))), 0);
now = time.Nanoseconds();
c <- now;
}
}
-export func Tick(ns int64) chan int64 {
+func Tick(ns int64) chan int64 {
if ns <= 0 {
return nil
}
diff --git a/src/lib/time/tick_test.go b/src/lib/time/tick_test.go
index 79038dcf8..0667be679 100644
--- a/src/lib/time/tick_test.go
+++ b/src/lib/time/tick_test.go
@@ -9,7 +9,7 @@ import (
"time";
)
-export func TestTick(t *testing.T) {
+func TestTick(t *testing.T) {
const (
Delta = 100*1e6;
Count = 10;
diff --git a/src/lib/time/time.go b/src/lib/time/time.go
index 9421eeae5..2af56f453 100644
--- a/src/lib/time/time.go
+++ b/src/lib/time/time.go
@@ -10,7 +10,7 @@ import (
)
// Seconds since January 1, 1970 00:00:00 GMT
-export func Seconds() int64 {
+func Seconds() int64 {
sec, nsec, err := os.Time();
if err != nil {
panic("time: os.Time: ", err.String());
@@ -19,7 +19,7 @@ export func Seconds() int64 {
}
// Nanoseconds since January 1, 1970 00:00:00 GMT
-export func Nanoseconds() int64 {
+func Nanoseconds() int64 {
sec, nsec, err := os.Time();
if err != nil {
panic("time: os.Time: ", err.String());
@@ -27,7 +27,7 @@ export func Nanoseconds() int64 {
return sec*1e9 + nsec
}
-export const (
+const (
Sunday = iota;
Monday;
Tuesday;
@@ -37,7 +37,7 @@ export const (
Saturday;
)
-export type Time struct {
+type Time struct {
year int64; // 2008 is 2008
month, day int; // Sep-17 is 9, 17
hour, minute, second int; // 10:43:12 is 10, 43, 12
@@ -70,7 +70,7 @@ const (
_Days1970To2001 = 31*365+8;
)
-export func SecondsToUTC(sec int64) *Time {
+func SecondsToUTC(sec int64) *Time {
t := new(Time);
// Split into time and day.
@@ -143,12 +143,12 @@ export func SecondsToUTC(sec int64) *Time {
return t;
}
-export func UTC() *Time {
+func UTC() *Time {
return SecondsToUTC(Seconds())
}
// TODO: Should this return an error?
-export func SecondsToLocalTime(sec int64) *Time {
+func SecondsToLocalTime(sec int64) *Time {
zone, offset, err := time.LookupTimezone(sec);
if err != nil {
return SecondsToUTC(sec)
@@ -159,7 +159,7 @@ export func SecondsToLocalTime(sec int64) *Time {
return t
}
-export func LocalTime() *Time {
+func LocalTime() *Time {
return SecondsToLocalTime(Seconds())
}
diff --git a/src/lib/time/time_test.go b/src/lib/time/time_test.go
index 61f0608ad..feff13a48 100644
--- a/src/lib/time/time_test.go
+++ b/src/lib/time/time_test.go
@@ -41,7 +41,7 @@ func _Same(t, u *Time) bool {
&& t.zone == u.zone
}
-export func TestSecondsToUTC(t *testing.T) {
+func TestSecondsToUTC(t *testing.T) {
for i := 0; i < len(utctests); i++ {
sec := utctests[i].seconds;
golden := &utctests[i].golden;
@@ -58,7 +58,7 @@ export func TestSecondsToUTC(t *testing.T) {
}
}
-export func TestSecondsToLocalTime(t *testing.T) {
+func TestSecondsToLocalTime(t *testing.T) {
for i := 0; i < len(localtests); i++ {
sec := localtests[i].seconds;
golden := &localtests[i].golden;
diff --git a/src/lib/time/zoneinfo.go b/src/lib/time/zoneinfo.go
index 6f2a1f315..e43547c5e 100644
--- a/src/lib/time/zoneinfo.go
+++ b/src/lib/time/zoneinfo.go
@@ -20,7 +20,7 @@ const (
_HeaderSize = 4+16+4*7
)
-export var (
+var (
BadZoneinfo = os.NewError("time: malformed zoneinfo");
NoZoneinfo = os.NewError("time: unknown time zone")
)
@@ -250,7 +250,7 @@ func _SetupZone() {
zones, zoneerr = readinfofile("/etc/localtime");
}
-export func LookupTimezone(sec int64) (zone string, offset int, err *os.Error) {
+func LookupTimezone(sec int64) (zone string, offset int, err *os.Error) {
once.Do(&_SetupZone);
if zoneerr != nil || len(zones) == 0 {
return "GMT", 0, zoneerr
diff --git a/src/lib/unicode/letter.go b/src/lib/unicode/letter.go
index 6846e3ec2..3b1221b87 100644
--- a/src/lib/unicode/letter.go
+++ b/src/lib/unicode/letter.go
@@ -12,13 +12,13 @@
package unicode
-export type Range struct {
+type Range struct {
lo int;
hi int;
stride int;
}
-export var Upper = []Range{
+var Upper = []Range{
Range{0x0041, 0x005a, 1},
Range{0x00c0, 0x00d6, 1},
Range{0x00d8, 0x00de, 1},
@@ -150,7 +150,7 @@ export var Upper = []Range{
Range{0x1d7ca, 0x1d7ca, 1},
}
-export var Letter = []Range {
+var Letter = []Range {
Range{0x0041, 0x005a, 1},
Range{0x0061, 0x007a, 1},
Range{0x00aa, 0x00b5, 11},
@@ -525,7 +525,7 @@ export var Letter = []Range {
Range{0x2f800, 0x2fa1d, 1},
}
-export func Is(ranges []Range, rune int) bool {
+func Is(ranges []Range, rune int) bool {
// common case: rune is ASCII or Latin-1
if rune < 0x100 {
for i := 0; i < len(ranges); i++ {
@@ -559,11 +559,11 @@ export func Is(ranges []Range, rune int) bool {
return false;
}
-export func IsUpper(rune int) bool {
+func IsUpper(rune int) bool {
return Is(Upper, rune);
}
-export func IsLetter(rune int) bool {
+func IsLetter(rune int) bool {
return Is(Letter, rune);
}
diff --git a/src/lib/unicode/letter_test.go b/src/lib/unicode/letter_test.go
index 42f5df42a..d39d74e6b 100644
--- a/src/lib/unicode/letter_test.go
+++ b/src/lib/unicode/letter_test.go
@@ -92,7 +92,7 @@ var notletter = []int{
0x10ffff,
}
-export func TestIsLetter(t *testing.T) {
+func TestIsLetter(t *testing.T) {
for i, r := range(upper) {
if !IsLetter(r) {
t.Errorf("IsLetter(%#x) = false, want true\n", r);
@@ -110,7 +110,7 @@ export func TestIsLetter(t *testing.T) {
}
}
-export func TestIsUpper(t *testing.T) {
+func TestIsUpper(t *testing.T) {
for i, r := range(upper) {
if !IsUpper(r) {
t.Errorf("IsUpper(%#x) = false, want true\n", r);
diff --git a/src/lib/utf8.go b/src/lib/utf8.go
index a81988917..aada1c417 100644
--- a/src/lib/utf8.go
+++ b/src/lib/utf8.go
@@ -6,7 +6,7 @@
package utf8
-export const (
+const (
RuneError = 0xFFFD;
RuneSelf = 0x80;
RuneMax = 0x10FFFF;
@@ -181,29 +181,29 @@ func decodeRuneInStringInternal(s string, i int, n int) (rune, size int, short b
return RuneError, 1, false
}
-export func FullRune(p []byte) bool {
+func FullRune(p []byte) bool {
rune, size, short := decodeRuneInternal(p);
return !short
}
-export func FullRuneInString(s string, i int) bool {
+func FullRuneInString(s string, i int) bool {
rune, size, short := decodeRuneInStringInternal(s, i, len(s) - i);
return !short
}
-export func DecodeRune(p []byte) (rune, size int) {
+func DecodeRune(p []byte) (rune, size int) {
var short bool;
rune, size, short = decodeRuneInternal(p);
return;
}
-export func DecodeRuneInString(s string, i int) (rune, size int) {
+func DecodeRuneInString(s string, i int) (rune, size int) {
var short bool;
rune, size, short = decodeRuneInStringInternal(s, i, len(s) - i);
return;
}
-export func RuneLen(rune int) int {
+func RuneLen(rune int) int {
switch {
case rune <= _Rune1Max:
return 1;
@@ -217,7 +217,7 @@ export func RuneLen(rune int) int {
return -1;
}
-export func EncodeRune(rune int, p []byte) int {
+func EncodeRune(rune int, p []byte) int {
if rune <= _Rune1Max {
p[0] = byte(rune);
return 1;
@@ -247,7 +247,7 @@ export func EncodeRune(rune int, p []byte) int {
return 4;
}
-export func RuneCount(p []byte) int {
+func RuneCount(p []byte) int {
i := 0;
var n int;
for n = 0; i < len(p); n++ {
@@ -261,7 +261,7 @@ export func RuneCount(p []byte) int {
return n;
}
-export func RuneCountInString(s string, i int, l int) int {
+func RuneCountInString(s string, i int, l int) int {
ei := i + l;
n := 0;
for n = 0; i < ei; n++ {
diff --git a/src/lib/utf8_test.go b/src/lib/utf8_test.go
index 0456649fd..2cb15889e 100644
--- a/src/lib/utf8_test.go
+++ b/src/lib/utf8_test.go
@@ -11,7 +11,7 @@ import (
"utf8";
)
-export type Utf8Map struct {
+type Utf8Map struct {
rune int;
str string;
}
@@ -53,7 +53,7 @@ func bytes(s string) []byte {
return b[0:len(s)];
}
-export func TestFullRune(t *testing.T) {
+func TestFullRune(t *testing.T) {
for i := 0; i < len(utf8map); i++ {
m := utf8map[i];
b := bytes(m.str);
@@ -87,7 +87,7 @@ func equalBytes(a, b []byte) bool {
return true;
}
-export func TestEncodeRune(t *testing.T) {
+func TestEncodeRune(t *testing.T) {
for i := 0; i < len(utf8map); i++ {
m := utf8map[i];
b := bytes(m.str);
@@ -100,7 +100,7 @@ export func TestEncodeRune(t *testing.T) {
}
}
-export func TestDecodeRune(t *testing.T) {
+func TestDecodeRune(t *testing.T) {
for i := 0; i < len(utf8map); i++ {
m := utf8map[i];
b := bytes(m.str);
@@ -158,7 +158,7 @@ export func TestDecodeRune(t *testing.T) {
}
}
-export type RuneCountTest struct {
+type RuneCountTest struct {
in string;
out int;
}
@@ -168,7 +168,7 @@ var runecounttests = []RuneCountTest {
RuneCountTest{ "1,2,3,4", 7 },
RuneCountTest{ "\xe2\x00", 2 },
}
-export func TestRuneCount(t *testing.T) {
+func TestRuneCount(t *testing.T) {
for i := 0; i < len(runecounttests); i++ {
tt := runecounttests[i];
if out := utf8.RuneCountInString(tt.in, 0, len(tt.in)); out != tt.out {