-
Notifications
You must be signed in to change notification settings - Fork 12
switch to internal project structure #290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ | |
| dist | ||
|
|
||
| # lets binary | ||
| lets | ||
| /lets | ||
| lets-dev | ||
| .lets | ||
| lets.my.yaml | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -10,7 +10,7 @@ release: | |||||
|
|
||||||
| builds: | ||||||
| - id: darwin-amd64 | ||||||
| main: . | ||||||
| main: ./cmd/lets | ||||||
| goos: | ||||||
| - darwin | ||||||
| goarch: | ||||||
|
|
@@ -25,7 +25,7 @@ builds: | |||||
| ldflags: | ||||||
| - -s -w -X main.version={{.Version}} | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stale The variable was renamed from The same issue also appears on line 54 for the
Suggested change
|
||||||
| - id: darwin-arm64 | ||||||
| main: . | ||||||
| main: ./cmd/lets | ||||||
| goos: | ||||||
| - darwin | ||||||
| goarch: | ||||||
|
|
@@ -38,9 +38,9 @@ builds: | |||||
| flags: | ||||||
| - -mod=readonly | ||||||
| ldflags: | ||||||
| - -s -w -X main.version={{.Version}} | ||||||
| - -s -w -X main.Version={{.Version}} | ||||||
| - id: linux-amd64 | ||||||
| main: . | ||||||
| main: ./cmd/lets | ||||||
| goos: | ||||||
| - linux | ||||||
| goarch: | ||||||
|
|
||||||
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,23 @@ | ||
| { | ||
| // Use IntelliSense to learn about possible attributes. | ||
| // Hover to view descriptions of existing attributes. | ||
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "name": "Launch Package", | ||
| "type": "go", | ||
| "request": "launch", | ||
| "mode": "auto", | ||
| "program": "${fileDirname}" | ||
| }, | ||
| { | ||
| "name": "Run", | ||
| "type": "go", | ||
| "request": "launch", | ||
| "mode": "auto", | ||
| "program": "${workspaceRoot}", | ||
| "args": [] | ||
| } | ||
| ] | ||
| } | ||
| // Use IntelliSense to learn about possible attributes. | ||
| // Hover to view descriptions of existing attributes. | ||
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "name": "Launch Package", | ||
| "type": "go", | ||
| "request": "launch", | ||
| "mode": "auto", | ||
| "program": "${fileDirname}" | ||
| }, | ||
| { | ||
| "name": "Run", | ||
| "type": "go", | ||
| "request": "launch", | ||
| "mode": "auto", | ||
| "program": "${workspaceRoot}/cmd/lets/main.go", | ||
| "args": [] | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -31,7 +31,7 @@ services: | |||||||||
| - bash | ||||||||||
| - -c | ||||||||||
| - | | ||||||||||
| go build -o /usr/bin/lets *.go | ||||||||||
| go build -o /usr/bin/lets cmd/lets/main.go | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (bug_risk): Building a single source file may skip other files in the Building
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer package path over file path for Passing a file path ( The same pattern also appears in
Suggested change
|
||||||||||
| if [[ -n "${LETSOPT_TEST}" ]]; then | ||||||||||
| bats tests/"${LETSOPT_TEST}" ${LETSOPT_OPTS} | ||||||||||
| else | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -109,9 +109,9 @@ commands: | |
| PATH2LETSDEV=$LETSOPT_PATH | ||
| fi | ||
|
|
||
| go build -ldflags="-X main.version=${VERSION:1}-dev" -o "${BIN}" *.go && \ | ||
| go build -ldflags="-X main.Version=${VERSION:1}-dev" -o "${BIN}" cmd/lets/main.go && \ | ||
| sudo mv ./${BIN} $PATH2LETSDEV/${BIN} && \ | ||
| echo " - binary ${BIN} version ${VERSION} successfully installed in ${PATH2LETSDEV}" | ||
| echo " - binary ${BIN} version $($PATH2LETSDEV/${BIN} --version) successfully installed in ${PATH2LETSDEV}" | ||
|
|
||
| build: | ||
| description: Build lets from source code | ||
|
|
@@ -120,9 +120,18 @@ commands: | |
| cmd: | | ||
| VERSION=$(git describe) | ||
| BIN=${LETSOPT_BIN:-lets} | ||
|
|
||
| go build -ldflags="-X main.version=${VERSION:1}-dev" -o ${BIN} *.go && \ | ||
| echo " - binary './${BIN}' (version ${VERSION}) successfully build" | ||
|
|
||
| go build \ | ||
| -ldflags="-X main.Version=${VERSION:1}-dev" \ | ||
| -o ${BIN} cmd/lets/main.go | ||
|
|
||
| success=$? | ||
| if [[ $success -eq 0 ]]; then | ||
| version=$(./${BIN} --version) | ||
| echo " - binary './${BIN}' ($version) successfully build" | ||
| else | ||
| echo "Failed to build" | ||
|
Comment on lines
+124
to
+133
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (bug_risk): The build command failure is swallowed, causing the script to succeed even when the binary was not built. Because you only echo on failure and don’t exit non‑zero, callers (CI, wrapper scripts) will see this as a successful run even when |
||
| fi | ||
|
Comment on lines
+128
to
+134
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Build failure is silently swallowed — command always exits 0
To propagate the failure, exit explicitly with the captured code: |
||
|
|
||
| publish-docs: | ||
| work_dir: docs | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): The ldflags symbol still targets
main.versionwhile the variable has been renamed tomain.Version, which will break this build.In this config,
mainnow builds from./cmd/letsand the variable incmd/lets/main.goisVersion, so-X main.versionrefers to a non‑existent symbol and will cause the linker step to fail. Update this entry to match the others, e.g.-X main.Version={{.Version}}.