This repository has been archived by the owner on Feb 24, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 579
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extracting module name from go.mod (#1354)
* V0.12.7 (#1349) * Update Bootstrap version https://nvd.nist.gov/vuln/detail/CVE-2018-14041 * update Dockerfile and Makefile; removed go.* * updated to use release * version bump: v0.12.7-rc.1 * generated goreleaser * version bump: v0.12.7-beta.1 * fixed releaser template * generated goreleaser * fixed broken deps * fixed a few lint issues * clean up packr files before gometalinter sees them * fixes CloseNotify lint issue * touch router_test * use the development image * fixes appveyor * compile in sqlite * removed stderr from plugin check * updated deps * removed Gopkg.toml * fixes #750 * package logo.svg into binary * version bump: v0.12.7 * generated goreleaser * fixed tap * generated goreleaser * fixes broken Dockerfile.build on master * extracting module from go.mod * removing start and end from regexp to capture the module name * modifying comment * fixing go.mod * fixing dockerfgile * vadding version.go changes * fixing merges pending * fixing missing conflicts * adding tests for the modules package name * adding other 2 tests * adding testss for empty go.mod
- Loading branch information
1 parent
2365c0c
commit 1cd0d04
Showing
5 changed files
with
106 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Code generated by github.com/gobuffalo/release. DO NOT EDIT. | ||
# Edit .goreleaser.yml.plush instead | ||
|
||
builds: | ||
- | ||
goos: | ||
- darwin | ||
- linux | ||
- windows | ||
env: | ||
- CGO_ENABLED=0 | ||
main: ./buffalo/main.go | ||
|
||
checksum: | ||
name_template: 'checksums.txt' | ||
|
||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
|
||
brew: | ||
github: | ||
owner: gobuffalo | ||
name: homebrew-tap | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package meta | ||
|
||
import ( | ||
"io/ioutil" | ||
"os" | ||
"path/filepath" | ||
"testing" | ||
|
||
"github.com/gobuffalo/envy" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func Test_ModulesPackageName(t *testing.T) { | ||
r := require.New(t) | ||
tmp := os.TempDir() | ||
modsOn = true | ||
|
||
r.NoError(os.Chdir(tmp)) | ||
|
||
tcases := []struct { | ||
Content string | ||
PackageName string | ||
}{ | ||
{"module github.com/wawandco/zekito", "github.com/wawandco/zekito"}, | ||
{"module zekito", "zekito"}, | ||
{"module gopkg.in/some/friday.v2", "gopkg.in/some/friday.v2"}, | ||
{"", "zekito"}, | ||
} | ||
|
||
for _, tcase := range tcases { | ||
envy.Set("GOPATH", tmp) | ||
|
||
t.Run(tcase.Content, func(st *testing.T) { | ||
r := require.New(st) | ||
|
||
r.NoError(ioutil.WriteFile("go.mod", []byte(tcase.Content), 0644)) | ||
|
||
a := New(filepath.Join(tmp, "zekito")) | ||
r.Equal(tcase.PackageName, a.PackagePkg) | ||
}) | ||
} | ||
} |