Skip to content

Commit aa4c29c

Browse files
committed
chore: add whilelines to separate concerns
1 parent 88cb16d commit aa4c29c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/firebase/firebase.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,25 @@ func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustom
8888
if rootPathIdx == -1 {
8989
return nil, ErrRootNotProvided
9090
}
91+
9192
// Parse expected emulators from the root:
9293
userRoot := req.ContainerRequest.Files[rootPathIdx].HostFilePath
9394
cfg, err := os.Open(path.Join(userRoot, "firebase.json"))
9495
if err != nil {
9596
return nil, fmt.Errorf("open firebase.json: %w", err)
9697
}
9798
defer cfg.Close()
99+
98100
bytes, err := io.ReadAll(cfg)
99101
if err != nil {
100102
return nil, fmt.Errorf("read firebase.json: %w", err)
101103
}
104+
102105
var parsed partialFirebaseConfig
103106
if err := json.Unmarshal(bytes, &parsed); err != nil {
104107
return nil, fmt.Errorf("parse firebase.json: %w", err)
105108
}
109+
106110
expectedExposedPorts, err := gatherPorts(parsed)
107111
if err != nil {
108112
return nil, fmt.Errorf("gather ports: %w", err)

0 commit comments

Comments
 (0)