From 4e9e19adf49f67a8b6ca18ec0db0b327044aaf73 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 28 Apr 2019 00:10:03 +0300 Subject: [PATCH] Much more readable formatting --- src/cypherpunks.ru/nncp/call.go | 3 ++- src/cypherpunks.ru/nncp/pkt.go | 9 ++++++--- src/cypherpunks.ru/nncp/toss.go | 3 ++- src/cypherpunks.ru/nncp/tx.go | 9 ++++++--- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/cypherpunks.ru/nncp/call.go b/src/cypherpunks.ru/nncp/call.go index 4a56950..ef0167a 100644 --- a/src/cypherpunks.ru/nncp/call.go +++ b/src/cypherpunks.ru/nncp/call.go @@ -44,7 +44,8 @@ func (ctx *Ctx) CallNode( rxRate, txRate int, onlineDeadline, maxOnlineTime uint, listOnly bool, - onlyPkts map[[32]byte]bool) (isGood bool) { + onlyPkts map[[32]byte]bool, +) (isGood bool) { for _, addr := range addrs { sds := SDS{"node": node.Id, "addr": addr} ctx.LogD("call", sds, "dialing") diff --git a/src/cypherpunks.ru/nncp/pkt.go b/src/cypherpunks.ru/nncp/pkt.go index e157bef..b2ab591 100644 --- a/src/cypherpunks.ru/nncp/pkt.go +++ b/src/cypherpunks.ru/nncp/pkt.go @@ -139,7 +139,8 @@ func aeadProcess( nonce []byte, doEncrypt bool, r io.Reader, - w io.Writer) (int, error) { + w io.Writer, +) (int, error) { var blkCtr uint64 ciphCtr := nonce[len(nonce)-8:] buf := make([]byte, EncBlkSize+aead.Overhead()) @@ -196,7 +197,8 @@ func PktEncWrite( nice uint8, size, padSize int64, data io.Reader, - out io.Writer) error { + out io.Writer, +) error { pubEph, prvEph, err := box.GenerateKey(rand.Reader) if err != nil { return err @@ -299,7 +301,8 @@ func PktEncRead( our *NodeOur, nodes map[NodeId]*Node, data io.Reader, - out io.Writer) (*Node, int64, error) { + out io.Writer, +) (*Node, int64, error) { var pktEnc PktEnc _, err := xdr.Unmarshal(data, &pktEnc) if err != nil { diff --git a/src/cypherpunks.ru/nncp/toss.go b/src/cypherpunks.ru/nncp/toss.go index c7522e8..1f717fa 100644 --- a/src/cypherpunks.ru/nncp/toss.go +++ b/src/cypherpunks.ru/nncp/toss.go @@ -56,7 +56,8 @@ func newNotification(fromTo *FromToYAML, subject string) io.Reader { func (ctx *Ctx) Toss( nodeId *NodeId, nice uint8, - dryRun, doSeen, noFile, noFreq, noExec, noTrns bool) bool { + dryRun, doSeen, noFile, noFreq, noExec, noTrns bool, +) bool { isBad := false for job := range ctx.Jobs(nodeId, TRx) { pktName := filepath.Base(job.Fd.Name()) diff --git a/src/cypherpunks.ru/nncp/tx.go b/src/cypherpunks.ru/nncp/tx.go index db260ce..fcf1c83 100644 --- a/src/cypherpunks.ru/nncp/tx.go +++ b/src/cypherpunks.ru/nncp/tx.go @@ -42,7 +42,8 @@ func (ctx *Ctx) Tx( pkt *Pkt, nice uint8, size, minSize int64, - src io.Reader) (*Node, error) { + src io.Reader, +) (*Node, error) { tmp, err := ctx.NewTmpFileWHash() if err != nil { return nil, err @@ -206,7 +207,8 @@ func (ctx *Ctx) TxFileChunked( nice uint8, srcPath, dstPath string, minSize int64, - chunkSize int64) error { + chunkSize int64, +) error { if dstPath == "" { if srcPath == "-" { return errors.New("Must provide destination filename") @@ -381,7 +383,8 @@ func (ctx *Ctx) TxExec( handle string, args []string, body []byte, - minSize int64) error { + minSize int64, +) error { path := make([][]byte, 0, 1+len(args)) path = append(path, []byte(handle)) for _, arg := range args { -- 2.44.0