Comments (7)
In these cases /tmp/myWonderfullProject and github.com/sigstore/cosign are not Go packages (they do not contain any go files). gocap generate
works on package basis. I should elaborate that more in the readme.
cd /tmp/myWonderfullProject && gocap generate ./cmd/myWonderfullProject > go.cap
should work.
as well as
gocap generate ./cmd/cosign > go.cap
(although this melts my CPU and takes 5min on my laptop because of the high number of dependencies).
Then you can check with cd /tmp/myWonderfullProject && gocap check ./cmd/myWonderfullProject
or gocap check ./cmd/cosign
from gocap.
Can you provide some more information? The content of the main.go
and the output of go list --json .
should help.
from gocap.
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
from gocap.
+1, If I run the following, there is an error in the go.cap
file: could not parse package path
:
$ gocap generate github.com/sigstore/cosign > go.cap
$ cat go.cap
could not parse package path
from gocap.
cd /tmp/myWonderfullProject && gocap generate ./cmd/myWonderfullProject > go.cap
should work.
as well as
Thx for this workaround, it works fine.
Maybe you can just close this issue, after you will update the readme?
from gocap.
@cugu thanks for clarification. But the following check
command does not read go.cap
file i think. 🤔
$ gocap generate ./cmd/myWonderfullProject > go.cap
$ gocap check go.cap
could not parse package path
from gocap.
Try gocap check ./cmd/myWonderfullProject
from gocap.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gocap.