Skip to content

Build no longer works on modern go #1

Description

@bobpaul

I had to specify the *.go file to use.

Problem

$ make
go: cannot find main module, but found .git/config in /home/bobpaul/puntar
	to create a module there, run:
	go mod init
go: cannot find main module, but found .git/config in /home/bobpaul/puntar
	to create a module there, run:
	go mod init
Building: 
go build -trimpath
go: cannot find main module, but found .git/config in /home/bobpaul/puntar
	to create a module there, run:
	go mod init
make: *** [Makefile:8: puntar] Error 1

$ go version
go version go1.23.2 linux/ppc64le

$ go list -f '{{.GoFiles}}'
go: cannot find main module, but found .git/config in /home/bobpaul/aur/puntar
	to create a module there, run:
	go mod init

Work Around

Specify the required files. So for linux, do:

$ go build -trimpath np_linux.go puntar.go

$ ./puntar -help
Usage of ./puntar:
  -dir string
    	destination directory (default ".")
  -file string
    	tar file to extract
  -update
    	update existing target
  -verbose
    	enable verbose logging
  -workers uint
    	number of concurrent workers (default 4)

I'm not familiar with the go build system, but I know from other projects that there's a "go" way to do this such that make isn't even needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions