diff --git a/Dockerfile b/Dockerfile index 3cba1b1..4888cfd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ ADD . . RUN GOOS=$(echo $TARGETPLATFORM | cut -f1 -d/) && \ GOARCH=$(echo $TARGETPLATFORM | cut -f2 -d/) && \ GOARM=$(echo $TARGETPLATFORM | cut -f3 -d/ | sed "s/v//" ) && \ - CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} GOARM=${GOARM} go build -mod vendor -tags netgo ./cmd/rc-pca9685/ + CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} GOARM=${GOARM} go build -mod vendor -tags netgo,no_d2xx ./cmd/rc-pca9685/ FROM gcr.io/distroless/static diff --git a/go.mod b/go.mod index e7d1bbe..b161e10 100644 --- a/go.mod +++ b/go.mod @@ -15,9 +15,9 @@ require ( require ( github.com/gorilla/websocket v1.4.2 // indirect - github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect + github.com/stretchr/testify v1.6.1 // indirect golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0 // indirect golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea // indirect google.golang.org/protobuf v1.26.0 // indirect - periph.io/x/d2xx v0.0.1 // indirect + periph.io/x/d2xx v0.0.3 // indirect ) diff --git a/go.sum b/go.sum index 3643c85..360a04d 100644 --- a/go.sum +++ b/go.sum @@ -4,64 +4,59 @@ github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcy github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/containerd/containerd v1.4.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/cyrilix/robocar-base v0.1.0 h1:WCx16VxGd7iTS2WdDHdY7p9k5inviZF96vgkEQruql8= -github.com/cyrilix/robocar-base v0.1.0/go.mod h1:U6tjaylQtSC5C1NzeZnfKhc2v7mF7BSuCgdJ7/nJ3IA= github.com/cyrilix/robocar-base v0.1.4 h1:nfnjRwAcCfS7xGu6tW9rZhmc/HZIsuDJX5NFhgX5dWE= github.com/cyrilix/robocar-base v0.1.4/go.mod h1:Tt04UmbGBiQtU0Cn3wFD0q7XoyokTwIlWYQxThKI+04= -github.com/cyrilix/robocar-protobuf/go v1.0.0 h1:kPsmmYakcIWd/Y73YDufbdILJUna0tJcteKKWlNfVFY= -github.com/cyrilix/robocar-protobuf/go v1.0.0/go.mod h1:I+i6Ujns+4DmRmmUej56MItlmT4K2zlMZ35vZrHEfQ4= github.com/cyrilix/robocar-protobuf/go v1.0.3 h1:iPHw2+7FVXG2C4+Th1m11hQ+2RpAQzlxKhc5M7XOa6Q= github.com/cyrilix/robocar-protobuf/go v1.0.3/go.mod h1:xb95cK07lYXnKcHZKnGafmAgYRrqZWZgV9LMiJAp+gE= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v0.7.3-0.20190506211059-b20a14b54661/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v17.12.0-ce-rc1.0.20200916142827-bd33bbf0497b+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/eclipse/paho.mqtt.golang v1.2.0 h1:1F8mhG9+aO5/xpdtFkW4SxOJB67ukuDC3t2y2qayIX0= -github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= github.com/eclipse/paho.mqtt.golang v1.3.5 h1:sWtmgNxYM9P2sP+xEItMozsR3w0cqZFlqnNN1bdl41Y= github.com/eclipse/paho.mqtt.golang v1.3.5/go.mod h1:eTzb4gxwwyWpqBUHGQZ4ABAV7+Jgm1PklsYT/eo8Hcc= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= -github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= -github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= -github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/maruel/ansi256 v1.0.2/go.mod h1:x7uow2KFkUgjdzvYHyfZuMEOTGKvCYLyVUHIVg1vYic= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -77,10 +72,7 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -88,9 +80,10 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/testcontainers/testcontainers-go v0.3.0/go.mod h1:br7bkzIukhPSIjy07Ma3OuXjjFvl2jm7CDU0LQNsqLw= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/testcontainers/testcontainers-go v0.9.0/go.mod h1:b22BFXhRbg4PJmeMVWh6ftqjyZHgiIl3w274e9r3C2E= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -98,7 +91,6 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0 h1:Jcxah/M+oLZ/R4/z5RzfPzGbPXnVDPkEDtf2JnuxN+U= golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= @@ -108,8 +100,6 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -117,9 +107,12 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea h1:+WiDlPBBaO+h9vPNZi8uJ3k4BkKQB7Iow3aqwHVA5hI= golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180810170437-e96c4e24768d/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -130,18 +123,20 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/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= gotest.tools v0.0.0-20181223230014-1083505acf35/go.mod h1:R//lfYlUuTOTfblYI3lGoAAAebUdzjvbmQsuB7Ykd90= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= periph.io/x/conn/v3 v3.6.8 h1:fnNSwSoKPzpoLOSxml70EInaP6YrrqcucP3KDfNxpmU= periph.io/x/conn/v3 v3.6.8/go.mod h1:3OD27w9YVa5DS97VsUxsPGzD9Qrm5Ny7cF5b6xMMIWg= -periph.io/x/d2xx v0.0.1 h1:7iCO/aVK6k9GSZ45DcpMU8sOOcVLCqO/cheSm7nMUG0= periph.io/x/d2xx v0.0.1/go.mod h1:38Euaaj+s6l0faIRHh32a+PrjXvxFTFkPBEQI0TKg34= +periph.io/x/d2xx v0.0.3 h1:BE8XcIdxabu9ZzAr1UXxSz88T9Txki6Xyo8aJ1qZvks= +periph.io/x/d2xx v0.0.3/go.mod h1:38Euaaj+s6l0faIRHh32a+PrjXvxFTFkPBEQI0TKg34= periph.io/x/devices/v3 v3.6.11 h1:1BtnoM1tP6tWdJc0nSwMnTg33HXoSn6MX3bUycGyV/A= periph.io/x/devices/v3 v3.6.11/go.mod h1:IMAwLNCAspcOhWed1siiZYlFlj2btxp9XIPBzzgNIvQ= periph.io/x/host/v3 v3.7.0 h1:9CP/j0FcJmR+PRHlNzAmhV6Mt3GXoWnPmRhknJlQhnE= diff --git a/vendor/modules.txt b/vendor/modules.txt index a6c5c66..a9f97a7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -16,11 +16,11 @@ github.com/golang/protobuf/ptypes/timestamp # github.com/gorilla/websocket v1.4.2 ## explicit; go 1.12 github.com/gorilla/websocket -# github.com/konsorten/go-windows-terminal-sequences v1.0.1 -## explicit # github.com/sirupsen/logrus v1.8.1 ## explicit; go 1.13 github.com/sirupsen/logrus +# github.com/stretchr/testify v1.6.1 +## explicit; go 1.13 # golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0 ## explicit; go 1.11 golang.org/x/net/internal/socks @@ -75,7 +75,7 @@ periph.io/x/conn/v3/pin periph.io/x/conn/v3/pin/pinreg periph.io/x/conn/v3/spi periph.io/x/conn/v3/spi/spireg -# periph.io/x/d2xx v0.0.1 +# periph.io/x/d2xx v0.0.3 ## explicit; go 1.13 periph.io/x/d2xx # periph.io/x/devices/v3 v3.6.11 diff --git a/vendor/periph.io/x/d2xx/README.md b/vendor/periph.io/x/d2xx/README.md index 7a3f660..d88b512 100644 --- a/vendor/periph.io/x/d2xx/README.md +++ b/vendor/periph.io/x/d2xx/README.md @@ -3,9 +3,6 @@ Package d2xx is a thin Go wrapper for the Future Technology "D2XX" driver at https://ftdichip.com/drivers/d2xx-drivers/. -See https://periph.io/device/ftdi/ for more details, and how to configure -the host to be able to use this driver. - This package is not Go idiomatic. You will want to use https://periph.io/x/host/v3/ftdi (or later) instead. @@ -14,3 +11,34 @@ But if you really want, here it goes: This Go package includes third party software. See [third_party/README.md](third_party/README.md). + +## Configuration + +See https://periph.io/device/ftdi/ to configure the host to be able to use this +driver. + +## Availability + +On darwin_amd64, linux_amd64 linux_arm (v6, v7 compatible) and linux_arm64 (v8), +cgo is required. If cgo is disabled (via `CGO_ENABLED=0`), all functions in this +driver return error [NoCGO](https://periph.io/x/d2xx#NoCGO). + +On Windows, cgo is not required. If the dynamic library is not found at runtime, +[Missing](https://periph.io/x/d2xx#Missing) is returned. + +## bcm2385 + +On linux_arm (v6), hard-float is required. For cross compilation, this +means arm-linux-gnueabihf-gcc is preferred to arm-linux-gnueabi-gcc. Using +hardfloat causes a segfault on Raspberry Pi 1, Zero and Zero Wireless. It is +recommended to disable this driver if targeting these hosts, see below. + +## Disabling + +To disable this driver, build with tag `no_d2xx`, e.g. + +``` +go install -tags no_d2xx periph.io/x/cmd/gpio-list@latest +``` + +This will behave has if cgo was disabled, even on Windows. diff --git a/vendor/periph.io/x/d2xx/d2xx.go b/vendor/periph.io/x/d2xx/d2xx.go index 79890c3..c004aca 100644 --- a/vendor/periph.io/x/d2xx/d2xx.go +++ b/vendor/periph.io/x/d2xx/d2xx.go @@ -14,9 +14,8 @@ type Err int // These are additional synthetic error codes. const ( // NoCGO is returned when the package was compiled without cgo, thus the d2xx - // library is unavailable. - // - // This is never returned on Windows. + // library is unavailable or the library was disabled via the `no_d2xx` build + // tag. NoCGO Err = -2 // Missing is returned when the dynamic library is not available. Missing Err = -1 @@ -117,16 +116,30 @@ type Handle interface { var _ Handle = handle(0) // Version returns the library's version. +// +// 0, 0, 0 is returned if the library is unavailable. func Version() (uint8, uint8, uint8) { return version() } // CreateDeviceInfoList discovers the currently found devices. +// +// If the driver is disabled via build tag `no_d2xx`, or on posix +// `CGO_ENABLED=0` environment variable, NoCGO is returned. +// +// On Windows, Missing is returned if the dynamic library is not found at +// runtime. func CreateDeviceInfoList() (int, Err) { return createDeviceInfoList() } // Open opens the ith device discovered. +// +// If the driver is disabled via build tag `no_d2xx`, or on posix +// `CGO_ENABLED=0` environment variable, NoCGO is returned. +// +// On Windows, Missing is returned if the dynamic library is not found at +// runtime. func Open(i int) (Handle, Err) { return open(i) } diff --git a/vendor/periph.io/x/d2xx/d2xx_darwin_amd64.go b/vendor/periph.io/x/d2xx/d2xx_darwin_amd64.go index 3fa84a9..af05345 100644 --- a/vendor/periph.io/x/d2xx/d2xx_darwin_amd64.go +++ b/vendor/periph.io/x/d2xx/d2xx_darwin_amd64.go @@ -3,6 +3,7 @@ // that can be found in the LICENSE file. // +build cgo +// +build !no_d2xx package d2xx diff --git a/vendor/periph.io/x/d2xx/d2xx_linux_amd64.go b/vendor/periph.io/x/d2xx/d2xx_linux_amd64.go index cb3b46d..a11052c 100644 --- a/vendor/periph.io/x/d2xx/d2xx_linux_amd64.go +++ b/vendor/periph.io/x/d2xx/d2xx_linux_amd64.go @@ -3,10 +3,11 @@ // that can be found in the LICENSE file. // +build cgo +// +build !no_d2xx package d2xx /* -#cgo LDFLAGS: ${SRCDIR}/third_party/libftd2xx_linux_amd64_v1.4.6.a +#cgo LDFLAGS: ${SRCDIR}/third_party/libftd2xx_linux_amd64_v1.4.24.a */ import "C" diff --git a/vendor/periph.io/x/d2xx/d2xx_linux_arm.go b/vendor/periph.io/x/d2xx/d2xx_linux_arm.go index 014592c..b6081ee 100644 --- a/vendor/periph.io/x/d2xx/d2xx_linux_arm.go +++ b/vendor/periph.io/x/d2xx/d2xx_linux_arm.go @@ -3,6 +3,7 @@ // that can be found in the LICENSE file. // +build cgo +// +build !no_d2xx package d2xx @@ -10,6 +11,6 @@ package d2xx // optimal ARM architecture. /* -#cgo LDFLAGS: ${SRCDIR}/third_party/libftd2xx_linux_arm6hf_v1.4.6.a +#cgo LDFLAGS: ${SRCDIR}/third_party/libftd2xx_linux_arm6hf_v1.4.24.a */ import "C" diff --git a/vendor/periph.io/x/d2xx/d2xx_linux_arm64.go b/vendor/periph.io/x/d2xx/d2xx_linux_arm64.go new file mode 100644 index 0000000..4d951ca --- /dev/null +++ b/vendor/periph.io/x/d2xx/d2xx_linux_arm64.go @@ -0,0 +1,13 @@ +// Copyright 2021 The Periph Authors. All rights reserved. +// Use of this source code is governed under the Apache License, Version 2.0 +// that can be found in the LICENSE file. + +// +build cgo +// +build !no_d2xx + +package d2xx + +/* +#cgo LDFLAGS: ${SRCDIR}/third_party/libftd2xx_linux_arm64_v1.4.24.a +*/ +import "C" diff --git a/vendor/periph.io/x/d2xx/d2xx_posix.go b/vendor/periph.io/x/d2xx/d2xx_posix.go index 5cc3d52..40119e1 100644 --- a/vendor/periph.io/x/d2xx/d2xx_posix.go +++ b/vendor/periph.io/x/d2xx/d2xx_posix.go @@ -2,7 +2,9 @@ // Use of this source code is governed under the Apache License, Version 2.0 // that can be found in the LICENSE file. +// +build cgo // +build !windows +// +build !no_d2xx package d2xx diff --git a/vendor/periph.io/x/d2xx/d2xx_posix_no_cgo.go b/vendor/periph.io/x/d2xx/d2xx_posix_no_cgo.go index cc2382f..5fbbc8f 100644 --- a/vendor/periph.io/x/d2xx/d2xx_posix_no_cgo.go +++ b/vendor/periph.io/x/d2xx/d2xx_posix_no_cgo.go @@ -2,8 +2,8 @@ // Use of this source code is governed under the Apache License, Version 2.0 // that can be found in the LICENSE file. -// +build !cgo -// +build !windows +// +build !cgo no_d2xx +// +build !windows no_d2xx package d2xx diff --git a/vendor/periph.io/x/d2xx/d2xx_posix_other.go b/vendor/periph.io/x/d2xx/d2xx_posix_other.go index 09a0538..8db5d18 100644 --- a/vendor/periph.io/x/d2xx/d2xx_posix_other.go +++ b/vendor/periph.io/x/d2xx/d2xx_posix_other.go @@ -7,9 +7,12 @@ // +build !linux,!amd64 // +build !linux,!arm // +build !windows +// +build !no_d2xx package d2xx +// This assumes the library is installed and available for linking. + /* #cgo LDFLAGS: -lftd2xx */ diff --git a/vendor/periph.io/x/d2xx/d2xx_windows.go b/vendor/periph.io/x/d2xx/d2xx_windows.go index 2c840ce..8429f34 100644 --- a/vendor/periph.io/x/d2xx/d2xx_windows.go +++ b/vendor/periph.io/x/d2xx/d2xx_windows.go @@ -2,6 +2,8 @@ // Use of this source code is governed under the Apache License, Version 2.0 // that can be found in the LICENSE file. +// +build !no_d2xx + package d2xx import ( @@ -22,15 +24,21 @@ func version() (uint8, uint8, uint8) { } func createDeviceInfoList() (int, Err) { - var num uint32 - r1, _, _ := pCreateDeviceInfoList.Call(uintptr(unsafe.Pointer(&num))) - return int(num), Err(r1) + if pCreateDeviceInfoList != nil { + var num uint32 + r1, _, _ := pCreateDeviceInfoList.Call(uintptr(unsafe.Pointer(&num))) + return int(num), Err(r1) + } + return 0, Missing } func open(i int) (Handle, Err) { var h handle - r1, _, _ := pOpen.Call(uintptr(i), uintptr(unsafe.Pointer(&h))) - return h, Err(r1) + if pOpen != nil { + r1, _, _ := pOpen.Call(uintptr(i), uintptr(unsafe.Pointer(&h))) + return h, Err(r1) + } + return h, Missing } func (h handle) Close() Err { diff --git a/vendor/periph.io/x/d2xx/doc.go b/vendor/periph.io/x/d2xx/doc.go index 12e0c59..116e5e8 100644 --- a/vendor/periph.io/x/d2xx/doc.go +++ b/vendor/periph.io/x/d2xx/doc.go @@ -5,9 +5,9 @@ // Package d2xx is a thin Go wrapper for the Future Technology "D2XX" driver. // // This package is not Go idiomatic. You want to use -// https://periph.io/x/host/v3/ftdi instead. +// https://periph.io/x/host/v3/ftdi (or later) instead. // -// A binary copy of the d2xx driver is included for linux and macOS. They are +// A static library of the d2xx driver is included for linux and macOS. They are // from https://ftdichip.com/drivers/d2xx-drivers/. See third_party/README.md // for more details. // @@ -15,7 +15,4 @@ // // See https://periph.io/device/ftdi/ for more details, and how to configure // the host to be able to use this driver. -// -// Windows 10 automatically fetches the driver from Windows Update upon -// connecting a FTDI device on the firt time, so no need to download a driver. package d2xx diff --git a/vendor/periph.io/x/d2xx/test.sh b/vendor/periph.io/x/d2xx/test.sh index a491258..5356949 100644 --- a/vendor/periph.io/x/d2xx/test.sh +++ b/vendor/periph.io/x/d2xx/test.sh @@ -4,8 +4,6 @@ # that can be found in the LICENSE file. # Builds the package on multiple OSes to confirm it builds fine. -# -# It is recommended to use the -i flag so subsequent runs are much faster. set -eu @@ -13,13 +11,33 @@ cd `dirname $0` OPT=$* +# Do not set CGO_ENABLED, as we want the default behavior when cross compiling, +# which is different from when CGO_ENABLED=1. +export -n CGO_ENABLED + +# Cleanup. +export -n GOOS +export -n GOARCH + function build { - echo "Testing on $1/$2" - GOOS=$1 GOARCH=$2 go build $OPT + export GOOS=$1 + export GOARCH=$2 + echo "Building on $GOOS/$GOARCH" + go build $OPT + echo "Building on $GOOS/$GOARCH - no_d2xx" + go build -tags no_d2xx $OPT + echo "Building on $GOOS/$GOARCH - no cgo" + CGO_ENABLED=0 go build $OPT + echo "Building on $GOOS/$GOARCH - no cgo, no_d2xx" + CGO_ENABLED=0 go build -tags no_d2xx $OPT } -build darwin amd64 -build linux amd64 -build linux arm +CGO_ENABLED=1 CC=x86_64-linux-gnu-gcc build linux amd64 +# Requires: sudo apt install gcc-arm-linux-gnueabihf +CGO_ENABLED=1 CC=arm-linux-gnueabihf-gcc build linux arm +# Requires: sudo apt install gcc-aarch64-linux-gnu +CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc build linux arm64 + build linux 386 build windows amd64 +build darwin amd64