Last active
August 22, 2019 04:00
-
-
Save softwarebygabe/2d8abf75a4d34a977940f2a01a6641bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package foo | |
import ( | |
"errors" | |
"interfaces/external" | |
) | |
func Controller() error { | |
externalClient := external.NewClient() | |
fromExternalAPI, err := externalClient.GetData() | |
if err != nil { | |
return err | |
} | |
// do some things based on data from external API | |
if fromExternalAPI != "data" { | |
return errors.New("unexpected data") | |
} | |
return nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment