Bump golangci-lint to 1.55.2 and fix issues

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
This commit is contained in:
Khosrow Moossavi
2023-12-19 12:51:04 -05:00
parent 4552242276
commit 5cfb2f2615
11 changed files with 108 additions and 111 deletions

View File

@@ -12,43 +12,42 @@ the root directory of this source tree.
//
// Usage
//
// import (
// "fmt"
// gotemplate "text/template"
// import (
// "fmt"
// gotemplate "text/template"
//
// "github.com/terraform-docs/terraform-docs/print"
// "github.com/terraform-docs/terraform-docs/template"
// "github.com/terraform-docs/terraform-docs/terraform"
// )
// "github.com/terraform-docs/terraform-docs/print"
// "github.com/terraform-docs/terraform-docs/template"
// "github.com/terraform-docs/terraform-docs/terraform"
// )
//
// const mainTpl =`
// {{- if .Config.Sections.Header -}}
// {{- with .Module.Header -}}
// {{ colorize "\033[90m" . }}
// {{ end -}}
// {{- printf "\n\n" -}}
// {{ end -}}`
// const mainTpl =`
// {{- if .Config.Sections.Header -}}
// {{- with .Module.Header -}}
// {{ colorize "\033[90m" . }}
// {{ end -}}
// {{- printf "\n\n" -}}
// {{ end -}}`
//
// func render(config *print.Config, module *terraform.Module) (string, error) {
// tt := template.New(config, &template.Item{
// Name: "main",
// Text: mainTpl,
// TrimSpace: true,
// })
// func render(config *print.Config, module *terraform.Module) (string, error) {
// tt := template.New(config, &template.Item{
// Name: "main",
// Text: mainTpl,
// TrimSpace: true,
// })
//
// tt := template.New(config, items...)
// tt.CustomFunc(gotemplate.FuncMap{
// "colorize": func(color string, s string) string {
// reset := "\033[0m"
// if !config.Settings.Color {
// color = ""
// reset = ""
// }
// return fmt.Sprintf("%s%s%s", color, s, reset)
// },
// })
//
// return tt.Render("main", module)
// }
// tt := template.New(config, items...)
// tt.CustomFunc(gotemplate.FuncMap{
// "colorize": func(color string, s string) string {
// reset := "\033[0m"
// if !config.Settings.Color {
// color = ""
// reset = ""
// }
// return fmt.Sprintf("%s%s%s", color, s, reset)
// },
// })
//
// return tt.Render("main", module)
// }
package template