diff --git a/.circleci/config.yml b/.circleci/config.yml index b4ad0827..540b05b5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ jobs: build: docker: # CircleCI Go images available at: https://hub.docker.com/r/circleci/golang/ - - image: circleci/golang:1.13 + - image: circleci/golang:1.15.2 environment: GO111MODULE: "on" diff --git a/codec/mjpeg/tests.go b/codec/mjpeg/tests.go index 4331623b..fa39200c 100644 --- a/codec/mjpeg/tests.go +++ b/codec/mjpeg/tests.go @@ -2,7 +2,7 @@ DESCRIPTION tests.go contains JPEG/RTP packets use for testing in jpeg_test.go. These are from a known good source from which the expected MJPEG file - found in testdata/expect.mjpeg is derived. + found in testdata/expect.mjpeg is derived. AUTHOR Saxon Nelson-Milton diff --git a/device/alsa/alsa_test.go b/device/alsa/alsa_test.go index 6c2b5a77..d91c8ad9 100644 --- a/device/alsa/alsa_test.go +++ b/device/alsa/alsa_test.go @@ -127,12 +127,12 @@ func TestIsRunning(t *testing.T) { InputCodec: codecutil.ADPCM, }) if err != nil { - t.Skipf("could not set device: %w", err) + t.Skipf("could not set device: %v", err) } err = d.Start() if err != nil { - t.Fatalf("could not start device %w", err) + t.Fatalf("could not start device %v", err) } time.Sleep(dur) diff --git a/device/file/file_test.go b/device/file/file_test.go index 6bf547f4..53e90be5 100644 --- a/device/file/file_test.go +++ b/device/file/file_test.go @@ -41,12 +41,12 @@ func TestIsRunning(t *testing.T) { InputPath: path, }) if err != nil { - t.Skipf("could not set device: %w", err) + t.Skipf("could not set device: %v", err) } err = d.Start() if err != nil { - t.Fatalf("could not start device %w", err) + t.Fatalf("could not start device %v", err) } time.Sleep(dur) diff --git a/device/geovision/config/config_test.go b/device/geovision/config/config_test.go index fd52bbd3..1862d149 100644 --- a/device/geovision/config/config_test.go +++ b/device/geovision/config/config_test.go @@ -153,13 +153,13 @@ func TestCodecOut(t *testing.T) { }, { s: settings{ch: 1}, - c: Codec(500), + c: Codec("500"), want: settings{ch: 1}, err: true, }, { s: settings{ch: 2}, - c: Codec(500), + c: Codec("500"), want: settings{ch: 2}, err: true, }, diff --git a/device/geovision/geovision_test.go b/device/geovision/geovision_test.go index 784313e3..c06ee98b 100644 --- a/device/geovision/geovision_test.go +++ b/device/geovision/geovision_test.go @@ -47,12 +47,12 @@ func TestIsRunning(t *testing.T) { CameraIP: ip, }) if err != nil { - t.Skipf("could not set device: %w", err) + t.Skipf("could not set device: %v", err) } err = d.Start() if err != nil { - t.Fatalf("could not start device %w", err) + t.Fatalf("could not start device %v", err) } time.Sleep(dur) diff --git a/device/raspivid/raspivid_test.go b/device/raspivid/raspivid_test.go index 76a54e3c..f6fa2ec5 100644 --- a/device/raspivid/raspivid_test.go +++ b/device/raspivid/raspivid_test.go @@ -45,12 +45,12 @@ func TestIsRunning(t *testing.T) { InputCodec: codecutil.H264, }) if err != nil { - t.Skipf("could not set device: %w", err) + t.Skipf("could not set device: %v", err) } err = d.Start() if err != nil { - t.Fatalf("could not start device %w", err) + t.Fatalf("could not start device %v", err) } time.Sleep(dur) diff --git a/device/webcam/webcam_test.go b/device/webcam/webcam_test.go index 3c58c6e8..e653c86d 100644 --- a/device/webcam/webcam_test.go +++ b/device/webcam/webcam_test.go @@ -45,12 +45,12 @@ func TestIsRunning(t *testing.T) { InputCodec: codecutil.H264, }) if err != nil { - t.Skipf("could not set device: %w", err) + t.Skipf("could not set device: %v", err) } err = d.Start() if err != nil { - t.Fatalf("could not start device %w", err) + t.Fatalf("could not start device %v", err) } time.Sleep(dur) diff --git a/exp/rvcl/main.go b/exp/rvcl/main.go index 7f9ff87f..ed1e1b97 100644 --- a/exp/rvcl/main.go +++ b/exp/rvcl/main.go @@ -129,16 +129,16 @@ func main() { case *configPtr != "": // Decode JSON file to map. err = json.Unmarshal([]byte(*configPtr), &cfg) if err != nil { - panic(fmt.Sprintf("could not decode JSON config: %w", err)) + panic(fmt.Sprintf("could not decode JSON config: %v", err)) } case *configFilePtr != "": // Decode JSON string to map from command line flag. f, err := os.Open(*configFilePtr) if err != nil { - panic(fmt.Sprintf("could not open config file: %w", err)) + panic(fmt.Sprintf("could not open config file: %v", err)) } err = json.NewDecoder(f).Decode(&cfg) if err != nil { - panic(fmt.Sprintf("could not decode JSON config: %w", err)) + panic(fmt.Sprintf("could not decode JSON config: %v", err)) } default: // No config information has been provided; give empty map to force defaults. cfg = map[string]string{} @@ -167,19 +167,19 @@ func main() { rv, err := revid.New(config.Config{Logger: log}, ns) if err != nil { - panic(fmt.Sprintf("could not create revid: %w", err)) + panic(fmt.Sprintf("could not create revid: %v", err)) } // Configure revid with configuration map obtained through flags or file. // If config is empty, defaults will be adopted by revid. err = rv.Update(cfg) if err != nil { - panic(fmt.Sprintf("could not update revid config: %w", err)) + panic(fmt.Sprintf("could not update revid config: %v", err)) } err = rv.Start() if err != nil { - panic(fmt.Sprintf("could not start revid: %w", err)) + panic(fmt.Sprintf("could not start revid: %v", err)) } // Run indefinitely. diff --git a/protocol/rtmp/amf/amf.go b/protocol/rtmp/amf/amf.go index 7ccfd932..02a9d005 100644 --- a/protocol/rtmp/amf/amf.go +++ b/protocol/rtmp/amf/amf.go @@ -81,8 +81,8 @@ type Object struct { // Number, string types use String and arrays and objects use // Object. The Name is optional. type Property struct { - Type uint8 - + Type uint8 + Name string Number float64 String string diff --git a/protocol/rtsp/client.go b/protocol/rtsp/client.go index f6c9d0eb..8a7598da 100644 --- a/protocol/rtsp/client.go +++ b/protocol/rtsp/client.go @@ -50,7 +50,7 @@ func NewClient(addr string) (c *Client, local, remote *net.TCPAddr, err error) { c = &Client{addr: addr} c.url, err = url.Parse(addr) if err != nil { - return nil, nil,nil, err + return nil, nil, nil, err } c.conn, err = net.Dial("tcp", c.url.Host) if err != nil { diff --git a/revid/pipeline.go b/revid/pipeline.go index 7d770a42..7f19067f 100644 --- a/revid/pipeline.go +++ b/revid/pipeline.go @@ -69,7 +69,7 @@ func (r *Revid) reset(c config.Config) error { r.cfg.Logger.Log(logger.Debug, "setting config") err := r.setConfig(c) if err != nil { - return fmt.Errorf("could not set config: %w",err) + return fmt.Errorf("could not set config: %w", err) } r.cfg.Logger.Log(logger.Info, "config set") @@ -95,7 +95,7 @@ func (r *Revid) reset(c config.Config) error { encOptions = append(encOptions, mts.TimeBasedPSI(time.Duration(r.cfg.PSITime)*time.Second)) r.cfg.CBR = true case codecutil.PCM, codecutil.ADPCM: - return nil, errors.New(fmt.Sprintf("invalid input codec: %v for input: %v",r.cfg.InputCodec,r.cfg.Input)) + return nil, errors.New(fmt.Sprintf("invalid input codec: %v for input: %v", r.cfg.InputCodec, r.cfg.Input)) default: panic("unknown input codec") } @@ -117,7 +117,7 @@ func (r *Revid) reset(c config.Config) error { r.cfg.Logger.Log(logger.Info, "finished setting pipeline") if err != nil { - return fmt.Errorf("could not set up pipeline: %w",err) + return fmt.Errorf("could not set up pipeline: %w", err) } return nil @@ -282,7 +282,7 @@ func (r *Revid) setupPipeline(mtsEnc func(dst io.WriteCloser, rate float64) (io. err = r.setupAudio() } if err != nil { - return fmt.Errorf("could not set lexer: %w",err) + return fmt.Errorf("could not set lexer: %w", err) } // Configure the input device. We know that defaults are set, so no need to