diff --git a/README.md b/README.md index 457c9cf..2730b29 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ #goadb [![Build Status](https://travis-ci.org/zach-klippenstein/goadb.svg?branch=master)](https://travis-ci.org/zach-klippenstein/goadb) -[![GoDoc](https://godoc.org/github.com/zach-klippenstein/goadb?status.svg)](https://godoc.org/github.com/zach-klippenstein/goadb) +[![GoDoc](https://godoc.org/goadb?status.svg)](https://godoc.org/goadb) A Golang library for interacting with the Android Debug Bridge (adb). diff --git a/adb.go b/adb/adb.go similarity index 96% rename from adb.go rename to adb/adb.go index fafb178..8a8e799 100644 --- a/adb.go +++ b/adb/adb.go @@ -3,15 +3,15 @@ package adb import ( "strconv" - "github.com/zach-klippenstein/goadb/internal/errors" - "github.com/zach-klippenstein/goadb/wire" + "goadb/internal/errors" + "goadb/wire" ) /* Adb communicates with host services on the adb server. Eg. - client := adb.New() + client := New() client.ListDevices() See list of services at https://android.googlesource.com/platform/system/core/+/master/adb/SERVICES.TXT. diff --git a/adb_test.go b/adb/adb_test.go similarity index 89% rename from adb_test.go rename to adb/adb_test.go index 34726d9..e298a81 100644 --- a/adb_test.go +++ b/adb/adb_test.go @@ -3,8 +3,9 @@ package adb import ( "testing" + "goadb/wire" + "github.com/stretchr/testify/assert" - "github.com/zach-klippenstein/goadb/wire" ) func TestGetServerVersion(t *testing.T) { diff --git a/device.go b/adb/device.go similarity index 98% rename from device.go rename to adb/device.go index 7cfc91e..b12bb0f 100644 --- a/device.go +++ b/adb/device.go @@ -7,8 +7,8 @@ import ( "strings" "time" - "github.com/zach-klippenstein/goadb/internal/errors" - "github.com/zach-klippenstein/goadb/wire" + "goadb/internal/errors" + "goadb/wire" ) // MtimeOfClose should be passed to OpenWrite to set the file modification time to the time the Close diff --git a/device_descriptor.go b/adb/device_descriptor.go similarity index 100% rename from device_descriptor.go rename to adb/device_descriptor.go diff --git a/device_info.go b/adb/device_info.go similarity index 96% rename from device_info.go rename to adb/device_info.go index 6de96b2..f18549e 100644 --- a/device_info.go +++ b/adb/device_info.go @@ -4,7 +4,7 @@ import ( "bufio" "strings" - "github.com/zach-klippenstein/goadb/internal/errors" + "goadb/internal/errors" ) type DeviceInfo struct { @@ -66,7 +66,7 @@ func parseDeviceShort(line string) (*DeviceInfo, error) { func parseDeviceLong(line string) (*DeviceInfo, error) { fields := strings.Fields(line) - if len(fields) < 5 { + if len(fields) < 4 { return nil, errors.Errorf(errors.ParseError, "malformed device line, expected at least 5 fields but found %d", len(fields)) } diff --git a/device_info_test.go b/adb/device_info_test.go similarity index 100% rename from device_info_test.go rename to adb/device_info_test.go diff --git a/device_state.go b/adb/device_state.go similarity index 80% rename from device_state.go rename to adb/device_state.go index 17e1dfa..8322d4c 100644 --- a/device_state.go +++ b/adb/device_state.go @@ -1,6 +1,6 @@ package adb -import "github.com/zach-klippenstein/goadb/internal/errors" +import "goadb/internal/errors" // DeviceState represents one of the 3 possible states adb will report devices. // A device can be communicated with when it's in StateOnline. @@ -15,12 +15,14 @@ const ( StateDisconnected StateOffline StateOnline + StatUnauthorized ) var deviceStateStrings = map[string]DeviceState{ - "": StateDisconnected, - "offline": StateOffline, - "device": StateOnline, + "": StateDisconnected, + "offline": StateOffline, + "device": StateOnline, + "unauthorized": StatUnauthorized, } func parseDeviceState(str string) (DeviceState, error) { diff --git a/device_state_test.go b/adb/device_state_test.go similarity index 100% rename from device_state_test.go rename to adb/device_state_test.go diff --git a/device_test.go b/adb/device_test.go similarity index 97% rename from device_test.go rename to adb/device_test.go index 29ec441..a3418ee 100644 --- a/device_test.go +++ b/adb/device_test.go @@ -3,9 +3,10 @@ package adb import ( "testing" + "goadb/internal/errors" + "goadb/wire" + "github.com/stretchr/testify/assert" - "github.com/zach-klippenstein/goadb/internal/errors" - "github.com/zach-klippenstein/goadb/wire" ) func TestGetAttribute(t *testing.T) { diff --git a/device_watcher.go b/adb/device_watcher.go similarity index 98% rename from device_watcher.go rename to adb/device_watcher.go index 1c7e6c8..3fbf4a1 100644 --- a/device_watcher.go +++ b/adb/device_watcher.go @@ -8,8 +8,8 @@ import ( "sync/atomic" "time" - "github.com/zach-klippenstein/goadb/internal/errors" - "github.com/zach-klippenstein/goadb/wire" + "goadb/internal/errors" + "goadb/wire" ) /* diff --git a/device_watcher_test.go b/adb/device_watcher_test.go similarity index 98% rename from device_watcher_test.go rename to adb/device_watcher_test.go index 40acccd..cdc76ab 100644 --- a/device_watcher_test.go +++ b/adb/device_watcher_test.go @@ -3,9 +3,10 @@ package adb import ( "testing" + "goadb/internal/errors" + "goadb/wire" + "github.com/stretchr/testify/assert" - "github.com/zach-klippenstein/goadb/internal/errors" - "github.com/zach-klippenstein/goadb/wire" ) func TestParseDeviceStatesSingle(t *testing.T) { diff --git a/devicedescriptortype_string.go b/adb/devicedescriptortype_string.go similarity index 100% rename from devicedescriptortype_string.go rename to adb/devicedescriptortype_string.go diff --git a/devicestate_string.go b/adb/devicestate_string.go similarity index 100% rename from devicestate_string.go rename to adb/devicestate_string.go diff --git a/dialer.go b/adb/dialer.go similarity index 92% rename from dialer.go rename to adb/dialer.go index 5b8274e..bb69dfa 100644 --- a/dialer.go +++ b/adb/dialer.go @@ -5,8 +5,8 @@ import ( "net" "runtime" - "github.com/zach-klippenstein/goadb/internal/errors" - "github.com/zach-klippenstein/goadb/wire" + "goadb/internal/errors" + "goadb/wire" ) // Dialer knows how to create connections to an adb server. diff --git a/dir_entries.go b/adb/dir_entries.go similarity index 98% rename from dir_entries.go rename to adb/dir_entries.go index 1a4b432..889178c 100644 --- a/dir_entries.go +++ b/adb/dir_entries.go @@ -5,7 +5,7 @@ import ( "os" "time" - "github.com/zach-klippenstein/goadb/wire" + "goadb/wire" ) // DirEntry holds information about a directory entry on a device. diff --git a/doc.go b/adb/doc.go similarity index 100% rename from doc.go rename to adb/doc.go diff --git a/error.go b/adb/error.go similarity index 95% rename from error.go rename to adb/error.go index 1249472..6160edb 100644 --- a/error.go +++ b/adb/error.go @@ -1,6 +1,6 @@ package adb -import "github.com/zach-klippenstein/goadb/internal/errors" +import "goadb/internal/errors" type ErrCode errors.ErrCode diff --git a/executable.go b/adb/executable.go similarity index 100% rename from executable.go rename to adb/executable.go diff --git a/executable_unix.go b/adb/executable_unix.go similarity index 100% rename from executable_unix.go rename to adb/executable_unix.go diff --git a/executable_win.go b/adb/executable_win.go similarity index 100% rename from executable_win.go rename to adb/executable_win.go diff --git a/server.go b/adb/server.go similarity index 97% rename from server.go rename to adb/server.go index 68e5896..d87f8a8 100644 --- a/server.go +++ b/adb/server.go @@ -7,8 +7,8 @@ import ( "os/exec" "strings" - "github.com/zach-klippenstein/goadb/internal/errors" - "github.com/zach-klippenstein/goadb/wire" + "goadb/internal/errors" + "goadb/wire" ) const ( diff --git a/server_mock_test.go b/adb/server_mock_test.go similarity index 96% rename from server_mock_test.go rename to adb/server_mock_test.go index fdbb0f8..b7fdf54 100644 --- a/server_mock_test.go +++ b/adb/server_mock_test.go @@ -4,8 +4,8 @@ import ( "io" "strings" - "github.com/zach-klippenstein/goadb/internal/errors" - "github.com/zach-klippenstein/goadb/wire" + "goadb/internal/errors" + "goadb/wire" ) // MockServer implements Server, Scanner, and Sender. diff --git a/server_test.go b/adb/server_test.go similarity index 97% rename from server_test.go rename to adb/server_test.go index a193f23..f2bfb96 100644 --- a/server_test.go +++ b/adb/server_test.go @@ -4,8 +4,9 @@ import ( "fmt" "testing" + "goadb/wire" + "github.com/stretchr/testify/assert" - "github.com/zach-klippenstein/goadb/wire" ) func TestNewServer_ZeroConfig(t *testing.T) { diff --git a/sync_client.go b/adb/sync_client.go similarity index 96% rename from sync_client.go rename to adb/sync_client.go index 09936c6..12752fa 100644 --- a/sync_client.go +++ b/adb/sync_client.go @@ -5,8 +5,8 @@ import ( "os" "time" - "github.com/zach-klippenstein/goadb/internal/errors" - "github.com/zach-klippenstein/goadb/wire" + "goadb/internal/errors" + "goadb/wire" ) var zeroTime = time.Unix(0, 0).UTC() diff --git a/sync_client_test.go b/adb/sync_client_test.go similarity index 93% rename from sync_client_test.go rename to adb/sync_client_test.go index 0d4d681..d889e43 100644 --- a/sync_client_test.go +++ b/adb/sync_client_test.go @@ -7,10 +7,11 @@ import ( "testing" "time" + "goadb/internal/errors" + "goadb/wire" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/zach-klippenstein/goadb/internal/errors" - "github.com/zach-klippenstein/goadb/wire" ) var someTime = time.Date(2015, 5, 3, 8, 8, 8, 0, time.UTC) diff --git a/sync_file_reader.go b/adb/sync_file_reader.go similarity index 96% rename from sync_file_reader.go rename to adb/sync_file_reader.go index 32a09b3..917194f 100644 --- a/sync_file_reader.go +++ b/adb/sync_file_reader.go @@ -3,8 +3,8 @@ package adb import ( "io" - "github.com/zach-klippenstein/goadb/internal/errors" - "github.com/zach-klippenstein/goadb/wire" + "goadb/internal/errors" + "goadb/wire" ) // syncFileReader wraps a SyncConn that has requested to receive a file. diff --git a/sync_file_reader_test.go b/adb/sync_file_reader_test.go similarity index 98% rename from sync_file_reader_test.go rename to adb/sync_file_reader_test.go index 09f0464..3dbec7f 100644 --- a/sync_file_reader_test.go +++ b/adb/sync_file_reader_test.go @@ -6,8 +6,9 @@ import ( "strings" "testing" + "goadb/wire" + "github.com/stretchr/testify/assert" - "github.com/zach-klippenstein/goadb/wire" ) func TestReadNextChunk(t *testing.T) { diff --git a/sync_file_writer.go b/adb/sync_file_writer.go similarity index 96% rename from sync_file_writer.go rename to adb/sync_file_writer.go index d2da8f6..1aa5413 100644 --- a/sync_file_writer.go +++ b/adb/sync_file_writer.go @@ -6,8 +6,8 @@ import ( "os" "time" - "github.com/zach-klippenstein/goadb/internal/errors" - "github.com/zach-klippenstein/goadb/wire" + "goadb/internal/errors" + "goadb/wire" ) // syncFileWriter wraps a SyncConn that has requested to send a file. diff --git a/sync_file_writer_test.go b/adb/sync_file_writer_test.go similarity index 93% rename from sync_file_writer_test.go rename to adb/sync_file_writer_test.go index 993b9da..06eb3b7 100644 --- a/sync_file_writer_test.go +++ b/adb/sync_file_writer_test.go @@ -8,8 +8,9 @@ import ( "encoding/binary" "strings" + "goadb/wire" + "github.com/stretchr/testify/assert" - "github.com/zach-klippenstein/goadb/wire" ) func TestFileWriterWriteSingleChunk(t *testing.T) { @@ -48,7 +49,7 @@ func TestFileWriterWriteLargeChunk(t *testing.T) { assert.NoError(t, err) assert.Equal(t, wire.SyncMaxChunkSize+1, n) - assert.Equal(t, 8 + 8 + wire.SyncMaxChunkSize+1, buf.Len()) + assert.Equal(t, 8+8+wire.SyncMaxChunkSize+1, buf.Len()) // First header. chunk := buf.Bytes()[:8+wire.SyncMaxChunkSize] @@ -58,7 +59,7 @@ func TestFileWriterWriteLargeChunk(t *testing.T) { assert.Equal(t, data[:wire.SyncMaxChunkSize], chunk[8:]) // Second header. - chunk = buf.Bytes()[wire.SyncMaxChunkSize+8:wire.SyncMaxChunkSize+8+1] + chunk = buf.Bytes()[wire.SyncMaxChunkSize+8 : wire.SyncMaxChunkSize+8+1] expectedHeader = []byte("DATA\000\000\000\000") binary.LittleEndian.PutUint32(expectedHeader[4:], 1) assert.Equal(t, expectedHeader, chunk[:8]) diff --git a/util.go b/adb/util.go similarity index 93% rename from util.go rename to adb/util.go index 6d87e6d..95e9527 100644 --- a/util.go +++ b/adb/util.go @@ -6,7 +6,7 @@ import ( "regexp" "strings" - "github.com/zach-klippenstein/goadb/internal/errors" + "goadb/internal/errors" ) var ( diff --git a/util_test.go b/adb/util_test.go similarity index 100% rename from util_test.go rename to adb/util_test.go diff --git a/cmd/adb/main.go b/cmd/adb/main.go index 07d5eac..0177f8a 100644 --- a/cmd/adb/main.go +++ b/cmd/adb/main.go @@ -2,14 +2,14 @@ package main import ( "fmt" + "goadb/adb" "io" "os" "path/filepath" "syscall" "time" - "github.com/cheggaaa/pb" - "github.com/zach-klippenstein/goadb" + "github.com/cheggaaa/pb/v3" "gopkg.in/alecthomas/kingpin.v2" ) @@ -99,7 +99,6 @@ func parseDevice() adb.DeviceDescriptor { } func listDevices(long bool) int { - //client := adb.New(server) devices, err := client.ListDevices() if err != nil { fmt.Fprintln(os.Stderr, "error:", err) @@ -251,24 +250,21 @@ func push(showProgress bool, localPath, remotePath string, device adb.DeviceDesc // After copying, final stats about the transfer speed and size are shown. // Progress and stats are printed to stderr. func copyWithProgressAndStats(dst io.Writer, src io.Reader, size int, showProgress bool) error { - var progress *pb.ProgressBar + var bar *pb.ProgressBar if showProgress && size > 0 { - progress = pb.New(size) + bar = pb.New(size) // Write to stderr in case dst is stdout. - progress.Output = os.Stderr - progress.ShowSpeed = true - progress.ShowPercent = true - progress.ShowTimeLeft = true - progress.SetUnits(pb.U_BYTES) - progress.Start() - dst = io.MultiWriter(dst, progress) + bar.SetWriter(os.Stderr) + bar.Set(pb.Bytes, true) + bar.Start() + dst = bar.NewProxyWriter(dst) } startTime := time.Now() copied, err := io.Copy(dst, src) - if progress != nil { - progress.Finish() + if bar != nil { + bar.Finish() } if pathErr, ok := err.(*os.PathError); ok { diff --git a/cmd/demo/demo.go b/cmd/demo/demo.go index 8de3ce5..2059f92 100644 --- a/cmd/demo/demo.go +++ b/cmd/demo/demo.go @@ -4,12 +4,12 @@ package main import ( "flag" "fmt" + "goadb/adb" "io/ioutil" "log" "time" - adb "github.com/zach-klippenstein/goadb" - "github.com/zach-klippenstein/goadb/internal/errors" + "goadb/internal/errors" ) var ( diff --git a/cmd/raw-adb/raw-adb.go b/cmd/raw-adb/raw-adb.go index 71b00ef..5b0da1a 100644 --- a/cmd/raw-adb/raw-adb.go +++ b/cmd/raw-adb/raw-adb.go @@ -5,13 +5,13 @@ import ( "bufio" "flag" "fmt" + "goadb/adb" "io" "log" "os" "strings" - "github.com/zach-klippenstein/goadb" - "github.com/zach-klippenstein/goadb/wire" + "goadb/wire" ) var port = flag.Int("p", adb.AdbPort, "`port` the adb server is listening on") diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..ddb1f96 --- /dev/null +++ b/go.mod @@ -0,0 +1,12 @@ +module goadb + +go 1.14 + +require ( + github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect + github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect + github.com/cheggaaa/pb/v3 v3.0.4 + github.com/stretchr/testify v1.6.1 + golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae + gopkg.in/alecthomas/kingpin.v2 v2.2.6 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..06b2e39 --- /dev/null +++ b/go.sum @@ -0,0 +1,37 @@ +github.com/VividCortex/ewma v1.1.1 h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdcM= +github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/cheggaaa/pb/v3 v3.0.4 h1:QZEPYOj2ix6d5oEg63fbHmpolrnNiwjUsk+h74Yt4bM= +github.com/cheggaaa/pb/v3 v3.0.4/go.mod h1:7rgWxLrAUcFMkvJuv09+DYi7mMUYi8nO9iOWcvGJPfw= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= +github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54= +github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/wire/conn.go b/wire/conn.go index 2940bdb..2dd884c 100644 --- a/wire/conn.go +++ b/wire/conn.go @@ -1,6 +1,6 @@ package wire -import "github.com/zach-klippenstein/goadb/internal/errors" +import "goadb/internal/errors" const ( // The official implementation of adb imposes an undocumented 255-byte limit diff --git a/wire/scanner.go b/wire/scanner.go index 58f6066..a719cde 100644 --- a/wire/scanner.go +++ b/wire/scanner.go @@ -6,7 +6,7 @@ import ( "io/ioutil" "strconv" - "github.com/zach-klippenstein/goadb/internal/errors" + "goadb/internal/errors" ) // TODO(zach): All EOF errors returned from networoking calls should use ConnectionResetError. diff --git a/wire/scanner_test.go b/wire/scanner_test.go index 3cc696f..a03c530 100644 --- a/wire/scanner_test.go +++ b/wire/scanner_test.go @@ -7,8 +7,9 @@ import ( "io/ioutil" "testing" + "goadb/internal/errors" + "github.com/stretchr/testify/assert" - "github.com/zach-klippenstein/goadb/internal/errors" ) func TestReadStatusOkay(t *testing.T) { diff --git a/wire/sender.go b/wire/sender.go index cb40634..d08b091 100644 --- a/wire/sender.go +++ b/wire/sender.go @@ -4,7 +4,7 @@ import ( "fmt" "io" - "github.com/zach-klippenstein/goadb/internal/errors" + "goadb/internal/errors" ) // Sender sends messages to the server. diff --git a/wire/sync_conn.go b/wire/sync_conn.go index 61740d1..91996e5 100644 --- a/wire/sync_conn.go +++ b/wire/sync_conn.go @@ -1,6 +1,6 @@ package wire -import "github.com/zach-klippenstein/goadb/internal/errors" +import "goadb/internal/errors" const ( // Chunks cannot be longer than 64k. diff --git a/wire/sync_scanner.go b/wire/sync_scanner.go index d18c9de..0a24221 100644 --- a/wire/sync_scanner.go +++ b/wire/sync_scanner.go @@ -6,7 +6,7 @@ import ( "os" "time" - "github.com/zach-klippenstein/goadb/internal/errors" + "goadb/internal/errors" ) type SyncScanner interface { diff --git a/wire/sync_sender.go b/wire/sync_sender.go index f6dae86..49f9607 100644 --- a/wire/sync_sender.go +++ b/wire/sync_sender.go @@ -6,7 +6,7 @@ import ( "os" "time" - "github.com/zach-klippenstein/goadb/internal/errors" + "goadb/internal/errors" ) type SyncSender interface { diff --git a/wire/sync_test.go b/wire/sync_test.go index 03386bf..a66349b 100644 --- a/wire/sync_test.go +++ b/wire/sync_test.go @@ -7,8 +7,9 @@ import ( "testing" "time" + "goadb/internal/errors" + "github.com/stretchr/testify/assert" - "github.com/zach-klippenstein/goadb/internal/errors" ) var ( diff --git a/wire/util.go b/wire/util.go index 66bd7b8..0e95405 100644 --- a/wire/util.go +++ b/wire/util.go @@ -6,7 +6,7 @@ import ( "regexp" "sync" - "github.com/zach-klippenstein/goadb/internal/errors" + "goadb/internal/errors" ) // ErrorResponseDetails is an error message returned by the server for a particular request. diff --git a/wire/util_test.go b/wire/util_test.go index 5bf57ee..a7282c7 100644 --- a/wire/util_test.go +++ b/wire/util_test.go @@ -3,8 +3,9 @@ package wire import ( "testing" + "goadb/internal/errors" + "github.com/stretchr/testify/assert" - "github.com/zach-klippenstein/goadb/internal/errors" ) func TestAdbServerError_NoRequest(t *testing.T) {