Changing argument name from urlStr to location. Originally this postfix was added to avoid name collision with the url package. InsercureSkipVerify was accidentally made private.
This commit is contained in:
parent
a00eb4ff39
commit
ee9fd9802e
3 changed files with 7 additions and 84 deletions
|
@ -1,78 +0,0 @@
|
|||
# This file contains all available configuration options
|
||||
# with their default values.
|
||||
|
||||
# options for analysis running
|
||||
run:
|
||||
# default concurrency is a available CPU number
|
||||
concurrency: 4
|
||||
|
||||
# timeout for analysis, e.g. 30s, 5m, default is 1m
|
||||
deadline: 1m
|
||||
|
||||
# exit code when at least one issue was found, default is 1
|
||||
issues-exit-code: 1
|
||||
|
||||
# include test files or not, default is true
|
||||
tests: true
|
||||
|
||||
# which dirs to skip: they won't be analyzed;
|
||||
# can use regexp here: generated.*, regexp is applied on full path;
|
||||
# default value is empty list, but next dirs are always skipped independently
|
||||
# from this option's value:
|
||||
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
|
||||
skip-dirs:
|
||||
- gen-go/apache/aurora/
|
||||
|
||||
# output configuration options
|
||||
output:
|
||||
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
|
||||
format: colored-line-number
|
||||
|
||||
# print lines of code with issue, default is true
|
||||
print-issued-lines: true
|
||||
|
||||
# print linter name in the end of issue text, default is true
|
||||
print-linter-name: true
|
||||
|
||||
|
||||
# all available settings of specific linters
|
||||
linters-settings:
|
||||
errcheck:
|
||||
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
|
||||
# default is false: such cases aren't reported by default.
|
||||
check-type-assertions: true
|
||||
|
||||
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
|
||||
# default is false: such cases aren't reported by default.
|
||||
check-blank: true
|
||||
govet:
|
||||
# report about shadowed variables
|
||||
check-shadowing: true
|
||||
goconst:
|
||||
# minimal length of string constant, 3 by default
|
||||
min-len: 3
|
||||
# minimal occurrences count to trigger, 3 by default
|
||||
min-occurrences: 2
|
||||
misspell:
|
||||
# Correct spellings using locale preferences for US or UK.
|
||||
# Default is to use a neutral variety of English.
|
||||
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
|
||||
locale: US
|
||||
lll:
|
||||
# max line length, lines longer will be reported. Default is 120.
|
||||
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
|
||||
line-length: 120
|
||||
# tab width in spaces. Default to 1.
|
||||
tab-width: 4
|
||||
|
||||
linters:
|
||||
enable:
|
||||
- megacheck
|
||||
- govet
|
||||
- goimports
|
||||
- lll
|
||||
- misspell
|
||||
- goconst
|
||||
- dupl
|
||||
enable-all: false
|
||||
fast: false
|
|
@ -32,9 +32,10 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/apache/thrift/lib/go/thrift"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/paypal/gorealis/gen-go/apache/aurora"
|
||||
"github.com/paypal/gorealis/response"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
const VERSION = "1.21.1"
|
||||
|
@ -199,7 +200,7 @@ func BackOff(b Backoff) ClientOption {
|
|||
}
|
||||
}
|
||||
|
||||
func insecureSkipVerify(insecureSkipVerify bool) ClientOption {
|
||||
func InsecureSkipVerify(insecureSkipVerify bool) ClientOption {
|
||||
return func(config *RealisConfig) {
|
||||
config.insecureSkipVerify = insecureSkipVerify
|
||||
}
|
||||
|
|
8
util.go
8
util.go
|
@ -42,14 +42,14 @@ func init() {
|
|||
}
|
||||
}
|
||||
|
||||
func validateAuroraURL(urlStr string) (string, error) {
|
||||
func validateAuroraURL(location string) (string, error) {
|
||||
|
||||
// If no protocol defined, assume http
|
||||
if !strings.Contains(urlStr, "://") {
|
||||
urlStr = "http://" + urlStr
|
||||
if !strings.Contains(location, "://") {
|
||||
location = "http://" + location
|
||||
}
|
||||
|
||||
u, err := url.Parse(urlStr)
|
||||
u, err := url.Parse(location)
|
||||
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "error parsing url")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue