mirror of
https://github.com/containers/skopeo.git
synced 2025-08-09 10:28:23 +00:00
Rename "self" receiver
> receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (ST1006) Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
a26578178b
commit
a71900996f
@ -98,7 +98,7 @@ const maxMsgSize = 32 * 1024
|
|||||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
|
||||||
// We hard error if the input JSON numbers we expect to be
|
// We hard error if the input JSON numbers we expect to be
|
||||||
// integers are above this.
|
// integers are above this.
|
||||||
const maxJSONFloat = float64(1<<53 - 1)
|
const maxJSONFloat = float64(uint64(1)<<53 - 1)
|
||||||
|
|
||||||
// request is the JSON serialization of a function call
|
// request is the JSON serialization of a function call
|
||||||
type request struct {
|
type request struct {
|
||||||
|
@ -57,7 +57,7 @@ type pipefd struct {
|
|||||||
fd *os.File
|
fd *os.File
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *proxy) call(method string, args []interface{}) (rval interface{}, fd *pipefd, err error) {
|
func (p *proxy) call(method string, args []interface{}) (rval interface{}, fd *pipefd, err error) {
|
||||||
req := request{
|
req := request{
|
||||||
Method: method,
|
Method: method,
|
||||||
Args: args,
|
Args: args,
|
||||||
@ -66,7 +66,7 @@ func (self *proxy) call(method string, args []interface{}) (rval interface{}, fd
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
n, err := self.c.Write(reqbuf)
|
n, err := p.c.Write(reqbuf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ func (self *proxy) call(method string, args []interface{}) (rval interface{}, fd
|
|||||||
}
|
}
|
||||||
oob := make([]byte, syscall.CmsgSpace(1))
|
oob := make([]byte, syscall.CmsgSpace(1))
|
||||||
replybuf := make([]byte, maxMsgSize)
|
replybuf := make([]byte, maxMsgSize)
|
||||||
n, oobn, _, _, err := self.c.ReadMsgUnix(replybuf, oob)
|
n, oobn, _, _, err := p.c.ReadMsgUnix(replybuf, oob)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = fmt.Errorf("reading reply: %v", err)
|
err = fmt.Errorf("reading reply: %v", err)
|
||||||
return
|
return
|
||||||
@ -119,9 +119,9 @@ func (self *proxy) call(method string, args []interface{}) (rval interface{}, fd
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *proxy) callNoFd(method string, args []interface{}) (rval interface{}, err error) {
|
func (p *proxy) callNoFd(method string, args []interface{}) (rval interface{}, err error) {
|
||||||
var fd *pipefd
|
var fd *pipefd
|
||||||
rval, fd, err = self.call(method, args)
|
rval, fd, err = p.call(method, args)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -132,9 +132,9 @@ func (self *proxy) callNoFd(method string, args []interface{}) (rval interface{}
|
|||||||
return rval, nil
|
return rval, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *proxy) callReadAllBytes(method string, args []interface{}) (rval interface{}, buf []byte, err error) {
|
func (p *proxy) callReadAllBytes(method string, args []interface{}) (rval interface{}, buf []byte, err error) {
|
||||||
var fd *pipefd
|
var fd *pipefd
|
||||||
rval, fd, err = self.call(method, args)
|
rval, fd, err = p.call(method, args)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -150,7 +150,7 @@ func (self *proxy) callReadAllBytes(method string, args []interface{}) (rval int
|
|||||||
err: err,
|
err: err,
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
_, err = self.callNoFd("FinishPipe", []interface{}{fd.id})
|
_, err = p.callNoFd("FinishPipe", []interface{}{fd.id})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user