chore: update linter.
This commit is contained in:
parent
d698eba1e7
commit
a20e90aa17
91 changed files with 646 additions and 459 deletions
|
@ -49,7 +49,6 @@ func (p *Provider) Init() error {
|
|||
// using the given configuration channel.
|
||||
func (p *Provider) Provide(configurationChan chan<- dynamic.Message, pool *safe.Pool) error {
|
||||
configuration, err := p.BuildConfiguration()
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -357,7 +356,7 @@ func (p *Provider) CreateConfiguration(ctx context.Context, filename string, fun
|
|||
return nil, fmt.Errorf("error reading configuration file: %s - %w", filename, err)
|
||||
}
|
||||
|
||||
var defaultFuncMap = sprig.TxtFuncMap()
|
||||
defaultFuncMap := sprig.TxtFuncMap()
|
||||
defaultFuncMap["normalize"] = provider.Normalize
|
||||
defaultFuncMap["split"] = strings.Split
|
||||
for funcID, funcElement := range funcMap {
|
||||
|
@ -377,7 +376,7 @@ func (p *Provider) CreateConfiguration(ctx context.Context, filename string, fun
|
|||
return nil, err
|
||||
}
|
||||
|
||||
var renderedTemplate = buffer.String()
|
||||
renderedTemplate := buffer.String()
|
||||
if p.DebugLogGeneratedTemplate {
|
||||
logger := log.FromContext(ctx)
|
||||
logger.Debugf("Template content: %s", tmplContent)
|
||||
|
@ -397,7 +396,7 @@ func (p *Provider) DecodeConfiguration(filename string) (*dynamic.Configuration,
|
|||
return p.decodeConfiguration(filename, content)
|
||||
}
|
||||
|
||||
func (p *Provider) decodeConfiguration(filePath string, content string) (*dynamic.Configuration, error) {
|
||||
func (p *Provider) decodeConfiguration(filePath, content string) (*dynamic.Configuration, error) {
|
||||
configuration := &dynamic.Configuration{
|
||||
HTTP: &dynamic.HTTPConfiguration{
|
||||
Routers: make(map[string]*dynamic.Router),
|
||||
|
|
|
@ -292,7 +292,7 @@ func createTempDir(t *testing.T, dir string) string {
|
|||
}
|
||||
|
||||
func copyFile(srcPath, dstPath string) error {
|
||||
dst, err := os.OpenFile(dstPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)
|
||||
dst, err := os.OpenFile(dstPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o666)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue