From 7d3a08655234c02d731bb9d771678d435875da40 Mon Sep 17 00:00:00 2001 From: Seven SUN Date: Sat, 25 Jan 2025 20:14:15 +0800 Subject: [PATCH] [+] add terminal output colors --- .gitea/workflows/build.yaml | 3 ++- .gitignore | 54 ++++++++++++++++++++----------------- src/go.mod | 4 +-- src/plugin/color/color.go | 10 +++++++ 4 files changed, 44 insertions(+), 27 deletions(-) create mode 100644 src/plugin/color/color.go diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index f95f24d..570d755 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -1,5 +1,6 @@ name: Build Action for Go -on: [push] +on: + [workflow_dispatch] jobs: build: diff --git a/.gitignore b/.gitignore index cfebad3..3424d8a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,31 @@ +### Go template +# If you prefer the allow list template instead of the deny list, see community template: +# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore +# +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +# Go workspace file +go.work +go.work.sum + +# env file +.env + +### macOS template # General .DS_Store .AppleDouble @@ -25,28 +53,6 @@ Network Trash Folder Temporary Items .apdisk -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -# vendor/ - -# Go workspace file -go.work -go.work.sum - -# env file -.env - -# geofeed file +# Custom geofeed.csv +build diff --git a/src/go.mod b/src/go.mod index a99caa4..eb90ead 100644 --- a/src/go.mod +++ b/src/go.mod @@ -1,3 +1,3 @@ -module github.com/realsunyz/geofeed-validator +module github.com/realsunyz/geofeed-tools -go 1.23.2 +go 1.23 diff --git a/src/plugin/color/color.go b/src/plugin/color/color.go new file mode 100644 index 0000000..a1cd3da --- /dev/null +++ b/src/plugin/color/color.go @@ -0,0 +1,10 @@ +package color + +const ( + Reset = "\033[0m" + Red = "\033[31m" + Green = "\033[32m" + Yellow = "\033[33m" + Magenta = "\033[35m" + Cyan = "\033[36m" +)