Avoid shadowing package name (#410)

* chore: avoid shadowing package name

* fix: use constant format in call to Sprintf

* chore: try to make go1.9 work on travis
This commit is contained in:
Martin Linkhorst 2017-12-01 16:52:51 +01:00 committed by GitHub
parent 06e70ca8d0
commit 0f85859af0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View File

@ -7,6 +7,7 @@ language: go
go: go:
- 1.8 - 1.8
- 1.9
- tip - tip
matrix: matrix:
@ -15,7 +16,7 @@ matrix:
before_install: before_install:
- go get github.com/mattn/goveralls - go get github.com/mattn/goveralls
- go get -u github.com/alecthomas/gometalinter - go get github.com/alecthomas/gometalinter
install: install:
- gometalinter --install - gometalinter --install

View File

@ -28,11 +28,14 @@ import (
"github.com/kubernetes-incubator/external-dns/provider" "github.com/kubernetes-incubator/external-dns/provider"
) )
var ( const (
txtLabelRegex = regexp.MustCompile("^\"heritage=external-dns,external-dns/owner=(.+)\"")
txtLabelFormat = "\"heritage=external-dns,external-dns/owner=%s\"" txtLabelFormat = "\"heritage=external-dns,external-dns/owner=%s\""
) )
var (
txtLabelRegex = regexp.MustCompile("^\"heritage=external-dns,external-dns/owner=(.+)\"")
)
// TXTRegistry implements registry interface with ownership implemented via associated TXT records // TXTRegistry implements registry interface with ownership implemented via associated TXT records
type TXTRegistry struct { type TXTRegistry struct {
provider provider.Provider provider provider.Provider

View File

@ -66,13 +66,13 @@ func (sc *fakeSource) Endpoints() ([]*endpoint.Endpoint, error) {
} }
func (sc *fakeSource) generateEndpoint() (*endpoint.Endpoint, error) { func (sc *fakeSource) generateEndpoint() (*endpoint.Endpoint, error) {
endpoint := endpoint.NewEndpoint( ep := endpoint.NewEndpoint(
generateDNSName(4, sc.dnsName), generateDNSName(4, sc.dnsName),
generateIPAddress(), generateIPAddress(),
endpoint.RecordTypeA, endpoint.RecordTypeA,
) )
return endpoint, nil return ep, nil
} }
func generateIPAddress() string { func generateIPAddress() string {