bingo

package module
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2025 License: MIT Imports: 11 Imported by: 2

README

Go Binary Builder

This Go program is a binary builder for the k0s project. It supports cross-compilation for multiple operating system and architecture combinations.

Getting Started

These instructions will get you a copy of the project up and running on your local machine.

Prerequisites
  • Go (version 1.16 or later)
  • UPX (optional, for binary compression)
  • strip utility (optional, for removing symbol table and relocation information)
Installing

Clone the repository to your local machine:

go install github.com/btwiuse/bingo/cmd/bingo@latest

Since go1.24, you can use the following command to add bingo as a tool to your module:

go get -tool github.com/btwiuse/bingo/cmd/bingo

After running the command, you will have bingo as a tool in your go.mod file:

module github.com/example/pkg

...
tool github.com/btwiuse/bingo/cmd/bingo

And you can invoke bingo as a tool:

go tool github.com/btwiuse/bingo/cmd/bingo ...

Usage

The binary builder can be run using the 'go run' command, followed by any flags you wish to use. Here's an example:

bingo -d ./bin -tags "tag1 tag2" -ldflags "-X main.version=1.0.0" -strip -upx -pkg ./cmd/k0s
Flags

The binary builder supports the following flags:

  • -d: Specify the output directory for the built binary.
  • -pkg: Specify the path of the package to build.
  • -tags: Specify build tags.
  • -ldflags: Specify linker flags.
  • -strip: Strip the binary (removes symbol table and relocation information).
  • -upx: Compress the binary using UPX.
  • -dry: Dry run. Show what would be done without actually doing anything.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(args []string) error

Types

type Combo

type Combo struct {
	OS   string
	ARCH string
}

func (Combo) Env

func (c Combo) Env(config *Config) []string

func (Combo) ReleaseName

func (c Combo) ReleaseName(config *Config) string

func (Combo) String

func (c Combo) String() string

type Config

type Config struct {
	Pkgpath      string
	Binname      string
	Outpath      string
	Delimeter    string
	DefaultCombo Combo
	GlobalEnv    []string
}

func NewConfig

func NewConfig(pkgpath string) *Config

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL