package
Version:
v1.10.0
Opens a new window with list of versions in this module.
Published: Jan 21, 2026
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
No go.mod Example
This example demonstrates the synthetic go.mod generation feature that allows you to build GitLab CI pipelines without requiring a go.mod file.
Features
- No go.mod required: The tool automatically creates a temporary module when no go.mod is found
- Quick prototyping: Perfect for testing pipeline configurations without setting up a full Go module
- Automatic dependency resolution: All dependencies are resolved automatically during build
Usage
From this directory:
wetwire-gitlab build .
This will:
- Detect that no go.mod exists in the directory or parent directories
- Create a temporary synthetic module using the directory name as the module path
- Copy your Go files to a temporary location and rewrite package declarations
- Resolve all dependencies automatically
- Generate the
.gitlab-ci.yml file
How It Works
The synthetic mode:
- Walks up the directory tree looking for an existing go.mod
- If no go.mod is found, creates a temporary module with:
- Module name based on the directory name
- Latest version of wetwire-gitlab-go
- Auto-detection of local wetwire-gitlab-go installation for development
- Copies your pipeline.go files to a temporary package
- Rewrites package declarations to make them importable (e.g.,
package ci -> package userpkg)
- Runs go mod tidy and go mod download to resolve all dependencies
- Executes the pipeline and generates YAML output
- Cleans up all temporary files
Limitations
- Files must use a package declaration (any valid Go package name works)
- Only .go files in the immediate directory are included (subdirectories are not copied)
- Test files (*_test.go) are excluded
When to Use This
This feature is ideal for:
- Quick experimentation with GitLab CI configurations
- CI/CD workshops and demonstrations
- Simple single-file pipeline definitions
- Learning wetwire-gitlab-go syntax
For production use cases, we recommend using a proper go.mod file for better dependency management and reproducibility.
Documentation
¶
Example pipeline without requiring go.mod
Run: wetwire-gitlab build .
Source Files
¶
Click to show internal directories.
Click to hide internal directories.