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
53 changes: 42 additions & 11 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,36 +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", "dev", "gha" ]
branches:
- boilerplate
- dev
- idiomatic
- master
- rc1
- rc2
- rc3
pull_request:
branches: [ "master", "dev", "gha" ]

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.21', '1.22', '1.23', '1.24' ]
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 ${{ matrix.go-version }}
uses: actions/setup-go@v4
- name: "Set up Go ${{ matrix.go-version }}"
uses: actions/setup-go@v5
with:
go-version: '${{ matrix.go-version }}'

- name: Display 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 @@
ANGoLS
2 changes: 2 additions & 0 deletions .sis/script_info_lines.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ANGoLS provides Algorithms Not in the Go Language Standard library
Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems
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
},
}
2 changes: 1 addition & 1 deletion AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ANGoLS - Authors
# ANGoLS - Authors <!-- omit in toc -->

## Contributors:

Expand Down
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# **ANGoLS** Changes
# ANGoLS - CHANGES <!-- omit in toc -->

## 0.10.0 - 10th March 2026

Expand Down
2 changes: 1 addition & 1 deletion EXAMPLES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ANGoLS.Go Examples
# ANGoLS - 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,7 +1,6 @@
BSD 3-Clause License - ANGoLS

Copyright (c) 2019-2025, Matthew Wilson and Synesis Information Systems
ANGoLS - BSD 3-Clause License

Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ANGoLS - NEWS <!-- omit in toc -->
# ANGoLS - News <!-- omit in toc -->


| Date | News Item |
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# ANGoLS <!-- omit in toc -->

**A**lgorithms **N**ot in **Go** **L**anguage **S**tandard library

![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/ANGoLS.svg)](https://github.com/synesissoftware/ANGoLS/releases/latest)
[![Last Commit](https://img.shields.io/github/last-commit/synesissoftware/ANGoLS)](https://github.com/synesissoftware/ANGoLS/commits/master)
[![Go](https://github.com/synesissoftware/ANGoLS/actions/workflows/go.yml/badge.svg)](https://github.com/synesissoftware/ANGoLS/actions/workflows/go.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/synesissoftware/ANGoLS)](https://goreportcard.com/report/github.com/synesissoftware/ANGoLS)
[![Go Reference](https://pkg.go.dev/badge/github.com/synesissoftware/ANGoLS.svg)](https://pkg.go.dev/github.com/synesissoftware/ANGoLS)

**A**lgorithms **N**ot in **Go** **L**anguage **S**tandard library


## Table of Contents <!-- omit in toc -->

Expand Down Expand Up @@ -437,4 +438,3 @@ T.B.C.


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

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 ############################# #

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/synesissoftware/ANGoLS

go 1.24
go 1.23.6

require (
github.com/stretchr/testify v1.11.0
Expand Down
Loading
Loading