commit 6c0a88f5e682839a31d7f7d88b6c6a01bc2f6a3d Author: Gaze Date: Fri Mar 29 01:09:47 2024 +0700 feat: init repo diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8bd96e5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,74 @@ +# Eg. foo_test.ignore.go, credentials.ignore.json, config.ignore.yml +*.ignore.* +# Eg. ignore.foo_test.go, ignore.credentials.json, ignore.config.yml +ignore.* + +**/cmd.local/** +**/cmd.local.**/** + +**/tmps/** +.env +.DS_Store +**/config.yml +**/config.yaml +**/config.*.yml +**/config.*.yaml +!**/config.example.* +**/credentials.json +/dev-scripts +.idea +.env +**/node_modules + +*.output + +# redis data +*.rdb + +*.fiber.gz + +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +.goreload + + +node_modules +.pnp +.pnp.js + +# Local env files +.env +.env.local +.env.development.local +.env.test.local +.env.production.local + +# Testing +coverage + +# Turbo +.turbo + +# Vercel +.vercel + +# Build Outputs +.next/ +out/ +build +dist + + +# Debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Misc +.DS_Store +*.pem diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 0000000..44cd175 --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,85 @@ +# GolangCI-Lint +# this workspace is using golangci-lint for linting, so you need to install it. +## MacOS Installation (HomeBrew) +# $ brew install golangci-lint +# See more: https://golangci-lint.run/usage/install/ +## VSCode Integrations (for User Settings) +# 1. Open VSCode Settings (JSON) +# 2. in configs, add field `go.lintTool` and value `golangci-lint` ("go.lintTool":"golangci-lint") +# See more: https://golangci-lint.run/usage/integrations/ + +# See more: https://golangci-lint.run/usage/configuration/#run-configuration +run: + # Timeout for analysis, e.g. 30s, 5m. + # Default: 1m + timeout: 10m + # Include test files or not. + # Default: true + tests: false + # Allow multiple parallel golangci-lint instances running. + # If false (default) - golangci-lint acquires file lock on start. + allow-parallel-runners: false + +# See more: https://golangci-lint.run/usage/linters/ +linters: + disable-all: true + enable: + ### Metalinter + - staticcheck # bugs, metalinter - https://staticcheck.io + - govet # bugs, metalinter + # - gocritic # style, metalinter - https://github.com/go-critic/go-critic + # - revive # style, metalinter - https://github.com/mgechev/revive + ### Default Linters + - gosimple # style + - ineffassign # unused + - typecheck # bugs + - unused # unused + - errcheck # bugs, error + ### If some linters are not needed or annoying, you can disable them here. + - bodyclose # performance, bugs - checks whether HTTP response body is closed successfully + - misspell # style, comment - Finds commonly misspelled English words in comments. https://github.com/client9/misspell + - durationcheck # bugs - check for two durations multiplied together + - gofumpt # format - Gofumpt checks whether code was gofumpt-ed. + - goimports # format, import - In addition to fixing imports, goimports also formats your code in the same style as gofmt. + - whitespace # style - Tool for detection of leading and trailing whitespace. + - nosprintfhostport # style - Checks for misuse of Sprintf to construct a host with port in a URL. + - usestdlibvars # style - detect the possibility to use variables/constants from the Go standard library + - noctx # performance, bugs - finds sending http request without context.Context + - goconst # style - Finds repeated strings that could be replaced by a constant + - errorlint # bugs, error - find code that will cause problems with the error wrapping scheme introduced in Go 1.13. + - unconvert # style - unnecessary type conversions + - prealloc # performance - Find slice declarations that could potentially be pre-allocated, https://github.com/alexkohler/prealloc + - gosec # bugs - Inspects source code for security problems + - wrapcheck # style, error - Checks that errors returned from external packages are wrapped, we should wrap the error from external library + ### Annoying Linters + # - dupl # style - code clone detection + +issues: + # Maximum issues count per one linter. + max-issues-per-linter: 50 + # Maximum count of issues with the same text. + max-same-issues: 5 + # Fix found issues (if it's supported by the linter). + fix: true + +linters-settings: + misspell: + locale: US + ignore-words: [] + wrapcheck: + ignoreSigs: + - .Errorf( + - errors.New( + - errors.Unwrap( + - .Wrap( + - .Wrapf( + - .WithMessage( + - .WithMessagef( + - .WithStack( + ignoreSigRegexps: + - \.New.*Error\( + ignorePackageGlobs: + - "github.com/gofiber/fiber/*" + goconst: + ignore-tests: true + min-occurrences: 5 diff --git a/README.md b/README.md new file mode 100644 index 0000000..4f2b8e7 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Gaze Indexer Network diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..c32f745 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/gaze-network/indexer-network + +go 1.22