Skip to content

Commit 86429e7

Browse files
author
Mateusz 'Serafin' Gajewski
committed
Go 1.9
1 parent 475be56 commit 86429e7

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

.goreleaser.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
builds:
2+
- binary: go-bind-plugin
3+
goos:
4+
- linux
5+
goarch:
6+
- amd64
7+
8+
archive:
9+
format: tar.gz
10+
replacements:
11+
amd64: x86_64
12+
files:
13+
- LICENSE
14+
- README.md

.travis.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ os:
44
- linux
55

66
go:
7-
- 1.8
7+
- 1.9
88

99
before_install:
1010
- go get github.com/mattn/goveralls
@@ -26,3 +26,11 @@ script:
2626
- go vet ./...
2727
- go test -v -coverprofile=main.coverprofile ./cli
2828
- $HOME/gopath/bin/goveralls -coverprofile=main.coverprofile -service travis-ci
29+
30+
deploy:
31+
skip_cleanup: true
32+
provider: script
33+
script: test -n "$TRAVIS_TAG" && curl -sL https://git.io/goreleaser | bash
34+
on:
35+
tags: true
36+
all_branches: true

cli/plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func loadPlugin(path string, imports []string) (*pluginStructure, error) {
5454
Package: plug.path,
5555
Size: stat.Size(),
5656
Sha256: shaSum,
57-
importsNames: make(map[string]string),
57+
importsNames: map[string]string{},
5858
}
5959

6060
for _, pkg := range imports {

cli/reflect.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,14 @@ func (p *pluginStructure) getVariableSignature(variable reflect.Type, isVariadic
4040
}
4141

4242
func (p *pluginStructure) getNamedPkgImport(pkg string) string {
43-
4443
if pkg == "" {
4544
return ""
4645
}
4746

47+
if pkg == "main" {
48+
pkg = p.Package
49+
}
50+
4851
importName := pkg[strings.LastIndex(pkg, "/")+1:]
4952
nextIndex := 0
5053

0 commit comments

Comments
 (0)