goncurses: go get works, but not found by go build

66 views
Skip to first unread message

richard thiebaud

unread,
Oct 9, 2021, 6:23:54 PM10/9/21
to golang-nuts
Linux Mint 20.2 go version 1.16

I do this:

dick@dick2:~$ go get github.com/gbin/goncurses
dick@dick2:~$ cd src
dick@dick2:~/src$ go build test.go
test.go:4:2: no required module provides package github.com/gbin/goncurses: go.mod file not found in current directory or any parent directory; see 'go help modules'
dick@dick2:~/src$ find ~ -iname goncurses
/home/dick/go/pkg/mod/cache/download/github.com/gbin/goncurses
/home/dick/go/pkg/mod/cache/download/github.com/rthornton128/goncurses
dick@dick2:~/src$

program source:

package main

import (
    "github.com/gbin/goncurses"
)

var scr *goncurses.Window

func main() {
    scr, _ = goncurses.Init()
    goncurses.end()
}


Kurtis Rader

unread,
Oct 9, 2021, 9:05:38 PM10/9/21
to richard thiebaud, golang-nuts
On Sat, Oct 9, 2021 at 3:23 PM richard thiebaud <giantd...@gmail.com> wrote:
Linux Mint 20.2 go version 1.16

I do this:

dick@dick2:~$ go get github.com/gbin/goncurses
dick@dick2:~$ cd src
dick@dick2:~/src$ go build test.go
test.go:4:2: no required module provides package github.com/gbin/goncurses: go.mod file not found in current directory or any parent directory; see 'go help modules'

Either you don't have a go.mod file or it doesn't contain the goncurses package as a dependency. Have you run `go mod init`?
 
dick@dick2:~/src$ find ~ -iname goncurses
/home/dick/go/pkg/mod/cache/download/github.com/gbin/goncurses
/home/dick/go/pkg/mod/cache/download/github.com/rthornton128/goncurses
dick@dick2:~/src$

program source:

package main

import (
    "github.com/gbin/goncurses"
)

var scr *goncurses.Window

func main() {
    scr, _ = goncurses.Init()
    goncurses.end()
}

--
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
Reply all
Reply to author
Forward
0 new messages