diff --git a/.travis.yml b/.travis.yml index d94c36c..83ab894 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ go: - 1.7.x - 1.8.x - 1.9.x + - 1.10.x - tip addons: @@ -14,13 +15,15 @@ addons: install: - go get golang.org/x/tools/cmd/cover - - go get github.com/golang/lint/golint + # Golint requires Go 1.9 or later. + - if ! [[ "$TRAVIS_GO_VERSION" =~ ^1\.7\.([0-9]+|x)$ || "$TRAVIS_GO_VERSION" =~ ^1\.8\.([0-9]+|x)$ ]]; then go get golang.org/x/lint/golint; fi - go get github.com/mattn/goveralls script: # a workaround for go test not supporting coverage for multiple packages in a single invocation. # If goveralls upload fails, ignore the result. - - $HOME/gopath/bin/golint ./... + # Golint requires Go 1.9 or later. + - if ! [[ "$TRAVIS_GO_VERSION" =~ ^1\.7\.([0-9]+|x)+$ || "$TRAVIS_GO_VERSION" =~ ^1\.8\.([0-9]+|x)$ ]]; then $HOME/gopath/bin/golint ./...; fi - |- echo 'mode: count' > coverage.merged && go list ./... | xargs -n1 -I{} sh -c ': > coverage.tmp; go test -v -covermode=count -coverprofile=coverage.tmp {} && tail -n +2 coverage.tmp >> coverage.merged' && rm coverage.tmp - |- diff --git a/device.go b/device.go index d80252f..2882899 100644 --- a/device.go +++ b/device.go @@ -28,7 +28,7 @@ type DeviceDesc struct { Bus int // The bus on which the device was detected Address int // The address of the device on the bus Speed Speed // The negotiated operating speed for the device - Port int // The usb port on which the device was detected + Port int // The usb port on which the device was detected // Version information Spec BCD // USB Specification Release Number diff --git a/example_test.go b/example_test.go index d0ba1ce..9177445 100644 --- a/example_test.go +++ b/example_test.go @@ -65,7 +65,7 @@ func Example_simple() { if numBytes != 5 { log.Fatalf("%s.Write([5]): only %d bytes written, returned error is %v", ep, numBytes, err) } - fmt.Println("5 bytes successfuly sent to the endpoint") + fmt.Println("5 bytes successfully sent to the endpoint") } // This example demostrates the full API for accessing endpoints. @@ -138,7 +138,7 @@ func Example_complex() { if readBytes == 0 { log.Fatalf("IN endpoint 6 returned 0 bytes of data.") } - // writeBytes might be smaller than the buffer size if an error occured. writeBytes might be greater than zero even if err is not nil. + // writeBytes might be smaller than the buffer size if an error occurred. writeBytes might be greater than zero even if err is not nil. writeBytes, err := epOut.Write(buf[:readBytes]) if err != nil { fmt.Println("Write returned an error:", err) diff --git a/interface.go b/interface.go index 2f87095..318de2d 100644 --- a/interface.go +++ b/interface.go @@ -30,7 +30,7 @@ type InterfaceDesc struct { AltSettings []InterfaceSetting } -// String returns a human-readable descripton of the interface descriptor and +// String returns a human-readable description of the interface descriptor and // its alternate settings. func (i InterfaceDesc) String() string { return fmt.Sprintf("Interface %d (%d alternate settings)", i.Number, len(i.AltSettings)) @@ -65,7 +65,7 @@ func (a InterfaceSetting) sortedEndpointIds() []string { return eps } -// String returns a human-readable descripton of the particular +// String returns a human-readable description of the particular // alternate setting of an interface. func (a InterfaceSetting) String() string { return fmt.Sprintf("Interface %d alternate setting %d (available endpoints: %v)", a.Number, a.Alternate, a.sortedEndpointIds()) diff --git a/transfer_stream.go b/transfer_stream.go index b28f1d2..bfd8404 100644 --- a/transfer_stream.go +++ b/transfer_stream.go @@ -224,8 +224,8 @@ func (w *WriteStream) Write(p []byte) (int, error) { // Close signals end of data to write. Close blocks until all transfers // that were sent are finished. The error returned by Close is the first // error encountered during writing the entire stream (if any). -// Close returning nil indicates all transfers completed successfuly. -// After Close, the total number of bytes successfuly written can be +// Close returning nil indicates all transfers completed successfully. +// After Close, the total number of bytes successfully written can be // retrieved using Written(). // Close may not be called concurrently with Write, Close or Written. func (w *WriteStream) Close() error { @@ -247,7 +247,7 @@ func (w *WriteStream) Close() error { return w.s.err } -// Written returns the number of bytes successfuly written by the stream. +// Written returns the number of bytes successfully written by the stream. // Written may be called only after Close() has been called and returned. func (w *WriteStream) Written() int { return w.total