-
Notifications
You must be signed in to change notification settings - Fork 12
doesn't work with my local project #3
Comments
Can you provide some more information? The content of the |
I think the root cause is the directory, that contains go.mod & go.sum, doesn't contain go files, that is not acctually in my previous given example. so I give another example: mkdir -p /tmp/myWonderfullProject/cmd/myWonderfullProject
cd /tmp/myWonderfullProject
echo 'package main
import "github.com/gin-gonic/gin"
func main() {
r := gin.Default()
r.GET("/ping", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "pong",
})
})
r.Run() // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
}' > /tmp/myWonderfullProject/cmd/myWonderfullProject/main.go
go mod tidy
tree /tmp/myWonderfullProject
/tmp/myWonderfullProject
├── cmd
│ └── myWonderfullProject
│ └── main.go
├── go.mod
└── go.sum
gocap generate /tmp/myWonderfullProject
could not parse package path |
+1, If I run the following, there is an error in the
|
In these cases /tmp/myWonderfullProject and github.com/sigstore/cosign are not Go packages (they do not contain any go files).
Then you can check with |
Thx for this workaround, it works fine. |
@cugu thanks for clarification. But the following
|
Try |
in my local project (that means directory with go.mod & go.sum), when I run
I expect that go.cap has been generated with all modules (direct & transitive) pined into my go.mod & go.sum.
The text was updated successfully, but these errors were encountered: