mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-07 13:31:37 +02:00
changing default main from main.go to .
This commit is contained in:
parent
b0319c5604
commit
b77e2cf93e
@ -165,8 +165,8 @@ GoReleaser provides multiple customizations. We will cover them with the help of
|
||||
```yml
|
||||
# goreleaser.yml
|
||||
build:
|
||||
# Path to main.go file.
|
||||
# Default is `main.go`
|
||||
# Path to main.go file or main package.
|
||||
# Default is `.`
|
||||
main: ./cmd/main.go
|
||||
|
||||
# Name of the binary.
|
||||
|
@ -32,7 +32,7 @@ func (Pipe) Run(ctx *context.Context) error {
|
||||
ctx.Config.Build.BinaryName = strings.Split(ctx.Config.Release.Repo, "/")[1]
|
||||
}
|
||||
if ctx.Config.Build.Main == "" {
|
||||
ctx.Config.Build.Main = "main.go"
|
||||
ctx.Config.Build.Main = "."
|
||||
}
|
||||
if len(ctx.Config.Build.Goos) == 0 {
|
||||
ctx.Config.Build.Goos = []string{"linux", "darwin"}
|
||||
|
@ -19,7 +19,7 @@ func TestFillBasicData(t *testing.T) {
|
||||
|
||||
assert.Equal("goreleaser/goreleaser", ctx.Config.Release.Repo)
|
||||
assert.Equal("goreleaser", ctx.Config.Build.BinaryName)
|
||||
assert.Equal("main.go", ctx.Config.Build.Main)
|
||||
assert.Equal(".", ctx.Config.Build.Main)
|
||||
assert.Equal("tar.gz", ctx.Config.Archive.Format)
|
||||
assert.Contains(ctx.Config.Build.Goos, "darwin")
|
||||
assert.Contains(ctx.Config.Build.Goos, "linux")
|
||||
@ -51,8 +51,6 @@ func TestFilesFilled(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAcceptFiles(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
var files = []string{
|
||||
"LICENSE.md",
|
||||
"LIceNSE.txt",
|
||||
@ -66,6 +64,8 @@ func TestAcceptFiles(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, file := range files {
|
||||
assert.True(accept(file))
|
||||
t.Run(file, func(t *testing.T) {
|
||||
assert.True(t, accept(file))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user