in python/rpdk/go/codegen.py [0:0]
def package(self, project, zip_file):
LOG.info("Packaging Go project")
def write_with_relative_path(path):
relative = path.relative_to(project.root)
zip_file.write(path.resolve(), str(relative))
# sanity check for build output
self._find_exe(project)
executable_zip = self.pre_package(project)
zip_file.writestr("handler.zip", executable_zip.read())
write_with_relative_path(project.root / "Makefile")
for path in (project.root / "cmd").rglob("*"):
if path.is_file():
write_with_relative_path(path)
for path in (project.root / "internal").rglob("*"):
if path.is_file():
write_with_relative_path(path)