From 525a3509a26bf2fed2b6729968d27e67bf38675b Mon Sep 17 00:00:00 2001 From: josh <josh@elixxir.io> Date: Fri, 3 Jan 2020 14:56:10 -0800 Subject: [PATCH] Add error case/comments, homogenize copyright headers --- api/mockserver.go | 2 +- api/mockserver_test.go | 4 ++++ api/private_test.go | 5 +++++ api/register_test.go | 5 +++++ bots/bots_test.go | 2 +- cmd/gen.go | 2 +- cmd/udb.go | 2 +- cmd/version.go | 2 +- crypto/decrypt.go | 2 +- crypto/encrypt.go | 2 +- crypto/encryptdecrypt_test.go | 2 +- globals/log.go | 2 +- globals/storage_test.go | 2 +- globals/terminator.go | 2 +- globals/terminator_test.go | 2 +- go.mod | 8 +++++--- go.sum | 16 ++++++++++------ io/collate.go | 2 +- main.go | 2 +- parse/body.go | 2 +- parse/body_test.go | 2 +- parse/message.go | 2 +- parse/message_test.go | 2 +- parse/partition.go | 2 +- parse/partition_test.go | 2 +- user/user.go | 2 +- user/user_test.go | 2 +- 27 files changed, 51 insertions(+), 31 deletions(-) diff --git a/api/mockserver.go b/api/mockserver.go index cf62d6f89..e5324a1b0 100644 --- a/api/mockserver.go +++ b/api/mockserver.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/api/mockserver_test.go b/api/mockserver_test.go index 12b4ba424..d427cc780 100644 --- a/api/mockserver_test.go +++ b/api/mockserver_test.go @@ -54,6 +54,7 @@ func TestMain(m *testing.M) { os.Exit(testMainWrapper(m)) } +//Happy path: test message receiver stating up func TestClient_StartMessageReceiver_MultipleMessages(t *testing.T) { // Initialize client with dummy storage testDef := getNDF() @@ -116,6 +117,9 @@ func TestClient_StartMessageReceiver_MultipleMessages(t *testing.T) { } err = client.StartMessageReceiver(cb) + if err != nil { + t.Errorf("%+v", err) + } time.Sleep(3 * time.Second) for _, gw := range GWErrComms { diff --git a/api/private_test.go b/api/private_test.go index 815c1d73b..514a19a50 100644 --- a/api/private_test.go +++ b/api/private_test.go @@ -1,3 +1,8 @@ +//////////////////////////////////////////////////////////////////////////////// +// Copyright © 2019 Privategrity Corporation / +// / +// All rights reserved. / +//////////////////////////////////////////////////////////////////////////////// package api import ( diff --git a/api/register_test.go b/api/register_test.go index 7c7438c9f..b36b0f93c 100644 --- a/api/register_test.go +++ b/api/register_test.go @@ -1,3 +1,8 @@ +//////////////////////////////////////////////////////////////////////////////// +// Copyright © 2019 Privategrity Corporation / +// / +// All rights reserved. / +//////////////////////////////////////////////////////////////////////////////// package api import ( diff --git a/bots/bots_test.go b/bots/bots_test.go index 0497558e2..c6628b29a 100644 --- a/bots/bots_test.go +++ b/bots/bots_test.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/cmd/gen.go b/cmd/gen.go index eced66f3f..29b0f1b00 100644 --- a/cmd/gen.go +++ b/cmd/gen.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/cmd/udb.go b/cmd/udb.go index 178cdd64e..a18ffc1c0 100644 --- a/cmd/udb.go +++ b/cmd/udb.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/cmd/version.go b/cmd/version.go index 2d6052a2c..0dac058f7 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/crypto/decrypt.go b/crypto/decrypt.go index 0d2b3a90a..9004d5aa0 100644 --- a/crypto/decrypt.go +++ b/crypto/decrypt.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/crypto/encrypt.go b/crypto/encrypt.go index 95a6c12c3..7cfe6fe50 100644 --- a/crypto/encrypt.go +++ b/crypto/encrypt.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/crypto/encryptdecrypt_test.go b/crypto/encryptdecrypt_test.go index 6d511fd42..b94d74a3d 100644 --- a/crypto/encryptdecrypt_test.go +++ b/crypto/encryptdecrypt_test.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/globals/log.go b/globals/log.go index 317b22e30..bb092c640 100644 --- a/globals/log.go +++ b/globals/log.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/globals/storage_test.go b/globals/storage_test.go index d1f48943c..23cbf077c 100644 --- a/globals/storage_test.go +++ b/globals/storage_test.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/globals/terminator.go b/globals/terminator.go index 9e7615c53..5b17199f2 100644 --- a/globals/terminator.go +++ b/globals/terminator.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/globals/terminator_test.go b/globals/terminator_test.go index 92cb9d601..b43c8cc03 100644 --- a/globals/terminator_test.go +++ b/globals/terminator_test.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/go.mod b/go.mod index 7efb04c70..a47c07c6c 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/golang/protobuf v1.3.2 github.com/google/go-cmp v0.3.1 // indirect github.com/gopherjs/gopherjs v0.0.0-20191106031601-ce3c9ade29de // indirect + github.com/kr/pretty v0.2.0 // indirect github.com/pelletier/go-toml v1.6.0 // indirect github.com/pkg/errors v0.8.1 github.com/smartystreets/assertions v1.0.1 // indirect @@ -19,9 +20,10 @@ require ( gitlab.com/elixxir/comms v0.0.0-20191206003247-33238c377132 gitlab.com/elixxir/crypto v0.0.0-20191121235352-86d305a9b253 gitlab.com/elixxir/primitives v0.0.0-20191204001459-cef5ed720564 - golang.org/x/crypto v0.0.0-20191219195013-becbf705a915 + golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876 golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 // indirect - golang.org/x/sys v0.0.0-20191220220014-0732a990476f // indirect - google.golang.org/genproto v0.0.0-20191220175831-5c49e3ecc1c1 // indirect + golang.org/x/sys v0.0.0-20200103143344-a1369afcdac7 // indirect + google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb // indirect google.golang.org/grpc v1.26.0 // indirect + gopkg.in/ini.v1 v1.51.1 // indirect ) diff --git a/go.sum b/go.sum index 6831cd760..b7454ebd3 100644 --- a/go.sum +++ b/go.sum @@ -71,6 +71,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -169,8 +171,8 @@ golang.org/x/crypto v0.0.0-20191028145041-f83a4685e152 h1:ZC1Xn5A1nlpSmQCIva4bZ3 golang.org/x/crypto v0.0.0-20191028145041-f83a4685e152/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20191117063200-497ca9f6d64f h1:kz4KIr+xcPUsI3VMoqWfPMvtnJ6MGfiVwsWSVzphMO4= golang.org/x/crypto v0.0.0-20191117063200-497ca9f6d64f/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20191219195013-becbf705a915 h1:aJ0ex187qoXrJHPo8ZasVTASQB7llQP6YeNzgDALPRk= -golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876 h1:sKJQZMuxjOAR/Uo2LBfU90onWEf1dF4C+0hPJCc9Mpc= +golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -203,8 +205,8 @@ golang.org/x/sys v0.0.0-20191028164358-195ce5e7f934 h1:u/E0NqCIWRDAo9WCFo6Ko49nj golang.org/x/sys v0.0.0-20191028164358-195ce5e7f934/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191118133127-cf1e2d577169/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191119195528-f068ffe820e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220220014-0732a990476f h1:72l8qCJ1nGxMGH26QVBVIxKd/D34cfGt0OvrPtpemyY= -golang.org/x/sys v0.0.0-20191220220014-0732a990476f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200103143344-a1369afcdac7 h1:/W9OPMnnpmFXHYkcp2rQsbFUbRlRzfECQjmAFiOyHE8= +golang.org/x/sys v0.0.0-20200103143344-a1369afcdac7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= @@ -223,8 +225,8 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20191115221424-83cc0476cb11 h1:51D++eCgOHufw5VfDE9Uzqyyc+OyQIjb9hkYy9LN5Fk= google.golang.org/genproto v0.0.0-20191115221424-83cc0476cb11/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191220175831-5c49e3ecc1c1 h1:PlscBL5CvF+v1mNR82G+i4kACGq2JQvKDnNq7LSS65o= -google.golang.org/genproto v0.0.0-20191220175831-5c49e3ecc1c1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb h1:ADPHZzpzM4tk4V4S5cnCrr5SwzvlrPRmqqCuJDB8UTs= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.21.0 h1:G+97AoqBnmZIT91cLG/EkCoK9NSelj64P8bOHHNmGn0= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -242,6 +244,8 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogR gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.51.1 h1:GyboHr4UqMiLUybYjd22ZjQIKEJEpgtLXtuGbR21Oho= +gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/io/collate.go b/io/collate.go index 9ea54c43e..f9781e956 100644 --- a/io/collate.go +++ b/io/collate.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/main.go b/main.go index bc534f08c..a39e9f5c9 100644 --- a/main.go +++ b/main.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/parse/body.go b/parse/body.go index 4bcdb7b73..165e7c8c4 100644 --- a/parse/body.go +++ b/parse/body.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/parse/body_test.go b/parse/body_test.go index 7851baf3e..fd1e5a673 100644 --- a/parse/body_test.go +++ b/parse/body_test.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/parse/message.go b/parse/message.go index 471c836c1..898d7e5e7 100644 --- a/parse/message.go +++ b/parse/message.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/parse/message_test.go b/parse/message_test.go index 96eae5aaf..92746eff4 100644 --- a/parse/message_test.go +++ b/parse/message_test.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/parse/partition.go b/parse/partition.go index c4ca14bfb..b36c92de6 100644 --- a/parse/partition.go +++ b/parse/partition.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/parse/partition_test.go b/parse/partition_test.go index 349ad3c75..cfd856a57 100644 --- a/parse/partition_test.go +++ b/parse/partition_test.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/user/user.go b/user/user.go index 8a1cf8b72..deff4cb45 100644 --- a/user/user.go +++ b/user/user.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// diff --git a/user/user_test.go b/user/user_test.go index 7bd909df0..fd2a0cfe7 100644 --- a/user/user_test.go +++ b/user/user_test.go @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / +// Copyright © 2019 Privategrity Corporation / // / // All rights reserved. / //////////////////////////////////////////////////////////////////////////////// -- GitLab