I'm asking myself above question since I implemented an API that accesses a third-party API and currently write tests to increase my code coverage in the class that communicates with the third-party API. Currently I'm sitting at 76.6%. I covered possible third-party API-responses and JSON parsing errors.
What's left are parts of the code that are not influenced by user input. For example:
url := "some url here"
method := "GET"
payload := strings.NewReader(`{ }`)
client := &http.Client{}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return "", err
}
Basically no matter what happens this code should not fail at any point any quite frankly I do not know how I can make this part of the code fail on purpose in a test. Should i just let this partt of the code go uncovered or what would be my best option?