Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.go linguist-language=Go
*.html linguist-detectable=false
*.md linguist-detectable=false
*.sh linguist-detectable=false
*.vimrc linguist-detectable=false
makefile linguist-detectable=false
57 changes: 48 additions & 9 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,67 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

#
# Created: 18th August 2025
# Updated: 3rd August 2026
#

name: Go

env:
VERBOSITY: 1

on:
push:
branches: [ "master" ]
branches:
- boilerplate
- dev
- idiomatic
- master
- rc1
- rc2
- rc3
pull_request:
branches: [ "master" ]

defaults:
run:
shell: bash

jobs:

build:
runs-on: ubuntu-latest
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false

matrix:
go-version:
- '1.26'
- '1.25'
- '1.24'
- '1.23'
- '1.22'
- '1.21'
os:
- macos-latest
- ubuntu-latest
- windows-latest

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
- name: "Set up Go ${{ matrix.go-version }}"
uses: actions/setup-go@v5
with:
go-version: '1.24'
go-version: '${{ matrix.go-version }}'

- name: "Display Go version"
run: go version

- name: Build
- name: "Build all targets"
run: ./build.sh

- name: Test
run: ./run_all_unit_tests.sh
- name: "Run all unit-tests"
run: ./run_all_unit_tests.sh --verbosity ${{ env.VERBOSITY }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Synesis Information Systems .gitignore for Go libraries


# directories (by name)

/scratch/
Expand All @@ -16,6 +19,7 @@
*~
*.[568vq]
*.a
*.dll
*.dylib
*.exe
*.lib
Expand All @@ -27,4 +31,3 @@
*.test
*.tmp
*.zip

1 change: 1 addition & 0 deletions .sis/project_name.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libCLImate.Go
3 changes: 3 additions & 0 deletions .sis/script_info_lines.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
libCLImate.Go is a Command-Line Interface boilerplate mini-framework for Go
Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems
Copyright (c) 2015-2019, Matthew Wilson and Synesis Software
54 changes: 54 additions & 0 deletions .vimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
" Synesis Go project .vimrc — aligned with .vscode/settings.json (Go)

set nocompatible
filetype indent plugin on
syntax enable
set autoindent
set backspace=indent,eol,start
set hlsearch
set incsearch
set number

" files.insertFinalNewline
set eol
set fixeol

" editor.renderWhitespace: all
set list
set listchars=tab:->,trail:-,extends:>,precedes:<,nbsp:+

" editor.detectIndentation: false — global defaults (editor.tabSize: 2, insertSpaces: false)
set colorcolumn=76
set noexpandtab
set shiftwidth=2
set softtabstop=2
set tabstop=2

" colorcolumn draws a full-column tint in Vim (not a VS Code-style 1px line).
" Keep it subtle via the ColorColumn highlight group; reapply after colorscheme changes.
if has('termguicolors')
" set termguicolors
endif

function! s:ConfigureColorColumn() abort
highlight ColorColumn ctermbg=236 guibg=#2a2a2a cterm=NONE gui=NONE
endfunction

call s:ConfigureColorColumn()
autocmd ColorScheme * call s:ConfigureColorColumn()

" files.trimTrailingWhitespace
autocmd BufWritePre * %s/\s\+$//e

augroup sis_go
autocmd!

" [go] — gofmt uses tabs; match .vscode [go] tabSize 2 / insertSpaces false
autocmd FileType go setlocal noexpandtab tabstop=2 shiftwidth=2 softtabstop=2 colorcolumn=60,76,100

" [shellscript]
autocmd FileType sh,bash,zsh setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 colorcolumn=60,76

" [json] / [markdown] / [yaml]
autocmd FileType json,markdown,yaml setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2
augroup END
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
],
"go.formatTool": "goimports",
"go.lintFlags": [
"--fast"
"--fast",
],
"go.lintOnSave": "workspace",
"go.lintTool": "golangci-lint",
"go.useLanguageServer": true,
"gopls": {
"ui.completion.usePlaceholders": true,
"ui.semanticTokens": true,
"ui.completion.usePlaceholders": true
},
}
Empty file added AUTHORS.md
Empty file.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# **libCLImate.Go** Changes
# libCLImate.Go - CHANGES <!-- omit in toc -->


## 0.8.2-beta-1 - 18th August 2025
Expand Down
2 changes: 1 addition & 1 deletion EXAMPLES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# libCLImate.Go Examples
# libCLImate.Go - Examples <!-- omit in toc -->

|Name|Source & Description|Summary|
|---|---|---|
Expand Down
5 changes: 2 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
BSD 3-Clause License - libCLImate.Go
libCLImate.Go - BSD 3-Clause License

Copyright (c) 2019-2025, Matthew Wilson and Synesis Information Systems
Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems
Copyright (c) 2015-2019, Matthew Wilson and Synesis Software

All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
Empty file added NEWS.md
Empty file.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# libCLImate.Go <!-- omit in toc -->

**C**ommand-**L**ine **I**nterface boilerplate mini-framework, for Go

![Language](https://img.shields.io/badge/Go-00ADD8?style=flat&logo=go&logoColor=white)
[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![GitHub release](https://img.shields.io/github/v/release/synesissoftware/libCLImate.Go.svg)](https://github.com/synesissoftware/libCLImate.Go/releases/latest)
[![Last Commit](https://img.shields.io/github/last-commit/synesissoftware/libCLImate.Go)](https://github.com/synesissoftware/libCLImate.Go/commits/master)
[![Go](https://github.com/synesissoftware/libCLImate.Go/actions/workflows/go.yml/badge.svg)](https://github.com/synesissoftware/libCLImate.Go/actions/workflows/go.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/synesissoftware/libCLImate.Go)](https://goreportcard.com/report/github.com/synesissoftware/libCLImate.Go)
[![Go Reference](https://pkg.go.dev/badge/github.com/synesissoftware/libCLImate.Go.svg)](https://pkg.go.dev/github.com/synesissoftware/libCLImate.Go)

**C**ommand-**L**ine **I**nterface boilerplate mini-framework, for Go


## Introduction

Expand Down Expand Up @@ -242,4 +243,3 @@ Defect reports, feature requests, and pull requests are welcome on https://githu


<!-- ########################### end of file ########################### -->

2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# **libCLImate.Go** TODO <!-- omit in toc -->
# libCLImate.Go - TODO <!-- omit in toc -->


## **libCLImate.Go** 0.6.x TODOs:
Expand Down
108 changes: 94 additions & 14 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,114 @@

ScriptPath=$0
Dir=$(cd $(dirname "$ScriptPath"); pwd)
ProjectNameFile="$Dir/.sis/project_name.txt"
ProjectName=$(tr -d '[:space:]' < "$ProjectNameFile")


# ##########################################################
# command-line handling

while [[ $# -gt 0 ]]; do

case $1 in
--help)

[ -f "$Dir/.sis/script_info_lines.txt" ] && cat "$Dir/.sis/script_info_lines.txt"
cat << EOF
Builds the ${ProjectName} library and (if present) examples

$ScriptPath [ ... flags/options ... ]

Flags/options:

standard flags:

--help
displays this help and terminates

EOF

exit 0
;;
*)

>&2 echo "$ScriptPath: unrecognised argument '$1'; use --help for usage"

exit 1
;;
esac

shift
done


# ##########################################################
# main()

mkdir -p "$Dir/scratch/build-artefacts/"


# library
echo "building library ..."
go build -v $Dir
echo "building ${ProjectName} library ..."
go build -v "$Dir"


# examples
if [ -d "$Dir/examples" ];then
if [ -d "$Dir/examples" ]; then

echo "building examples ..."
cd "$Dir/scratch/build-artefacts/"
find "$Dir/examples" -type f -name '*.go' -print -exec go build -v {} \;
cd ->/dev/null
echo "building ${ProjectName} examples ..."

# subdirectory examples (examples/<name>/main.go)
for example_dir in "$Dir"/examples/*/; do

[ -d "$example_dir" ] || continue

if [ -f "${example_dir}main.go" ]; then

example_name=$(basename "$example_dir")
echo "building example ${example_name} ..."
go build -v -o "$Dir/scratch/build-artefacts/${example_name}" "$example_dir"
fi
done

# loose single-file examples (examples/*.go)
for example_file in "$Dir"/examples/*.go; do

[ -f "$example_file" ] || continue

example_name=$(basename "$example_file" .go)
echo "building example ${example_name} ..."
go build -v -o "$Dir/scratch/build-artefacts/${example_name}" "$example_file"
done
fi


# tests
if [ -d "$Dir/tests" ];then
# tests (standalone programs under tests/, if present)
if [ -d "$Dir/tests" ]; then

echo "building ${ProjectName} tests ..."

echo "building tests ..."
cd "$Dir/scratch/build-artefacts/"
find "$Dir/tests" -type f -name '*.go' -print -exec go build -v {} \;
cd ->/dev/null
for test_dir in "$Dir"/tests/*/; do

[ -d "$test_dir" ] || continue

if [ -f "${test_dir}main.go" ]; then

test_name=$(basename "$test_dir")
echo "building test ${test_name} ..."
go build -v -o "$Dir/scratch/build-artefacts/${test_name}" "$test_dir"
fi
done

for test_file in "$Dir"/tests/*.go; do

[ -f "$test_file" ] || continue

test_name=$(basename "$test_file" .go)
echo "building test ${test_name} ..."
go build -v -o "$Dir/scratch/build-artefacts/${test_name}" "$test_file"
done
fi


# ############################## end of file ############################# #

Loading
Loading