diff options
| author | Russ Cox <rsc@golang.org> | 2009-05-08 15:40:14 -0700 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2009-05-08 15:40:14 -0700 |
| commit | 917aa35f8ff95052459538c2e5bae80d1c9a307e (patch) | |
| tree | ac8aca82e0cdf34df99f8ef940c5ccd74117e926 /src/lib | |
| parent | cd3ab57a9c2d6088ad1deef97786d5b9f01343f6 (diff) | |
| download | go-917aa35f8ff95052459538c2e5bae80d1c9a307e.tar.xz | |
implications of stricter type equality:
if both types are named, they must be
the same type (arising from the same
declaration).
R=r,gri
DELTA=44 (21 added, 4 deleted, 19 changed)
OCL=28436
CL=28577
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/go/token/token.go | 4 | ||||
| -rw-r--r-- | src/lib/http/server.go | 2 | ||||
| -rw-r--r-- | src/lib/os/error.go | 4 | ||||
| -rw-r--r-- | src/lib/template/template.go | 4 | ||||
| -rw-r--r-- | src/lib/time/zoneinfo.go | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/go/token/token.go b/src/lib/go/token/token.go index b031b7f61c..b71d0f03d3 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 438c0d915b..9398351fe7 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 3861f0167e..d196abfc6e 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 182a85b426..f266e6014d 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 2702285c01..751afc9314 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 } |
