Single-File libraries in Golang

A repository with libraries that can be easily copied into your project.
One library - one file. Own the code.
Libraries
| Name |
Version |
Description |
| csrf |
0.0.1 |
Basic protection against CSRF attacks. |
| dotenv |
0.0.1 |
.env file loader. |
| loadtmpl |
0.0.1 |
HTML template loader. |
| syslog |
0.0.1 |
Syslog wrapper that implements slog.Handler. |
Installation
Option 1: web interface
Just copy the library file into your project.
You can also copy the test files.
Download the library file:
curl https://raw.githubusercontent.com/ordinary-dev/go-sfl/refs/heads/master/$LIBRARY/$LIBRARY.go -o $LIBRARY.go
You can also copy the entire repository:
git clone https://github.com/ordinary-dev/go-sfl.git
Option 3: go modules
You can use the traditional way of installing dependencies in go.
go get github.com/ordinary-dev/go-sfl
Example:
import (
"github.com/ordinary-dev/go-sfl/<LIBRARY>"
)
But do you need an extra dependency for such small tasks?
Acknowledgments
Insiped by nothings/stb.