Closed optik-aper closed 2 years ago
This is the root cause of vultr/vultr-cli#281
When testing this, if user data is added, then the API returns it as a string. The API is not consistent in how it's returning data.
json: cannot unmarshal string into Go struct field UserData.user_data.data of type []string
panic: json: cannot unmarshal string into Go struct field UserData.user_data.data of type []string
This will need to be fixed in the API so that it's returning a consistent data structure, regardless of data state.
Issue resolved by an API update
Describe the bug When using
GetUserData
on an instance that doesn't have the user data populated an error is thrown:To Reproduce
instance.GetUserData
function on that instanceAdditional context The response body from the API is in the form of
But govultr is expecting a string, not an array.