From 3fdc30bbab8796c776f11396cd85e3b619d84aff Mon Sep 17 00:00:00 2001 From: Ethan Moffat Date: Tue, 25 Jul 2023 09:58:50 -0700 Subject: [PATCH 1/2] Add README --- README.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..27662c7 --- /dev/null +++ b/README.md @@ -0,0 +1,63 @@ +# eolib-go + +Core library for writing Endless Online applications using the Go programming language. + +## Usage + +### Referencing the package + +The library may be referenced in a project via go get: + +``` +go get https://github.com/ethanmoffat/eolib-go@v1.0.0 +``` + +### Sample code + +A sample server skeleton using eolib-go is [available here](https://gist.github.com/ethanmoffat/95eed4ef0eeb524c8a505acb1bcbf956). + +## Development Environment + +### Installing go + +Development was done using go 1.20.5 on Ubuntu Linux. Development on Windows is untested. + +[gvm](https://github.com/moovweb/gvm) is recommended as a mechanism to manage installations of different versions of go. + +To set up gvm on Linux using bash: +```bash +bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer) +source $HOME/.gvm/scripts/gvm +``` + +The `source` command may be added to your `~/.bash_profile` so gvm is available in all login shells. + +```bash +echo "source $HOME/.gvm/scripts/gvm" >> ~/.bash_profile +``` + +Once gvm is installed and sourced, use the following commands to install and use go 1.20.5: + +```bash +gvm install go1.20.5 -B +gvm use go1.20.5 +``` + +The `gvm use` command is required on each subsequent terminal or session in which `go` commands must be run. + +### VSCode setup + +If go is installed via gvm, you must update your `$GOROOT` variable to point at it, or VSCode won't be able to find the go binary. + +Get the path to the GOROOT via `go env`: + +```bash +~ [ethan@BEASTMODE] $ gvm use go1.20.5 +Now using version go1.20.5 +~ [ethan@BEASTMODE] $ go env GOROOT +/home/ethan/.gvm/gos/go1.20.5 +``` + +In VSCode, search for the `GOROOT` setting and update the path to point at this version of go. + +Note that a gvm extension exists for VSCode but it is out of date and no longer functions properly. From 6ddfc0626f7ca486cb1c4da8336ddce90b11045a Mon Sep 17 00:00:00 2001 From: Ethan Moffat Date: Tue, 25 Jul 2023 10:03:25 -0700 Subject: [PATCH 2/2] Add section to README talking about Makefile --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 27662c7..06781d4 100644 --- a/README.md +++ b/README.md @@ -61,3 +61,9 @@ Now using version go1.20.5 In VSCode, search for the `GOROOT` setting and update the path to point at this version of go. Note that a gvm extension exists for VSCode but it is out of date and no longer functions properly. + +### Building the code + +A `Makefile` is provided to ease the process of building, testing, and code generation. Use `make help` to see all available targets. Running `make` by itself should be enough for most uses. `make test` is also available to run all tests. + +Building the library on Windows is left as an exercise to the reader.