Importing non-module based code

30 views
Skip to first unread message

Robert Engels

unread,
9:41 AM (10 hours ago) 9:41 AM
to golang-nuts
Has it changed so that Go repo that imports a from another repo that doesn’t use modules no longer works? Maybe a recent change?

I have a repo github.com/robaho/go-trader that imports githut.com/robaho/gocui (which is a fork that doesn’t use modules).

I directly import from github.com/robaho/gocui and my go.mod has


The go get works, and the code is there, but it isn’t seeing my code - it seems like it is using the original gocui which has since added module support.

cmd/client/main.go:43:7: gui.Update undefined (type *gocui.Gui has no field or method Update)
cmd/client/main.go:65:6: gui.Update undefined (type *gocui.Gui has no field or method Update)
cmd/client/main.go:78:6: gui.Update undefined (type *gocui.Gui has no field or method Update)
cmd/client/main.go:104:6: gui.Update undefined (type *gocui.Gui has no field or method Update)
cmd/client/main.go:166:6: gui.Update undefined (type *gocui.Gui has no field or method Update)
cmd/client/main.go:213:5: v.MaxLines undefined (type *gocui.View has no field or method MaxLines)
cmd/client/main.go:226:5: v.MaxLines undefined (type *gocui.View has no field or method MaxLines)
cmd/client/main.go:234:5: v.MaxLines undefined (type *gocui.View has no field or method MaxLines)
cmd/client/main.go:251:5: v.Editor undefined (type *gocui.View has no field or method Editor)
cmd/client/main.go:256:5: g.Update undefined (type *gocui.Gui has no field or method Update)
cmd/client/main.go:256:5: too many errors

but these methods are defined in the robaho fork of gocui

I can add module support to my fork but it seems like this shouldn't be necessary… ???

robert engels

unread,
9:46 AM (10 hours ago) 9:46 AM
to Robert Engels, golang-nuts
I think I figured it out. I need to create a tag I guess? Since @latest doesn’t pull head ?

This seems to have changed, because I “think” this used to compile fine.



--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/5F9D9A4C-5437-46BA-9ED2-681FA67EDC1D%40me.com.

Jan Mercl

unread,
9:48 AM (10 hours ago) 9:48 AM
to Robert Engels, golang-nuts
On Tue, Jul 16, 2024 at 3:41 PM 'Robert Engels' via golang-nuts
<golan...@googlegroups.com> wrote:

> The go get works, and the code is there, but it isn’t seeing my code - it seems like it is using the original gocui which has since added module support.
>
> cmd/client/main.go:43:7: gui.Update undefined (type *gocui.Gui has no field or method Update)
....
>
> but these methods are defined in the robaho fork of gocui

Those methods are not defined:
https://pkg.go.dev/github.com/jroimartin/go...@v0.3.0

Robert Engels

unread,
9:49 AM (10 hours ago) 9:49 AM
to Jan Mercl, golang-nuts
Thanks. Yea, because it needs a later tag now. I guess it never compiled after I changed go-trader to use modules.

Robert Engels

unread,
9:51 AM (10 hours ago) 9:51 AM
to Jan Mercl, golang-nuts
Weird, even after I added the tag, using @latest did not pull the latest code, I needed to specify the tag specifically @v0.3.1

Jason Phillips

unread,
9:53 AM (10 hours ago) 9:53 AM
to golang-nuts
You don't mention what version of Go you're using but, note from the Go 1.22 release notes:

> go get is no longer supported outside of a module in the legacy GOPATH mode (that is, with GO111MODULE=off). Other build commands, such as go build and go test, will continue to work indefinitely for legacy GOPATH programs.

Jan Mercl

unread,
9:56 AM (10 hours ago) 9:56 AM
to Robert Engels, golang-nuts
On Tue, Jul 16, 2024 at 3:50 PM Robert Engels <rob...@me.com> wrote:
>
> Weird, even after I added the tag, using @latest did not pull the latest code, I needed to specify the tag specifically @v0.3.1


I think I see the exported identifiers you need in v0.3.1, published
2018: https://pkg.go.dev/github.com/robaho/go...@v0.3.1

Robert Engels

unread,
9:58 AM (10 hours ago) 9:58 AM
to Jan Mercl, golang-nuts
Yes, I just added that tag and pushed it, but @latest wouldn’t pick it up for some reason, needed to specify the release exactly using @v0.3.1

robert engels

unread,
10:01 AM (10 hours ago) 10:01 AM
to Jason Phillips, golang-nuts
I have go 1.21 specified in the go.mod, but I don’t think that mattered.

I added a tag to include my changes to my gocui and pushed (still did not add a go mod there), and it seems to work if I specify the tagged version - @latest did not pick it up, but maybe that uses the central registry which hadn’t updated yet. 

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.

Jan Mercl

unread,
10:01 AM (10 hours ago) 10:01 AM
to Robert Engels, golang-nuts
On Tue, Jul 16, 2024 at 3:57 PM Robert Engels <rob...@me.com> wrote:

> Yes, I just added that tag and pushed it, but @latest wouldn’t pick it up for some reason, needed to specify the release exactly using @v0.3.1

@latest is the "latest" known to the proxy server. It has some varying
delay to update.

Robert Engels

unread,
10:03 AM (10 hours ago) 10:03 AM
to Jan Mercl, golang-nuts
Thanks. Make sense.
Reply all
Reply to author
Forward
0 new messages