1
0
Fork
You've already forked go-common
0
No description
  • Go 93%
  • Makefile 5.1%
  • HTML 1.4%
  • AMPL 0.5%
Fiona Bianchi a2c3883683
All checks were successful
ci/woodpecker/push/build Pipeline was successful
Fixing escaping and path for protoc generation
2026年06月09日 18:41:18 +01:00
.bin Updating to use new tools support and adding process factory code 2026年05月05日 14:50:45 +01:00
.gocache Hacked around alot to get the gopls tool to compile and install 2026年05月05日 23:04:49 +01:00
.gopath Initial assembling of files into one repo 2023年11月02日 15:17:26 +00:00
.woodpecker Fixes for gRPC tools 2026年06月09日 18:25:28 +01:00
cmd/oteltestserver Fixing linting errors and changing to newer telemetry code 2026年05月09日 21:52:29 +01:00
generated Initial assembling of files into one repo 2023年11月02日 15:17:26 +00:00
pkg Fixed incorrect mockgen command 2026年06月09日 18:04:19 +01:00
submodules Updating submodule 2025年08月02日 16:45:01 +01:00
telemetry Initial assembling of files into one repo 2023年11月02日 15:17:26 +00:00
.dir-locals.el Fixing build issues 2025年08月03日 07:01:29 +01:00
.envrc Hacked around alot to get the gopls tool to compile and install 2026年05月05日 23:04:49 +01:00
.gitignore Initial assembling of files into one repo 2023年11月02日 15:17:26 +00:00
.gitmodules Initial assembling of files into one repo 2023年11月02日 15:17:26 +00:00
go.gopls.mod Adding individual mod files for different tools 2026年05月05日 23:39:20 +01:00
go.gopls.sum Adding individual mod files for different tools 2026年05月05日 23:39:20 +01:00
go.grpc.mod Fixes for gRPC tools 2026年06月09日 18:25:28 +01:00
go.grpc.sum Fixes for gRPC tools 2026年06月09日 18:25:28 +01:00
go.imports.mod Adding tools into seperate mod files and attempting to fix mockgen calls 2026年05月06日 23:09:30 +01:00
go.imports.sum Adding tools into seperate mod files and attempting to fix mockgen calls 2026年05月06日 23:09:30 +01:00
go.lint.mod Adding individual mod files for different tools 2026年05月05日 23:39:20 +01:00
go.lint.sum Adding individual mod files for different tools 2026年05月05日 23:39:20 +01:00
go.mock.mod Adding tools into seperate mod files and attempting to fix mockgen calls 2026年05月06日 23:09:30 +01:00
go.mock.sum Adding tools into seperate mod files and attempting to fix mockgen calls 2026年05月06日 23:09:30 +01:00
go.mod Adding tools into seperate mod files and attempting to fix mockgen calls 2026年05月06日 23:09:30 +01:00
go.sum Adding tools into seperate mod files and attempting to fix mockgen calls 2026年05月06日 23:09:30 +01:00
go.telemetry.mod Adding tools into seperate mod files and attempting to fix mockgen calls 2026年05月06日 23:09:30 +01:00
go.telemetry.sum Adding tools into seperate mod files and attempting to fix mockgen calls 2026年05月06日 23:09:30 +01:00
LICENSE Add missing license file 2024年09月04日 09:40:37 +01:00
Makefile Fixing escaping and path for protoc generation 2026年06月09日 18:41:18 +01:00
README.md Removing DynamoDB support and fixing some linting errors. 2026年05月08日 21:09:50 +01:00
VERSION Fixing linting errors and changing to newer telemetry code 2026年05月09日 21:52:29 +01:00

Go Common

Overview

Common code shared by other Go services

Pipeline

Quickstart

  • Clone the repo
  • Update submodules with the following commands
git submodule init
git submodule update
  • Ensure you have go 1.24.x installed
  • Ensure you have the protocol buffers compiler (protoc) installed
  • Download dependencies with
make download
make download_tools
  • Install gopls language server with
make install_gopls
  • Run tests with the following
make generate
make test_clean

IMPORTANT

Make sure that you update the version number in VERSION and create a new tag when you make ANY changes/fixes to this repository

Go uses the tags for versioning of code and you'll need to make sure that repos using this common code are updated to pick up the new version. This repo follows semantic versioning and the version in the VERSION file MUST always be updated on code changes.

Follow these step for this repo

  • Create a branch with a fix/change and increment the version in VERSION
  • For bug/minor fixes, just the patch version could be changed
  • For new, non-breaking, functionality increase the minor number
  • For significant or breaking changes, increment the major number
  • Reset minor/patch numbers to 0 if you increment major/minor, e.g. 0.1.3 -> 1.0.0, or 0.1.4 -> 0.2.0
  • Once the branch is reviewed and merged then switch to the main branch locally
  • Run this command to create a tag and push it

TODO: Automate the tagging steps below

git pull # Just make sure your branch is up to date with origin/main
git tag v`cat VERSION`
git push --tags
  • In repositories that use the common code and need the new fix run this
go get -u codeberg.org/fionahiklas/go-common
  • This should pull the latest version of the common code and update the go.mod file

Notes

Go Tools

Initial install of tools packages

go get -tool -modfile=go.imports.mod golang.org/x/tools/cmd/goimports
go get -tool -modfile=go.mock.mod go.uber.org/mock/mockgen
go get -tool -modfile=go.grpc.mod google.golang.org/protobuf/cmd/protoc-gen-go
go get -tool -modfile=go.grpc.mod google.golang.org/grpc/cmd/protoc-gen-go-grpc
go get -tool -modfile=go.telemetry.mod github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen
go get -tool -modfile=go.lint.mod github.com/golangci/golangci-lint/cmd/golangci-lint
go get -tool -modfile=go.gopls.mod golang.org/x/tools/gopls

We have to load the tools into their own module files because of conflicts in libraries. At time of writing (2026年05月08日) the gopls tool still uses an older version of golang.org/x/tools which then clashes with newer versions used in other tools. Overall the mix of my code's dependencies and those for tools was getting out of hand hence the move to seperate files.

Protocol Buffers

Installing the protocol buffers compiler on various platoforms

Mac

brew install protobuf protoc-gen-go

Linux

On Alpine Linux

apk add protoc

Setting up submodules

The OpenTelemetry submodule was setup as follows

git submodule add https://github.com/open-telemetry/opentelemetry-proto submodules/opentelemetry-proto

This updates the git repo so needs to be committed and pushed

References

OpenTelemetry

Git

Woodpecker

Go