mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
use &T{1,2,3} constructor for simple new cases
R=r OCL=17691 CL=17719
This commit is contained in:
parent
071c91bf48
commit
de13727f0f
6 changed files with 129 additions and 222 deletions
|
|
@ -15,9 +15,7 @@ export type Error struct {
|
|||
var ErrorTab = new(map[int64] *Error);
|
||||
|
||||
export func NewError(s string) *Error {
|
||||
e := new(Error);
|
||||
e.s = s;
|
||||
return e
|
||||
return &Error{s}
|
||||
}
|
||||
|
||||
export func ErrnoToError(errno int64) *Error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue