Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Go
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
to be continuous...
Go
Commits
b08bf371
Commit
b08bf371
authored
2 years ago
by
Kai
Committed by
Kai Ehrhardt
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: resolve build mode based on package main appearance
further information:
https://go.dev/doc/code
parent
3f7c6c3c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/gitlab-ci-golang.yml
+6
-6
6 additions, 6 deletions
templates/gitlab-ci-golang.yml
with
6 additions
and
6 deletions
templates/gitlab-ci-golang.yml
+
6
−
6
View file @
b08bf371
...
...
@@ -55,7 +55,7 @@ variables:
-mod=readonly
# Default flags for go build linker
GO_BUILD_LINKER_FLAGS
:
"
-s
-w"
GO_BUILD_LINKER_FLAGS
:
"
-s
-w"
# Default packages for 'build' command
GO_BUILD_PACKAGES
:
>-
...
...
@@ -151,12 +151,12 @@ stages:
}
function go_build_auto() {
log_info "auto build mode, looking up for a \\e[33;1mmain.go\\e[0m file..."
found_main_go=$(find ./ -name 'main.go' | wc -l)
if [ "${found_main_go}" -eq 0 ]; then
go_build_modules
else
log_info "auto build mode, looking up for a \\e[33;1mmain\\e[0m package..."
if grep -Rw --include "*.go" "^package main"
then
go_build_application
else
go_build_modules
fi
}
...
...
This diff is collapsed.
Click to expand it.
Ghost User
@ghost
mentioned in commit
5d4b6dbe
·
2 years ago
mentioned in commit
5d4b6dbe
mentioned in commit 5d4b6dbe49241f0f6ecb04829b481ec7b724163a
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment