diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index acbfbcb..2a98585 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] # Do not forget to bump every 6 months! - gover: ["1.18"] + gover: ["1.19"] env: PYTHONDONTWRITEBYTECODE: x steps: @@ -101,7 +101,7 @@ jobs: # Windows. os: [ubuntu-latest, macos-latest, windows-latest] # Do not forget to bump every 6 months! - gover: ["1.18"] + gover: ["1.19"] env: PYTHONDONTWRITEBYTECODE: x steps: @@ -277,7 +277,10 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - gover: ['1.13.15'] + # https://github.com/golang/go/issues/55078 + # golang.org/x/sys/unix broke on Go versions before 1.17. Not worth + # fixing. + gover: ['1.17.13'] env: PYTHONDONTWRITEBYTECODE: x steps: @@ -301,7 +304,7 @@ jobs: matrix: os: [ubuntu-latest] # Do not forget to bump every 6 months! - gover: ["1.18"] + gover: ["1.19"] permissions: security-events: write steps: diff --git a/doc.go b/doc.go index 2af0df5..a79615f 100644 --- a/doc.go +++ b/doc.go @@ -9,11 +9,11 @@ // includes registries to enable the application to discover the available // hardware. // -// Concepts +// # Concepts // // periph uses 3 layered concepts for interfacing: // -// Bus → Port → Conn +// Bus → Port → Conn // // Not every subpackage expose all 3 concepts. In fact, most packages don't. // For example, SPI doesn't expose Bus as the OSes generally only expose the @@ -24,7 +24,7 @@ // periph doesn't have yet a concept of star-like communication network, like // an IP network. // -// Bus +// # Bus // // A Bus is a multi-point communication channel where one "master" and multiple // "slaves" communicate together. In the case of periph, the Bus handle is @@ -38,20 +38,20 @@ // communication line (Chip Select (CS) line for SPI, address for I²C or // 1-wire) converts the Bus into a Port. // -// Port +// # Port // // A port is a point-to-point communication channel that is yet to be // initialized. It cannot be used for communication until it is connected and // transformed into a Conn. Configuring a Port converts it into a Conn. Not all // Port need configuration. // -// Conn +// # Conn // // A Conn is a fully configured half or full duplex communication channel that // is point-to-point, only between two devices. It is ready to use like any // readable and/or writable pipe. // -// Subpackages +// # Subpackages // // Most connection-type specific subpackages include subpackages: // diff --git a/go.mod b/go.mod index 8fbe1e4..392bfe9 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,9 @@ module periph.io/x/conn/v3 -go 1.13 +go 1.17 // Warning: do not add any external dependencies here unless absolutely necessary. // This package should primarily depend on the standard library. -require github.com/jonboulle/clockwork v0.2.2 +require github.com/jonboulle/clockwork v0.3.0 diff --git a/go.sum b/go.sum index 76a9264..c27063d 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ= -github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/jonboulle/clockwork v0.3.0 h1:9BSCMi8C+0qdApAp4auwX0RkLGUjs956h0EkuQymUhg= +github.com/jonboulle/clockwork v0.3.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= diff --git a/gpio/gpiostream/gpiostream.go b/gpio/gpiostream/gpiostream.go index 18e77f9..7075d05 100644 --- a/gpio/gpiostream/gpiostream.go +++ b/gpio/gpiostream/gpiostream.go @@ -4,7 +4,7 @@ // Package gpiostream defines digital streams. // -// Warning +// # Warning // // This package is still in flux as development is on-going. package gpiostream @@ -159,7 +159,7 @@ func (p *Program) Duration() time.Duration { // PinIn allows to read a bit stream from a pin. // -// Caveat +// # Caveat // // This interface doesn't enable sampling multiple pins in a // synchronized way or reading in a continuous uninterrupted way. As such, it @@ -179,7 +179,7 @@ type PinIn interface { // Program that is an infinite loop, a separate goroutine can be used to cancel // the program. In this case StreamOut() returns without an error. // -// Caveat +// # Caveat // // This interface doesn't enable streaming to multiple pins in a // synchronized way or reading in a continuous uninterrupted way. As such, it diff --git a/gpio/gpiotest/gpiotest_test.go b/gpio/gpiotest/gpiotest_test.go index 97f857d..dd90d22 100644 --- a/gpio/gpiotest/gpiotest_test.go +++ b/gpio/gpiotest/gpiotest_test.go @@ -6,7 +6,7 @@ package gpiotest import ( "flag" - "io/ioutil" + "io" "log" "os" "reflect" @@ -204,7 +204,7 @@ func init() { func TestMain(m *testing.M) { flag.Parse() if !testing.Verbose() { - log.SetOutput(ioutil.Discard) + log.SetOutput(io.Discard) } os.Exit(m.Run()) } diff --git a/mmr/mmr.go b/mmr/mmr.go index 882e299..85d7fa1 100644 --- a/mmr/mmr.go +++ b/mmr/mmr.go @@ -6,8 +6,8 @@ // Mapped Registers protocol. // // The protocol is defined two supported commands: -// - Write Address, Read Value -// - Write Address, Write Value +// - Write Address, Read Value +// - Write Address, Write Value package mmr import ( diff --git a/onewire/onewire.go b/onewire/onewire.go index c3a2ee4..324f0e7 100644 --- a/onewire/onewire.go +++ b/onewire/onewire.go @@ -17,7 +17,7 @@ // // See https://en.wikipedia.org/wiki/1-Wire for more information. // -// References +// # References // // Overview: https://www.maximintegrated.com/en/app-notes/index.mvp/id/1796 // diff --git a/onewire/onewiretest/onewiretest.go b/onewire/onewiretest/onewiretest.go index 32077af..5a49d0d 100644 --- a/onewire/onewiretest/onewiretest.go +++ b/onewire/onewiretest/onewiretest.go @@ -190,7 +190,6 @@ func (p *Playback) SearchTriplet(direction byte) (onewire.TripletResult, error) return tr, nil } -// // errorf is the internal implementation that optionally panic. // // If dontPanic is false, it panics instead. diff --git a/physic/doc.go b/physic/doc.go index 026e2dd..ac03549 100644 --- a/physic/doc.go +++ b/physic/doc.go @@ -7,15 +7,16 @@ // // This includes temperature, humidity, pressure, tension, current, etc. // -// SI units +// # SI units // // The supported S.I. units is a subset of the official ones. -// T tera 10¹² 1000000000000 -// G giga 10⁹ 1000000000 -// M mega 10⁶ 1000000 -// k kilo 10³ 1000 -// m milli 10⁻³ 0.001 -// µ,u micro 10⁻⁶ 0.000001 -// n nano 10⁻⁹ 0.000000001 -// p pico 10⁻¹² 0.000000000001 +// +// T tera 10¹² 1000000000000 +// G giga 10⁹ 1000000000 +// M mega 10⁶ 1000000 +// k kilo 10³ 1000 +// m milli 10⁻³ 0.001 +// µ,u micro 10⁻⁶ 0.000001 +// n nano 10⁻⁹ 0.000000001 +// p pico 10⁻¹² 0.000000000001 package physic diff --git a/spi/spi.go b/spi/spi.go index 724da06..02bb491 100644 --- a/spi/spi.go +++ b/spi/spi.go @@ -34,7 +34,6 @@ import ( // // The bits can be OR'ed to change the parameters used for // communication. -// type Mode int // Mode determines the SPI communication parameters. diff --git a/spi/spitest/spitest_test.go b/spi/spitest/spitest_test.go index ec40d2e..c5e60cd 100644 --- a/spi/spitest/spitest_test.go +++ b/spi/spitest/spitest_test.go @@ -8,7 +8,7 @@ import ( "bytes" "errors" "flag" - "io/ioutil" + "io" "log" "os" "testing" @@ -339,7 +339,7 @@ func TestLog_Playback(t *testing.T) { func TestMain(m *testing.M) { flag.Parse() if !testing.Verbose() { - log.SetOutput(ioutil.Discard) + log.SetOutput(io.Discard) } os.Exit(m.Run()) }