chore: apply some linter recommendations.
This commit is contained in:
parent
3b6b50cf63
commit
984cf28e61
37 changed files with 125 additions and 126 deletions
|
|
@ -38,9 +38,9 @@ func (b ReAttach) Apply(opt *Option, profile string) (string, error) {
|
|||
|
||||
if strings.Contains(profile, "attach_disconnected") {
|
||||
insert = "@{att} = /att/" + opt.Name + "/\n"
|
||||
profile = strings.Replace(profile,
|
||||
profile = strings.ReplaceAll(profile,
|
||||
"attach_disconnected",
|
||||
"attach_disconnected,attach_disconnected.path=@{att}", -1,
|
||||
"attach_disconnected,attach_disconnected.path=@{att}",
|
||||
)
|
||||
|
||||
old := "include if exists <local/" + opt.Name + ">"
|
||||
|
|
|
|||
|
|
@ -20,13 +20,13 @@ var (
|
|||
Builders = map[string]Builder{}
|
||||
)
|
||||
|
||||
// Main directive interface
|
||||
// Builder main directive interface
|
||||
type Builder interface {
|
||||
prebuild.BaseInterface
|
||||
Apply(opt *Option, profile string) (string, error)
|
||||
}
|
||||
|
||||
// Builder options
|
||||
// Option for a builder
|
||||
type Option struct {
|
||||
Name string
|
||||
File *paths.Path
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ func (b Userspace) Apply(opt *Option, profile string) (string, error) {
|
|||
matches := regAttachments.FindAllString(profile, -1)
|
||||
if len(matches) > 0 {
|
||||
att := f.GetDefaultProfile().GetAttachments()
|
||||
strheader := strings.Replace(matches[0], tokATTACHMENT, att, -1)
|
||||
strheader := strings.ReplaceAll(matches[0], tokATTACHMENT, att)
|
||||
return regAttachments.ReplaceAllLiteralString(profile, strheader), nil
|
||||
}
|
||||
return profile, nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue