preset.go 376 B

12345678910111213141516171819202122
  1. package main
  2. import (
  3. "context"
  4. "fmt"
  5. "github.com/gshopify/service-wrapper/auth"
  6. "github.com/gshopify/service-wrapper/config"
  7. "os"
  8. )
  9. func preset() error {
  10. if *fConfig == "" {
  11. return fmt.Errorf("config file path must be provided")
  12. }
  13. f, err := os.Open(*fConfig)
  14. if err != nil {
  15. return err
  16. }
  17. return config.Instance().Set(context.Background(), auth.New(), f)
  18. }