go.fuchsia.dev/infra@v0.0.0-20240507153436-9b593402251b/cmd/roller-configurator/config.go (about) 1 // Copyright 2023 The Fuchsia Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 package main 6 7 import ( 8 "os" 9 10 "go.fuchsia.dev/infra/cmd/roller-configurator/proto" 11 "google.golang.org/protobuf/encoding/prototext" 12 ) 13 14 func readConfig(path string) (*proto.Config, error) { 15 b, err := os.ReadFile(path) 16 if err != nil { 17 return nil, err 18 } 19 var res proto.Config 20 if err := prototext.Unmarshal(b, &res); err != nil { 21 return nil, err 22 } 23 return &res, nil 24 }