Comments (3)
So.. I'm still new to Go.. but doesn't the import of the other source files take care of this? how does specifying multiple files in the build help debug? Do you get better error reporting?
from fume-cli.
This is not related to error reporting nor debugging. This is simply desiring a similar behavior to go build foo.go main.go
akin to in C doing cc -o myexec foo.c main.c
. I do not want to import another module (because of the steps involved in syncing go.mod and the various branches inducing an extra step), but rather just have the code all in one package, just multiple files.
That being said, I could just do import "mymodule"
and include a replace mymodule => ./mymodulelocal
line in go.mod of the user of mymodule
. Just figured it would be nice to ape how things actually can work with go build
and allow multiple files.
I'll go ahead and close as my main gripe has been synching go.mod and doing the replace
workaround is fine for me.
from fume-cli.
This is closed, but an untested possible solution to what I'd like would be:
diff --git a/src/lib/deploytasks.ts b/src/lib/deploytasks.ts
index 74aec6d..5e5437b 100644
--- a/src/lib/deploytasks.ts
+++ b/src/lib/deploytasks.ts
@@ -267,10 +267,23 @@ exports.handler = async (event, context) => {
await execa(this.packager, args)
}
+ async goFindSourceFiles(task: ListrTaskWrapper<any, any>) {
+ var sources = [];
+ fs.readdirSync('.').forEach(file => {
+ if (file.endsWith('.go')) {
+ sources.push(file);
+ }
+ });
+ return sources
+ }
+
async goCompile(task: ListrTaskWrapper<any, any>) {
task.title = 'Compiling go binary'
await this.deployment.update('GO_COMPILE')
- await execa('go', ['build', '-o', 'main', 'main.go'], { env: { GOOS: 'linux', GOARCH: 'amd64' } })
+ var sources = await goFindSourceFiles(task)
+ var build = ['build', '-o', 'main']
+ var fullBuild = build.concat(sources)
+ await execa('go', fullBuild, { env: { GOOS: 'linux', GOARCH: 'amd64' } })
}
async goArchive(task: ListrTaskWrapper<any, any>) {
from fume-cli.
Related Issues (20)
- auth:login retrieves the token via the API instead of copy+paste HOT 2
- fume login goes to fume auth:login
- fume deploy - get list of environments as options to select
- fume config|deploy - on auth failure prompt to run fume auth:login
- ctrl+c and other abort catching
- docker support HOT 2
- Deployment 'sync dependencies' step never ends HOT 6
- Deleting a project fails HOT 1
- Adding an variable to an environment doesn't update the variables table
- [Suggestion] Lambda warming support
- local installs of fume-cli in a project result in infinite node_modules size
- require node v14+
- Feature Request - Detect Outdated CLI Version
- nuxt3 - make static folder not required
- Bitbucket Deployment Error HOT 1
- v3 detection issue
- optional timeout parameter
- show when you have made changes to env-vars but not synced to AWS
- feat: add support for golang lambdas running under the provided.al2 runtime
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fume-cli.