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
17 changes: 17 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directories:
- "/"
schedule:
interval: "monthly"
labels:
- "dependencies"
- package-ecosystem: "gomod"
directories:
- "/"
schedule:
interval: "monthly"
labels:
- "dependencies"

42 changes: 23 additions & 19 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
name: Run CI Tests
on: [push]
on:
pull_request:
paths-ignore:
- 'README.md'
- 'LICENSE'
push:
branches:
- 'main'
jobs:
run-copywrite:
runs-on: ubuntu-22.04
timeout-minutes: 5
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-copywrite@v1.1.2
- uses: hashicorp/setup-copywrite@v1.1.3
- name: verify copyright
run: |
copywrite --config=.copywrite.hcl headers --plan
run-lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-golang@v1
with:
version-file: go.mod
- uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
skip-cache: true
copywrite --config .github/workflows/scripts/copywrite.hcl \
headers --spdx "BSD-3-Clause" --plan
run-tests:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-golang@v1
- uses: extractions/setup-just@v2
- uses: actions/setup-go@v5
with:
version-file: go.mod
go-version-file: go.mod
cache-dependency-path: '**/go.sum'
- name: Show System
run: |
uname -a
just sysinfo
- name: Run Go Test
run: |
make test
just init tidy lint test

15 changes: 15 additions & 0 deletions .github/workflows/scripts/copywrite.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
schema_version = 1

project {
license = "BSD-3-Clause"
copyright_holder = "CattleCloud LLC"
copyright_year = 2025
header_ignore = [
"**/*.sh",
".src/**",
".bin/**",
".github/**",
".golangci.yaml",
]
}

43 changes: 43 additions & 0 deletions .github/workflows/scripts/golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
run:
timeout: 5m
linters:
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- copyloopvar
- dogsled
- dupword
- durationcheck
- errcheck
- errname
- errorlint
- exhaustive
- gochecknoinits
- gocritic
- gofmt
- gosimple
- govet
- ineffassign
- makezero
- misspell
- musttag
- nilnil
- noctx
- perfsprint
- prealloc
- predeclared
- reassign
- revive
- rowserrcheck
- staticcheck
- sqlclosecheck
- tagalign
- tenv
- unused
- whitespace

linters-settings:
exhaustive:
default-signifies-exhaustive: true
26 changes: 10 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
*~
~*

# Test binary, built with `go test -c`
*.test
# OS files
**/.DS_Store

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Build artifacts
site

# Dependency directories (remove the comment below to include it)
# vendor/

# Go work files
# Go workspace file
go.work
go.work.sum

# macOS
.DS_Store
# Local source and binary files
.src/
.bin/

47 changes: 47 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
set shell := ["bash", "-u", "-c"]

export scripts := ".github/workflows/scripts"
export GOBIN := `echo $PWD/.bin`

# show available commands
[private]
default:
@just --list

# tidy up Go modules
[group('build')]
tidy:
go mod tidy

# run tests across source tree
[group('build')]
test:
go test -v -race -count=1 ./...

# ensure copywrite headers present on source files
[group('lint')]
copywrite:
copywrite \
--config {{scripts}}/copywrite.hcl headers \
--spdx "BSD-3-Clause"

# apply go vet command on source tree
[group('lint')]
vet:
go vet ./...

# apply golangci-lint linters on source tree
[group('lint')]
lint: vet
$GOBIN/golangci-lint run --config .github/workflows/scripts/golangci.yaml

# show host system information
[group('build')]
@sysinfo:
echo "{{os()/arch()}} {{num_cpus()}}c"

# locally install build dependencies
[group('build')]
init:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2018, NOXIDE.LOL
Copyright (c) 2025, CattleCloud LLC

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
23 changes: 0 additions & 23 deletions Makefile

This file was deleted.

23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ atomicfs

A library for atomic filesystem operations in Go.

[![Go Reference](https://pkg.go.dev/badge/noxide.lol/go/atomicfs.svg)](https://pkg.go.dev/noxide.lol/go/atomicfs)
[![License](https://img.shields.io/github/license/noxideproject/atomicfs?color=7C00D8&style=flat-square&label=License)](https://github.com/noxideproject/atomicfs/blob/main/LICENSE)
[![Build](https://img.shields.io/github/actions/workflow/status/noxideproject/atomicfs/ci.yaml?style=flat-square&color=0FAA07&label=Tests)](https://github.com/noxideproject/atomicfs/actions/workflows/ci.yaml)
[![Go Reference](https://pkg.go.dev/badge/cattlecloud.net/go/atomicfs.svg)](https://pkg.go.dev/cattlecloud.net/go/atomicfs)
[![License](https://img.shields.io/github/license/cattlecloud/atomicfs?color=7C00D8&style=flat-square&label=License)](https://github.com/cattlecloud/atomicfs/blob/main/LICENSE)
[![Build](https://img.shields.io/github/actions/workflow/status/cattlecloud/atomicfs/ci.yaml?style=flat-square&color=0FAA07&label=Tests)](https://github.com/cattlecloud/atomicfs/actions/workflows/ci.yaml)

# Overview

The `noxide.lol/go/atomicfs` module provides a package for performing atomic
The `cattlecloud.net/go/atomicfs` module provides a package for performing atomic
filesystem operations.

#### Reading material
Expand All @@ -18,9 +18,14 @@ filesystem operations.

# Getting Started

The `atomicfs` package can be installed by running
```bash
$ go get noxide.lol/go/atomicfs
The `atomicfs` package can be added to a project with `go get`.

```shell
go get cattlecloud.net/go/atomicfs@latest
```

```go
import "cattlecloud.net/go/atomicfs"
```

#### Examples
Expand All @@ -36,11 +41,11 @@ _ = writer.Write(input, output)

# Contributing

The `noxide.lol/go/atomicfs` module is always improving with new features and
The `cattlecloud.net/go/atomicfs` module is always improving with new features and
error corrections. For contributing bug fixes and new features please file an
issue.

# License

The `noxide.lol/go/atomicfs` module is open source under the [BSD-3-Clause](LICENSE)
The `cattlecloud.net/go/atomicfs` module is open source under the [BSD-3-Clause](LICENSE)
license.
6 changes: 3 additions & 3 deletions atomicfs.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) NOXIDE.LOL
// Copyright (c) CattleCloud LLC
// SPDX-License-Identifier: BSD-3-Clause

// Package atomicfs provides tools for doing all-or-nothing atomic filesystem
Expand All @@ -14,8 +14,8 @@ import (
"strings"
"syscall"

"noxide.lol/go/atomicfs/fs"
"noxide.lol/go/atomicfs/sys"
"cattlecloud.net/go/atomicfs/fs"
"cattlecloud.net/go/atomicfs/sys"
)

// A FileWriter is used to read content from a source and write it to a
Expand Down
6 changes: 3 additions & 3 deletions atomicfs_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) NOXIDE.LOL
// Copyright (c) CattleCloud LLC
// SPDX-License-Identifier: BSD-3-Clause

package atomicfs
Expand All @@ -8,9 +8,9 @@ import (
"strings"
"testing"

"cattlecloud.net/go/atomicfs/fs"
"cattlecloud.net/go/atomicfs/sys"
"github.com/shoenig/test/must"
"noxide.lol/go/atomicfs/fs"
"noxide.lol/go/atomicfs/sys"
)

func TestFileWriter_WriteFile(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion fs/filesystem.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) NOXIDE.LOL
// Copyright (c) CattleCloud LLC
// SPDX-License-Identifier: BSD-3-Clause

package fs
Expand Down
2 changes: 1 addition & 1 deletion fs/osfs.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) NOXIDE.LOL
// Copyright (c) CattleCloud LLC
// SPDX-License-Identifier: BSD-3-Clause

package fs
Expand Down
2 changes: 1 addition & 1 deletion fs/osfs_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) NOXIDE.LOL
// Copyright (c) CattleCloud LLC
// SPDX-License-Identifier: BSD-3-Clause

package fs
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module noxide.lol/go/atomicfs
module cattlecloud.net/go/atomicfs

go 1.21
go 1.23

require github.com/shoenig/test v1.7.0

Expand Down
2 changes: 1 addition & 1 deletion sys/syscall.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) NOXIDE.LOL
// Copyright (c) CattleCloud LLC
// SPDX-License-Identifier: BSD-3-Clause

package sys
Expand Down
2 changes: 1 addition & 1 deletion sys/syscall_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) NOXIDE.LOL
// Copyright (c) CattleCloud LLC
// SPDX-License-Identifier: BSD-3-Clause

package sys
Expand Down