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
| # Rename to Dockerfile in local directory | |
| # Run docker build -t <assign#> . (e.g., docker build -t assign1 .) | |
| # Run docker run --rm -it <assign#> (e.g., docker run --rm -it assign1) | |
| FROM ubuntu:14.04 | |
| RUN apt-get update && apt-get upgrade -y | |
| RUN apt-get install gcc valgrind make -y | |
| RUN mkdir /code | |
| WORKDIR /code |
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
| // Dynamically populate the toPopulate struct fields using viper and reflection | |
| func PopulateConfigs(toPopulate interface{}) (returnError error) { | |
| var fieldNameError string | |
| defer func() { | |
| if r := recover(); r != nil { | |
| switch r.(type) { | |
| case string: | |
| returnError = errors.New(fmt.Sprintf( | |
| "Cast conversion error for %s. Please check your configuration", fieldNameError)) |