summaryrefslogtreecommitdiff
path: root/libgo/go/exp
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-03-30 15:33:16 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-03-30 15:33:16 +0000
commitd3c120b4018c5e5c0b21cc2ee66bdab24c48f749 (patch)
tree9382d76e5dc68294cdf3c4f2c03a9f61b44fb014 /libgo/go/exp
parent1c654ff1fb479fd0001e513b8380d21efd0833d9 (diff)
downloadgcc-d3c120b4018c5e5c0b21cc2ee66bdab24c48f749.tar.gz
Update to current Go library.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171732 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/exp')
-rw-r--r--libgo/go/exp/datafmt/parser.go10
-rw-r--r--libgo/go/exp/draw/x11/conn.go6
-rw-r--r--libgo/go/exp/eval/eval_test.go8
-rw-r--r--libgo/go/exp/ogle/cmd.go2
4 files changed, 15 insertions, 11 deletions
diff --git a/libgo/go/exp/datafmt/parser.go b/libgo/go/exp/datafmt/parser.go
index c6d1402644c..7dedb531a51 100644
--- a/libgo/go/exp/datafmt/parser.go
+++ b/libgo/go/exp/datafmt/parser.go
@@ -22,7 +22,7 @@ type parser struct {
file *token.File
pos token.Pos // token position
tok token.Token // one token look-ahead
- lit []byte // token literal
+ lit string // token literal
packs map[string]string // PackageName -> ImportPath
rules map[string]expr // RuleName -> Expression
@@ -62,7 +62,7 @@ func (p *parser) errorExpected(pos token.Pos, msg string) {
// make the error message more specific
msg += ", found '" + p.tok.String() + "'"
if p.tok.IsLiteral() {
- msg += " " + string(p.lit)
+ msg += " " + p.lit
}
}
p.error(pos, msg)
@@ -80,7 +80,7 @@ func (p *parser) expect(tok token.Token) token.Pos {
func (p *parser) parseIdentifier() string {
- name := string(p.lit)
+ name := p.lit
p.expect(token.IDENT)
return name
}
@@ -130,7 +130,7 @@ func (p *parser) parseRuleName() (string, bool) {
func (p *parser) parseString() string {
s := ""
if p.tok == token.STRING {
- s, _ = strconv.Unquote(string(p.lit))
+ s, _ = strconv.Unquote(p.lit)
// Unquote may fail with an error, but only if the scanner found
// an illegal string in the first place. In this case the error
// has already been reported.
@@ -181,7 +181,7 @@ func (p *parser) parseField() expr {
var fname string
switch p.tok {
case token.ILLEGAL:
- if string(p.lit) != "@" {
+ if p.lit != "@" {
return nil
}
fname = "@"
diff --git a/libgo/go/exp/draw/x11/conn.go b/libgo/go/exp/draw/x11/conn.go
index e28fb217065..53294af15c0 100644
--- a/libgo/go/exp/draw/x11/conn.go
+++ b/libgo/go/exp/draw/x11/conn.go
@@ -286,11 +286,11 @@ func connect(display string) (conn net.Conn, displayStr string, err os.Error) {
}
// Make the connection.
if socket != "" {
- conn, err = net.Dial("unix", "", socket+":"+displayStr)
+ conn, err = net.Dial("unix", socket+":"+displayStr)
} else if host != "" {
- conn, err = net.Dial(protocol, "", host+":"+strconv.Itoa(6000+displayInt))
+ conn, err = net.Dial(protocol, host+":"+strconv.Itoa(6000+displayInt))
} else {
- conn, err = net.Dial("unix", "", "/tmp/.X11-unix/X"+displayStr)
+ conn, err = net.Dial("unix", "/tmp/.X11-unix/X"+displayStr)
}
if err != nil {
return nil, "", os.NewError("cannot connect to " + display + ": " + err.String())
diff --git a/libgo/go/exp/eval/eval_test.go b/libgo/go/exp/eval/eval_test.go
index ff28cf1a908..541d3feb71d 100644
--- a/libgo/go/exp/eval/eval_test.go
+++ b/libgo/go/exp/eval/eval_test.go
@@ -39,9 +39,13 @@ type job struct {
}
func runTests(t *testing.T, baseName string, tests []test) {
- for i, test := range tests {
+ delta := 1
+ if testing.Short() {
+ delta = 16
+ }
+ for i := 0; i < len(tests); i += delta {
name := fmt.Sprintf("%s[%d]", baseName, i)
- test.run(t, name)
+ tests[i].run(t, name)
}
}
diff --git a/libgo/go/exp/ogle/cmd.go b/libgo/go/exp/ogle/cmd.go
index 9920ff6b883..ba056e88baf 100644
--- a/libgo/go/exp/ogle/cmd.go
+++ b/libgo/go/exp/ogle/cmd.go
@@ -205,7 +205,7 @@ func parseLoad(args []byte) (ident string, path string, err os.Error) {
sc, ev := newScanner(args)
var toks [4]token.Token
- var lits [4][]byte
+ var lits [4]string
for i := range toks {
_, toks[i], lits[i] = sc.Scan()
}