Skip to content

Commit

Permalink
Update minimum go to 1.17
Browse files Browse the repository at this point in the history
Update dependency.
Update github actions too.
Ran gofmt.
Get rid of io/ioutil.
  • Loading branch information
Marc-Antoine Ruel committed Oct 27, 2022
1 parent 4380c3c commit f88d4d2
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 35 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
12 changes: 6 additions & 6 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
//
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
6 changes: 3 additions & 3 deletions gpio/gpiostream/gpiostream.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// Package gpiostream defines digital streams.
//
// Warning
// # Warning
//
// This package is still in flux as development is on-going.
package gpiostream
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions gpio/gpiotest/gpiotest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package gpiotest

import (
"flag"
"io/ioutil"
"io"
"log"
"os"
"reflect"
Expand Down Expand Up @@ -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())
}
4 changes: 2 additions & 2 deletions mmr/mmr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion onewire/onewire.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
1 change: 0 additions & 1 deletion onewire/onewiretest/onewiretest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
19 changes: 10 additions & 9 deletions physic/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion spi/spi.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions spi/spitest/spitest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"bytes"
"errors"
"flag"
"io/ioutil"
"io"
"log"
"os"
"testing"
Expand Down Expand Up @@ -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())
}

0 comments on commit f88d4d2

Please sign in to comment.