You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A pattern I currently follow for all my Go tests is to store JSON response bodies in e.g testdata/all_users.json or testdata/europe_users.json and so on.
The testdata directory is considered the idiomatic way to do this in Go.
It would be super convenient if I could do something like the following, with an error/failure if the file does not exist:
A pattern I currently follow for all my Go tests is to store JSON response bodies in e.g
testdata/all_users.json
ortestdata/europe_users.json
and so on.The
testdata
directory is considered the idiomatic way to do this in Go.It would be super convenient if I could do something like the following, with an error/failure if the file does not exist:
Currently I'm using a separate helper function to read the files and pass the string in using
BodyString(...)
The text was updated successfully, but these errors were encountered: