// Encode implements the hcl.Encoder interface.
Encode implements the hcl.Encoder interface.
// Encode implements the hcl . Encoder interface .
func Encode(v interface{}) (string, error) {
	switch v := v.(type) {
	case Encoder:
		return v.EncodeHCL()
	case map[string]interface{}:
		return Map(v).EncodeHCL()
	case map[interface{}]interface{}:
		return IMap(v).EncodeHCL()
	case []interface{}:
		return List(v).EncodeHCL()
	default:
		s, err := toString(v, true)
		if err != nil {
			return "", err
		}
		return s, nil
	}
}
func Encode ( v interface { } ) ( string , error ) { switch v := v . ( type ) { case Encoder : return v . EncodeHCL ( ) case map [ string ] interface { } : return Map ( v ) . EncodeHCL ( ) case map [ interface { } ] interface { } : return IMap ( v ) . EncodeHCL ( ) case [ ] interface { } : return List ( v ) . EncodeHCL ( ) default : s , err := toString ( v , true ) if err != nil { return " " , err } return s , nil } }
Encode implements the hcl.Encoder interface.
Encode implements the hcl . Encoder interface .