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

@@ -10,35 +10,35 @@ the root directory of this source tree.
// Package format provides different, out of the box supported, output format types.
//
// Usage
// # Usage
//
// A specific format can be instantiated either with `format.New()` function or
// directly calling its function (e.g. `NewMarkdownTable`, etc)
//
// config := print.DefaultConfig()
// config.Formatter = "markdown table"
// config := print.DefaultConfig()
// config.Formatter = "markdown table"
//
// formatter, err := format.New(config)
// if err != nil {
// return err
// }
// formatter, err := format.New(config)
// if err != nil {
// return err
// }
//
// err := formatter.Generate(tfmodule)
// if err != nil {
// return err
// }
// err := formatter.Generate(tfmodule)
// if err != nil {
// return err
// }
//
// output, err := formatter.Render"")
// if err != nil {
// return err
// }
// output, err := formatter.Render"")
// if err != nil {
// return err
// }
//
// Note: if you don't intend to provide additional template for the generated
// content, or the target format doesn't provide templating (e.g. json, yaml,
// xml, or toml) you can use `Content()` function instead of `Render)`. Note
// that `Content()` returns all the sections combined with predefined order.
//
// output := formatter.Content()
// output := formatter.Content()
//
// Supported formats are:
//
@@ -53,5 +53,4 @@ the root directory of this source tree.
// • `NewTOML`
// • `NewXML`
// • `NewYAML`
//
package format

View File

@@ -135,6 +135,8 @@ type generator struct {
// newGenerator returns a generator for specific formatter name and with
// provided sets of GeneratorFunc functions to build and add individual
// sections.
//
//nolint:unparam
func newGenerator(config *print.Config, canRender bool, fns ...generateFunc) *generator {
g := &generator{
config: config,