tinygo-org / drivers

TinyGo drivers for sensors, displays, wireless adaptors, and other devices that use I2C, SPI, GPIO, ADC, and UART interfaces.
https://tinygo.org
BSD 3-Clause "New" or "Revised" License
584 stars 180 forks source link

Problem with go get tinygo.org/x/drivers #645

Closed ukd1 closed 5 months ago

ukd1 commented 5 months ago

Trying to install the drivers does not work on go1.21.1:

% go get tinygo.org/x/drivers
go: go.mod file not found in current directory or any parent directory.
    'go get' is no longer supported outside a module.
    To build and install a command, use 'go install' with a version,
    like 'go install example.com/cmd@latest'
    For more information, see https://golang.org/doc/go-get-install-deprecation
    or run 'go help get' or 'go help install'.
% go install tinygo.org/x/drivers@latest
package tinygo.org/x/drivers is not a main package
%

Tried with tinygo instead of go:

% tinygo get tinygo.org/x/drivers
Unknown command: get
TinyGo is a Go compiler for small places.
version: 0.30.0
.....

My version of go:

% go version
go version go1.21.1 darwin/arm64

Does tinygo require an older version of Go?

conejoninja commented 5 months ago

Hello, looks like you are not using modules , try with

go mod init example.com/myprogram
go get tinygo.org/x/drivers

Here are some more information about how to use modules : https://go.dev/blog/using-go-modules

Closing this issue because it's not related to this repo itself (afaik), but to the use of modules. Feel free to keep commenting here is you encounter any other issue related, we'll try to answer despite it being closed.