Skip to content

Commit c79a7e4

Browse files
committed
Remove duplicated code.
Signed-off-by: David Calavera <[email protected]>
1 parent 00b9a0b commit c79a7e4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

go/porcelain/deploy.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import (
2929

3030
const (
3131
preProcessingTimeout = time.Minute * 5
32+
jsRuntime = "js"
33+
goRuntime = "go"
3234
)
3335

3436
type uploadType int
@@ -509,13 +511,13 @@ func bundle(functionDir string, observer DeployObserver) (*deployFiles, error) {
509511

510512
switch {
511513
case jsFile(i):
512-
file, err := newFunctionFile(filePath, i, "js")
514+
file, err := newFunctionFile(filePath, i, jsRuntime, observer)
513515
if err != nil {
514516
return nil, err
515517
}
516518
functions.Add(file.Name, file)
517519
case goFile(filePath, i):
518-
file, err := newFunctionFile(filePath, i, "go")
520+
file, err := newFunctionFile(filePath, i, goRuntime, observer)
519521
if err != nil {
520522
return nil, err
521523
}

0 commit comments

Comments
 (0)