// EncodeHCL implements the hcl.Encoder interface.
// nolint: gosec
EncodeHCL implements the hcl.Encoder interface.
nolint: gosec
// EncodeHCL implements the hcl . Encoder interface . // nolint : gosec
func (m Map) EncodeHCL() (string, error) {
	if len(m) == 0 {
		return "{}", nil
	}
	var b strings.Builder
	_, _ = b.WriteString("{ ")
	for k, v := range m {
		valueString, err := Encode(v)
		if err != nil {
			return "", errors.Wrapf(err, "encode %q", k)
		}
		_, _ = b.WriteString(escapeKey(k))
		_, _ = b.WriteString(" = ")
		_, _ = b.WriteString(valueString)
		_, _ = b.WriteString(", ")
	}
	return strings.TrimSuffix(b.String(), ", ") + " }", nil
}
func ( m Map ) EncodeHCL ( ) ( string , error ) { if len ( m ) == 0 { return " " , nil } var b strings . Builder _ , _ = b . WriteString ( " " ) for k , v := range m { valueString , err := Encode ( v ) if err != nil { return " " , errors . Wrapf ( err , " " , k ) } _ , _ = b . WriteString ( escapeKey ( k ) ) _ , _ = b . WriteString ( " " ) _ , _ = b . WriteString ( valueString ) _ , _ = b . WriteString ( " " ) } return strings . TrimSuffix ( b . String ( ) , " " ) + " " , nil }
EncodeHCL implements the hcl.Encoder interface.
EncodeHCL implements the hcl . Encoder interface .
// Can't fail beside out of memory error. // Quotes mandatory with special chars, so always set them.