From e1e12844a5fba4bfe14386f8612fbf1c4ecd7aa5 Mon Sep 17 00:00:00 2001 From: Bastien Riviere Date: Mon, 29 Jan 2024 18:52:31 +0100 Subject: [PATCH] chore: setup go project --- README.md | 23 ++++++++++++++++++++++- go.mod | 3 +++ main.go | 7 +++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 go.mod create mode 100644 main.go diff --git a/README.md b/README.md index 710c9c3..b11546d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,24 @@ # short -URL Shortener written in Go +URL Shortener written in Go. + +# Requirements + +- [go 1.21.6 or more](https://go.dev/doc/install) +- [Docker](https://www.docker.com/) +- [atlas](https://atlasgo.io/getting-started) +- [sqlc](https://docs.sqlc.dev/en/stable/overview/install.html) +- [just](https://github.com/casey/just#installation) (optional) + +> [!NOTE] +> If you are using [Nix](https://nixos.org/), you can just run `nix develop .` or `direnv allow` if you use Direnv. + +# Running the app + +Once you have installed all requirements, you can simply do: + +```sh +docker compose up -d +just migrate # or atlas migrate apply --env local +go run . +``` diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..a357bdc --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/babariviere/short + +go 1.21.6 diff --git a/main.go b/main.go new file mode 100644 index 0000000..cb765cd --- /dev/null +++ b/main.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("Hello, short!") +}