@@ -15,31 +15,32 @@ def __init__(self, **kwargs):
1515
1616
1717class GoModulesBuilder (object ):
18- def __init__ (self , osutils ):
18+ def __init__ (self , osutils , runtime_path ):
1919 """Initialize a GoModulesBuilder.
2020
2121 :type osutils: :class:`lambda_builders.utils.OSUtils`
2222 :param osutils: A class used for all interactions with the
2323 outside OS.
24+
25+ :type runtime_path: str
26+ :param runtime_path: The path to the go runtime.
2427 """
2528 self .osutils = osutils
29+ self .runtime_path = runtime_path
2630
27- def build (self , source_dir_path , artifacts_dir_path , executable_name ):
28- """Builds a go project into an artifact directory .
31+ def build (self , source_dir_path , output_path ):
32+ """Builds a go project onto an output path .
2933
3034 :type source_dir_path: str
3135 :param source_dir_path: Directory with the source files.
3236
33- :type artifacts_dir_path: str
34- :param artifacts_dir_path: Directory to write dependencies into.
35-
36- :type executable_name: str
37- :param executable_name: Name of the executable to create from the build.
37+ :type output_path: str
38+ :param output_path: Filename to write the executable output to.
3839 """
3940 env = {}
4041 env .update (self .osutils .environ )
4142 env .update ({"GOOS" : "linux" , "GOARCH" : "amd64" })
42- cmd = ["go" , "build" , "-o" , self . osutils . joinpath ( artifacts_dir_path , executable_name ) , source_dir_path ]
43+ cmd = [self . runtime_path , "build" , "-o" , output_path , source_dir_path ]
4344
4445 p = self .osutils .popen (
4546 cmd ,
0 commit comments