summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cmd/gobuild/util.go4
-rw-r--r--src/lib/go/token/token.go4
-rw-r--r--src/lib/http/server.go2
-rw-r--r--src/lib/os/error.go4
-rw-r--r--src/lib/template/template.go4
-rw-r--r--src/lib/time/zoneinfo.go2
6 files changed, 10 insertions, 10 deletions
diff --git a/src/cmd/gobuild/util.go b/src/cmd/gobuild/util.go
index be50ba1ca..ac0cd03c1 100644
--- a/src/cmd/gobuild/util.go
+++ b/src/cmd/gobuild/util.go
@@ -171,12 +171,12 @@ func dollarString(s, l, r string) string {
// the context in which the result will be interpreted.
type ShellString string;
func (s ShellString) String() string {
- return dollarString(s, "{", "}");
+ return dollarString(string(s), "{", "}");
}
type MakeString string;
func (s MakeString) String() string {
- return dollarString(s, "(", ")");
+ return dollarString(string(s), "(", ")");
}
// TODO(rsc): parse.Parse should return an os.Error.
diff --git a/src/lib/go/token/token.go b/src/lib/go/token/token.go
index b031b7f61..b71d0f03d 100644
--- a/src/lib/go/token/token.go
+++ b/src/lib/go/token/token.go
@@ -19,7 +19,7 @@ const (
ILLEGAL Token = iota;
EOF;
COMMENT;
-
+
// Identifiers and basic type literals
// (these tokens stand for classes of literals)
literal_beg;
@@ -237,7 +237,7 @@ func (tok Token) String() string {
if str, exists := tokens[tok]; exists {
return str;
}
- return "token(" + strconv.Itoa(tok) + ")";
+ return "token(" + strconv.Itoa(int(tok)) + ")";
}
diff --git a/src/lib/http/server.go b/src/lib/http/server.go
index 438c0d915..9398351fe 100644
--- a/src/lib/http/server.go
+++ b/src/lib/http/server.go
@@ -329,7 +329,7 @@ func Redirect(c *Conn, url string) {
// Redirect to a fixed URL
type redirectHandler string
func (url redirectHandler) ServeHTTP(c *Conn, req *Request) {
- Redirect(c, url);
+ Redirect(c, string(url));
}
// RedirectHandler returns a request handler that redirects
diff --git a/src/lib/os/error.go b/src/lib/os/error.go
index 3861f0167..d196abfc6 100644
--- a/src/lib/os/error.go
+++ b/src/lib/os/error.go
@@ -15,7 +15,7 @@ type Error interface {
// Error.
type ErrorString string
func (e ErrorString) String() string {
- return e
+ return string(e)
}
// NewError converts s to an ErrorString, which satisfies the Error interface.
@@ -27,7 +27,7 @@ func NewError(s string) Error {
// wrappers to convert the error number into an Error.
type Errno int64
func (e Errno) String() string {
- return syscall.Errstr(e)
+ return syscall.Errstr(int64(e))
}
// ErrnoToError converts errno to an Error (underneath, an Errno).
diff --git a/src/lib/template/template.go b/src/lib/template/template.go
index 182a85b42..f266e6014 100644
--- a/src/lib/template/template.go
+++ b/src/lib/template/template.go
@@ -181,7 +181,7 @@ func New(fmap FormatterMap) *Template {
// Generic error handler, called only from execError or parseError.
func error(errors chan os.Error, line int, err string, args ...) {
- errors <- ParseError{fmt.Sprintf("line %d: %s", line, fmt.Sprintf(err, args))};
+ errors <- ParseError{os.ErrorString(fmt.Sprintf("line %d: %s", line, fmt.Sprintf(err, args)))};
runtime.Goexit();
}
@@ -756,7 +756,7 @@ func validDelim(d []byte) bool {
// the error.
func (t *Template) Parse(s string) os.Error {
if !validDelim(t.ldelim) || !validDelim(t.rdelim) {
- return ParseError{fmt.Sprintf("bad delimiter strings %q %q", t.ldelim, t.rdelim)}
+ return ParseError{os.ErrorString(fmt.Sprintf("bad delimiter strings %q %q", t.ldelim, t.rdelim))}
}
t.buf = io.StringBytes(s);
t.p = 0;
diff --git a/src/lib/time/zoneinfo.go b/src/lib/time/zoneinfo.go
index 2702285c0..751afc931 100644
--- a/src/lib/time/zoneinfo.go
+++ b/src/lib/time/zoneinfo.go
@@ -236,7 +236,7 @@ func readinfofile(name string) ([]zonetime, os.Error) {
Error:
if tzerr, ok := err.(TimeZoneError); ok {
- tzerr.ErrorString += ": " + name
+ tzerr.ErrorString = os.ErrorString(tzerr.String() + ": " + name)
}
return nil, err
}