Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(300)

Delta Between Two Patch Sets: src/cmd/gofix/testdata/reflect.print.go.out

Issue 4607052: code review 4607052: os.Error API: don't export os.ErrorString, use os.NewEr... (Closed)
Left Patch Set: diff -r 7700d209820a https://go.googlecode.com/hg/ Created 13 years, 9 months ago
Right Patch Set: diff -r 6e3e06fb2dc3 https://go.googlecode.com/hg/ Created 13 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/gofix/testdata/reflect.export.go.out ('k') | src/cmd/gofix/testdata/reflect.read.go.out » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package fmt 5 package fmt
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "io" 9 "io"
10 "os" 10 "os"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 p := newPrinter() 178 p := newPrinter()
179 p.doPrintf(format, a) 179 p.doPrintf(format, a)
180 s := p.buf.String() 180 s := p.buf.String()
181 p.free() 181 p.free()
182 return s 182 return s
183 } 183 }
184 184
185 // Errorf formats according to a format specifier and returns the string· 185 // Errorf formats according to a format specifier and returns the string·
186 // converted to an os.ErrorString, which satisfies the os.Error interface. 186 // converted to an os.ErrorString, which satisfies the os.Error interface.
187 func Errorf(format string, a ...interface{}) os.Error { 187 func Errorf(format string, a ...interface{}) os.Error {
188 » return os.ErrorString(Sprintf(format, a...)) 188 » return os.NewError(Sprintf(format, a...))
189 } 189 }
190 190
191 // These routines do not take a format string 191 // These routines do not take a format string
192 192
193 // Fprint formats using the default formats for its operands and writes to w. 193 // Fprint formats using the default formats for its operands and writes to w.
194 // Spaces are added between operands when neither is a string. 194 // Spaces are added between operands when neither is a string.
195 // It returns the number of bytes written and any write error encountered. 195 // It returns the number of bytes written and any write error encountered.
196 func Fprint(w io.Writer, a ...interface{}) (n int, error os.Error) { 196 func Fprint(w io.Writer, a ...interface{}) (n int, error os.Error) {
197 p := newPrinter() 197 p := newPrinter()
198 p.doPrint(a, false, false) 198 p.doPrint(a, false, false)
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 if addspace || !isString && !prevString { 936 if addspace || !isString && !prevString {
937 p.buf.WriteByte(' ') 937 p.buf.WriteByte(' ')
938 } 938 }
939 } 939 }
940 prevString = p.printField(field, 'v', false, false, 0) 940 prevString = p.printField(field, 'v', false, false, 0)
941 } 941 }
942 if addnewline { 942 if addnewline {
943 p.buf.WriteByte('\n') 943 p.buf.WriteByte('\n')
944 } 944 }
945 } 945 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b