Workspace error,No packages found for open file

61 views
Skip to first unread message

fatih K

unread,
Nov 28, 2025, 1:42:31 AM (7 days ago) Nov 28
to golang-nuts
Hi,I'm facing an issue with go workspaces.My project structure is like 
root directory 
- go.work file in root 
daemon directory 
   daemon go.mod 
cmd directory 
   cmd go.mod,
and go.work file is 
go 1.25.4

use (
./cmd
./daemon
), go mod files are 
module github.com/fatih881/ebpf-ips/daemon

go 1.25.4

require ( ... 
and 
module github.com/fatih881/ebpf-ips/cmd

go 1.25.4
in the cmd/main.go file,I have an error in 
//go:build cmd

package main
No packages found for open file /home/sysadmin/ebpf-ips-safe/cmd/main.go. 
I tried troubleshooting for a while but I can't find a solution.I can provide more info in need or create a issue if it's a bug.Thanks.

fatih K

unread,
Nov 28, 2025, 10:30:22 AM (7 days ago) Nov 28
to golang-nuts

Fixed by removing //go:build cmd tag.
Reply all
Reply to author
Forward
0 new messages