KhaninArtur commented on a change in pull request #16484:
URL: https://github.com/apache/beam/pull/16484#discussion_r786853496
##########
File path: playground/backend/internal/environment/environment_service.go
##########
@@ -240,6 +246,16 @@ func getConfigFromJson(configPath string)
(*ExecutorConfig, error) {
return &executorConfig, err
}
+// getDefaultExamplesPathFromJson reads a json file and returns default
example path
+func getDefaultExamplesPathFromJson(configPath string) (string, error) {
+ file, err := ioutil.ReadFile(configPath)
+ if err != nil {
+ return "", err
+ }
+ defaultExamplePath := gjson.Get(string(file),
defaultExampleKey).String()
+ return defaultExamplePath, nil
+}
Review comment:
I believe, we already read such files with `Unmarshal`, can we do here
the same to avoid adding a new dependency `gjson`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]