go list fails, how do I clear "-mod=readonly"

368 views
Skip to first unread message

Pat Farrell

unread,
Oct 16, 2023, 5:20:13 PM10/16/23
to golang-nuts
i'm running
go version go1.20.5 linux/amd64 

when I attempt to run 'go list' to find any updated to dependant
modules, it fails.

go list -m -u all
go: updates to go.sum needed, disabled by -mod=readonly

I've checked, and my go.mod and go.sum files are 777

-rwxrwxrwx 1 pfarrell pfarrell  408 Oct  1 10:37 go.mod*
-rwxrwxrwx 1 pfarrell pfarrell 3025 Oct  1 10:37 go.sum*

What am I doing wrong?
How do I get a list of updated modules?

thanks
pat

TheDiveO

unread,
Oct 16, 2023, 5:22:42 PM10/16/23
to golang-nuts
go mod tidy

Pat Farrell

unread,
Oct 16, 2023, 5:25:46 PM10/16/23
to golang-nuts
On Monday, October 16, 2023 at 1:22:42 PM UTC-4 TheDiveO wrote:
go mod tidy

I've done that, and while it just executes quietly, I don't see how that addresses the
issue that 'go list' fails to show me modules that have been updated.

thanks
pat

TheDiveO

unread,
Oct 16, 2023, 5:57:57 PM10/16/23
to golang-nuts

Pat Farrell

unread,
Oct 16, 2023, 8:21:11 PM10/16/23
to golang-nuts
yes that is it.
 I see that there is a patch that will be in the next release.

Anyone know of a workaround until then?

thanks

Jason Phillips

unread,
Oct 16, 2023, 9:12:41 PM10/16/23
to golang-nuts
I believe the fixes have already been released. Go 1.21 was released in August and there have been 5 point releases to 1.20 since your version (1.20.5) was released. Have you tried updating your Go toolchain?

Pat Farrell

unread,
Oct 18, 2023, 2:13:44 AM10/18/23
to golang-nuts
yes, thanks
I updated to the latest go and no longer get the error

I'm not sure I understand the output that I'm getting now, but that
is a subject for more research on my par
Reply all
Reply to author
Forward
0 new messages