var priv pkcs1PrivateKey
rest, err := asn1.Unmarshal(der, &priv)
if len(rest) > 0 {
- err = asn1.SyntaxError{"trailing data"}
+ err = asn1.SyntaxError{Msg: "trailing data"}
return
}
if err != nil {
return nil, err
}
if !seq.IsCompound || seq.Tag != 16 || seq.Class != 0 {
- return nil, asn1.StructuralError{"bad SAN sequence"}
+ return nil, asn1.StructuralError{Msg: "bad SAN sequence"}
}
parsedName := false
return nil, err
}
if len(rest) > 0 {
- return nil, asn1.SyntaxError{"trailing data"}
+ return nil, asn1.SyntaxError{Msg: "trailing data"}
}
return parseCertificate(&cert)
case "bool":
return driver.Bool
case "nullbool":
- return driver.Null{driver.Bool}
+ return driver.Null{Converter: driver.Bool}
case "int32":
return driver.Int32
case "string":
- return driver.NotNull{driver.String}
+ return driver.NotNull{Converter: driver.String}
case "nullstring":
- return driver.Null{driver.String}
+ return driver.Null{Converter: driver.String}
case "int64":
// TODO(coopernurse): add type-specific converter
- return driver.NotNull{driver.DefaultParameterConverter}
+ return driver.NotNull{Converter: driver.DefaultParameterConverter}
case "nullint64":
// TODO(coopernurse): add type-specific converter
- return driver.Null{driver.DefaultParameterConverter}
+ return driver.Null{Converter: driver.DefaultParameterConverter}
case "float64":
// TODO(coopernurse): add type-specific converter
- return driver.NotNull{driver.DefaultParameterConverter}
+ return driver.NotNull{Converter: driver.DefaultParameterConverter}
case "nullfloat64":
// TODO(coopernurse): add type-specific converter
- return driver.Null{driver.DefaultParameterConverter}
+ return driver.Null{Converter: driver.DefaultParameterConverter}
case "datetime":
return driver.DefaultParameterConverter
}
}
wd, err := syscall.InotifyAddWatch(w.fd, path, flags)
if err != nil {
- return &os.PathError{"inotify_add_watch", path, err}
+ return &os.PathError{
+ Op: "inotify_add_watch",
+ Path: path,
+ Err: err,
+ }
}
if !found {
continue
}
examples = append(examples, &Example{
- Name: name[len("Example"):],
- Body: &printer.CommentedNode{f.Body, src.Comments},
+ Name: name[len("Example"):],
+ Body: &printer.CommentedNode{
+ Node: f.Body,
+ Comments: src.Comments,
+ },
Output: f.Doc.Text(),
})
}
var s Scanner
s.Init(fset.AddFile("", fset.Base(), len(source)), source, &testErrorHandler{t}, ScanComments|dontInsertSemis)
index := 0
- epos := token.Position{"", 0, 1, 1} // expected position
+ // epos is the expected position
+ epos := token.Position{
+ Filename: "",
+ Offset: 0,
+ Line: 1,
+ Column: 1,
+ }
for {
pos, tok, lit := s.Scan()
if lit == "" {
for _, s := range segs {
p, _, lit := S.Scan()
pos := file.Position(p)
- checkPos(t, lit, p, token.Position{s.filename, pos.Offset, s.line, pos.Column})
+ checkPos(t, lit, p, token.Position{
+ Filename: s.filename,
+ Offset: pos.Offset,
+ Line: s.line,
+ Column: pos.Column,
+ })
}
if S.ErrorCount != 0 {
for _, test := range tests {
b, e := []byte(test.input), newEscaper(nil)
- c := e.escapeText(context{}, &parse.TextNode{parse.NodeText, b})
+ c := e.escapeText(context{}, &parse.TextNode{NodeType: parse.NodeText, Text: b})
if !test.output.eq(c) {
t.Errorf("input %q: want context\n\t%v\ngot\n\t%v", test.input, test.output, c)
continue
var src image.Image
switch scm {
case nil:
- src = &image.Uniform{color.RGBA{0x11, 0x22, 0x33, 0xff}}
+ src = &image.Uniform{C: color.RGBA{0x11, 0x22, 0x33, 0xff}}
case color.RGBAModel:
src1 := image.NewRGBA(image.Rect(0, 0, srcw, srch))
for y := 0; y < srch; y++ {
x := 3 * i % (dstw - srcw)
y := 7 * i % (dsth - srch)
- DrawMask(dst, dst.Bounds().Add(image.Point{x, y}), src, image.ZP, mask, image.ZP, op)
+ DrawMask(dst, dst.Bounds().Add(image.Pt(x, y)), src, image.ZP, mask, image.ZP, op)
}
}
sy := y + sp.Y - r.Min.Y
my := y + mp.Y - r.Min.Y
for x := r.Min.X; x < r.Max.X; x++ {
- if !(image.Point{x, y}.In(b)) {
+ if !(image.Pt(x, y).In(b)) {
continue
}
sx := x + sp.X - r.Min.X
- if !(image.Point{sx, sy}.In(sb)) {
+ if !(image.Pt(sx, sy).In(sb)) {
continue
}
mx := x + mp.X - r.Min.X
- if !(image.Point{mx, my}.In(mb)) {
+ if !(image.Pt(mx, my).In(mb)) {
continue
}
m := image.NewRGBA(image.Rect(0, 0, 40, 30)).SubImage(r).(*image.RGBA)
b := m.Bounds()
c := color.RGBA{11, 0, 0, 255}
- src := &image.Uniform{c}
+ src := &image.Uniform{C: c}
check := func(desc string) {
for y := b.Min.Y; y < b.Max.Y; y++ {
for x := b.Min.X; x < b.Max.X; x++ {
check("pixel")
// Draw 1 row at a time.
c = color.RGBA{0, 22, 0, 255}
- src = &image.Uniform{c}
+ src = &image.Uniform{C: c}
for y := b.Min.Y; y < b.Max.Y; y++ {
DrawMask(m, image.Rect(b.Min.X, y, b.Max.X, y+1), src, image.ZP, nil, image.ZP, Src)
}
check("row")
// Draw 1 column at a time.
c = color.RGBA{0, 0, 33, 255}
- src = &image.Uniform{c}
+ src = &image.Uniform{C: c}
for x := b.Min.X; x < b.Max.X; x++ {
DrawMask(m, image.Rect(x, b.Min.Y, x+1, b.Max.Y), src, image.ZP, nil, image.ZP, Src)
}
check("column")
// Draw the whole image at once.
c = color.RGBA{44, 55, 66, 77}
- src = &image.Uniform{c}
+ src = &image.Uniform{C: c}
DrawMask(m, b, src, image.ZP, nil, image.ZP, Src)
check("whole")
}
if err := d.decode(r, true); err != nil {
return image.Config{}, err
}
- return image.Config{d.globalColorMap, d.width, d.height}, nil
+ return image.Config{
+ ColorModel: d.globalColorMap,
+ Width: d.width,
+ Height: d.height,
+ }, nil
}
func init() {
}
switch d.nComp {
case nGrayComponent:
- return image.Config{color.GrayModel, d.width, d.height}, nil
+ return image.Config{
+ ColorModel: color.GrayModel,
+ Width: d.width,
+ Height: d.height,
+ }, nil
case nColorComponent:
- return image.Config{color.YCbCrModel, d.width, d.height}, nil
+ return image.Config{
+ ColorModel: color.YCbCrModel,
+ Width: d.width,
+ Height: d.height,
+ }, nil
}
return image.Config{}, FormatError("missing SOF marker")
}
for i := 0; i < 4; i++ {
xOff := (i & 1) * 8
yOff := (i & 2) * 4
- p := image.Point{x + xOff, y + yOff}
+ p := image.Pt(x+xOff, y+yOff)
if rgba != nil {
rgbaToYCbCr(rgba, p, &yBlock, &cbBlock[i], &crBlock[i])
} else {
case cbTCA16:
cm = color.NRGBA64Model
}
- return image.Config{cm, d.width, d.height}, nil
+ return image.Config{
+ ColorModel: cm,
+ Width: d.width,
+ Height: d.height,
+ }, nil
}
func init() {
}
method := ireq.Method
- err = &url.Error{method[0:1] + strings.ToLower(method[1:]), urlStr, err}
+ err = &url.Error{
+ Op: method[0:1] + strings.ToLower(method[1:]),
+ URL: urlStr,
+ Err: err,
+ }
return
}
)
var (
- ErrPersistEOF = &http.ProtocolError{"persistent connection closed"}
- ErrPipeline = &http.ProtocolError{"pipeline error"}
+ ErrPersistEOF = &http.ProtocolError{ErrorString: "persistent connection closed"}
+ ErrPipeline = &http.ProtocolError{ErrorString: "pipeline error"}
)
// This is an API usage error - the local side is closed.
return s, nil
Errno:
- err = &os.PathError{"setnonblock", s.pr.Name(), err}
+ err = &os.PathError{
+ Op: "setnonblock",
+ Path: s.pr.Name(),
+ Err: err,
+ }
Error:
s.pr.Close()
s.pw.Close()
err = errors.New("unexpected HTTP response: " + resp.Status)
}
conn.Close()
- return nil, &net.OpError{"dial-http", network + " " + address, nil, err}
+ return nil, &net.OpError{
+ Op: "dial-http",
+ Net: network + " " + address,
+ Addr: nil,
+ Err: err,
+ }
}
// Dial connects to an RPC server at the specified network address.
// the last message isn't base64 because it isn't a challenge
msg = []byte(msg64)
default:
- err = &textproto.Error{code, msg64}
+ err = &textproto.Error{Code: code, Msg: msg64}
}
resp, err = a.Next(msg, code == 334)
if err != nil {
return nil, NewSyscallError("GetExitCodeProcess", e)
}
p.done = true
- return &Waitmsg{p.Pid, syscall.WaitStatus{s, ec}, new(syscall.Rusage)}, nil
+ return &Waitmsg{p.Pid, syscall.WaitStatus{Status: s, ExitCode: ec}, new(syscall.Rusage)}, nil
}
// Signal sends a signal to the Process.
}
var anyTable = &unicode.RangeTable{
- []unicode.Range16{{0, 1<<16 - 1, 1}},
- []unicode.Range32{{1 << 16, unicode.MaxRune, 1}},
+ R16: []unicode.Range16{{Lo: 0, Hi: 1<<16 - 1, Stride: 1}},
+ R32: []unicode.Range32{{Lo: 1 << 16, Hi: unicode.MaxRune, Stride: 1}},
}
// unicodeTable returns the unicode.RangeTable identified by name
s[j-1].Hi = r[i].hi
} else {
s = s[0 : j+1]
- s[j] = unicode.Range32{uint32(r[i].lo), uint32(r[i].hi), 1}
+ s[j] = unicode.Range32{
+ Lo: uint32(r[i].lo),
+ Hi: uint32(r[i].hi),
+ Stride: 1,
+ }
j++
}
}