Created
September 5, 2019 03:43
-
-
Save ytkang/1589b575cb0335fd9eb6743c49acedef to your computer and use it in GitHub Desktop.
[ECS TaskDefinition] convert json to golang sdk object
This file contains 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
func makeTaskDefnInput(jsonPath string) *ecs.RegisterTaskDefinitionInput { | |
var defn ecs.RegisterTaskDefinitionInput | |
fileBytes, err := ioutil.ReadFile(jsonPath) | |
if err != nil { | |
log.Println("cannot read task file", err.Error()) | |
return nil | |
} | |
err = json.Unmarshal(fileBytes, &defn) | |
if err != nil { | |
log.Println("cannot parse task file", err.Error()) | |
return nil | |
} | |
return &defn | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment