From 31e2b925985baeb32081dd0da564e34c5ed7d5df Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Wed, 30 May 2018 16:49:13 +0930 Subject: [PATCH 1/2] all: run goimports and clean up --- basicDriver.go | 3 ++- flv/FLV.go | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/basicDriver.go b/basicDriver.go index eb6bf2b7..3d880db1 100644 --- a/basicDriver.go +++ b/basicDriver.go @@ -1,9 +1,10 @@ package main import ( - "bitbucket.org/ausocean/av/revid" "fmt" "time" + + "bitbucket.org/ausocean/av/revid" ) func main() { diff --git a/flv/FLV.go b/flv/FLV.go index 22af9e65..7884e013 100644 --- a/flv/FLV.go +++ b/flv/FLV.go @@ -27,11 +27,9 @@ LICENSE package flv -import ( - "bitbucket.org/ausocean/av/tools" - //"../tools" - "fmt" -) +import "bitbucket.org/ausocean/av/tools" + +//"../tools" const ( headerLength = 72 From d6fd3d45392280567611e20d5d1cd19f54153e03 Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Wed, 30 May 2018 16:53:57 +0930 Subject: [PATCH 2/2] all: manual clean up of imports --- flv/FLV.go | 2 -- generator/FLVGenerator.go | 5 ++--- mpegts/MpegTs.go | 9 +-------- mpegts/mpegts_test.go | 5 +---- parser/H264Parser.go | 6 ++---- parser/MJPEGParser.go | 5 ----- parser/Parser.go | 2 -- revid/Config.go | 2 -- tools/helpers.go | 5 ----- 9 files changed, 6 insertions(+), 35 deletions(-) diff --git a/flv/FLV.go b/flv/FLV.go index 7884e013..530c351c 100644 --- a/flv/FLV.go +++ b/flv/FLV.go @@ -29,8 +29,6 @@ package flv import "bitbucket.org/ausocean/av/tools" -//"../tools" - const ( headerLength = 72 version = 0x01 diff --git a/generator/FLVGenerator.go b/generator/FLVGenerator.go index 83f14be8..826addc6 100644 --- a/generator/FLVGenerator.go +++ b/generator/FLVGenerator.go @@ -27,10 +27,9 @@ LICENSE package generator import ( - "bitbucket.org/ausocean/av/flv" - //"../flv" - _ "fmt" "time" + + "bitbucket.org/ausocean/av/flv" ) const ( diff --git a/mpegts/MpegTs.go b/mpegts/MpegTs.go index 8cfc6f8e..0012ddd5 100644 --- a/mpegts/MpegTs.go +++ b/mpegts/MpegTs.go @@ -28,14 +28,7 @@ LICENSE package mpegts -import ( - "bitbucket.org/ausocean/av/tools" - - //"../tools" - - _ "errors" - //"fmt" -) +import "bitbucket.org/ausocean/av/tools" const ( mpegTsSize = 188 diff --git a/mpegts/mpegts_test.go b/mpegts/mpegts_test.go index 45e541ac..15600d19 100644 --- a/mpegts/mpegts_test.go +++ b/mpegts/mpegts_test.go @@ -28,10 +28,7 @@ LICENSE package mpegts -import ( - _ "fmt" - "testing" -) +import "testing" // Just ensure that we can create a byte slice with a mpegts packet correctly func TestMpegTsToByteSlice(t *testing.T) { diff --git a/parser/H264Parser.go b/parser/H264Parser.go index 7bf59cd3..06766c7a 100644 --- a/parser/H264Parser.go +++ b/parser/H264Parser.go @@ -27,11 +27,9 @@ LICENSE package parser import ( - "bitbucket.org/ausocean/av/itut" - - //"../itut" - _ "fmt" "time" + + "bitbucket.org/ausocean/av/itut" ) const ( diff --git a/parser/MJPEGParser.go b/parser/MJPEGParser.go index 2990de5e..46aad057 100644 --- a/parser/MJPEGParser.go +++ b/parser/MJPEGParser.go @@ -27,11 +27,6 @@ LICENSE package parser -import ( - //"bitbucket.org/ausocean/av/itut" - _ "fmt" -) - const ( frameStartCode = 0xD8 ) diff --git a/parser/Parser.go b/parser/Parser.go index e75c1f3c..1d68dbb9 100644 --- a/parser/Parser.go +++ b/parser/Parser.go @@ -28,8 +28,6 @@ LICENSE package parser import ( - //"bitbucket.org/ausocean/av/itut" - _ "fmt" "log" "sync" ) diff --git a/revid/Config.go b/revid/Config.go index d2047822..365d1078 100644 --- a/revid/Config.go +++ b/revid/Config.go @@ -29,11 +29,9 @@ package revid import ( "errors" - _ "fmt" "strconv" "bitbucket.org/ausocean/utils/smartlogger" - //"../../utils/smartlogger" ) // Config provides parameters relevant to a revid instance. A new config must diff --git a/tools/helpers.go b/tools/helpers.go index ad1e4ec1..f0576353 100644 --- a/tools/helpers.go +++ b/tools/helpers.go @@ -28,11 +28,6 @@ LICENSE package tools -import ( - _ "fmt" - _ "os" -) - func BoolToByte(in bool) (out byte) { if in { out = 1