From 8bc3b8c854bf0a1bebc45fd72fc20dbb207cc7f2 Mon Sep 17 00:00:00 2001 From: slashformotion Date: Sun, 28 Jul 2024 12:05:55 +0200 Subject: [PATCH] cleanup --- .github/workflows/ci.yml | 17 ++--------------- cmd/edit.go | 12 ------------ internal/utils/mathutils.go | 1 + internal/utils/stringutils.go | 24 ------------------------ shell.nix | 16 ++++++++++++++++ 5 files changed, 19 insertions(+), 51 deletions(-) delete mode 100644 internal/utils/stringutils.go create mode 100644 shell.nix diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c63448..f4cb7d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,21 +10,9 @@ on: branches: [ '**' ] jobs: - branch-naming-rules: - name: Check branch name - runs-on: ubuntu-latest - steps: - - uses: deepakputhraya/action-branch-name@master - with: - regex: '^(feature|bugfix|improvement|library|prerelease|release|hotfix|poc)\/[a-z0-9_.-]+$' - allowed_prefixes: 'feature,bugfix,improvement,library,prerelease,release,hotfix,poc' - ignore: master,main,dev - min_length: 5 - max_length: 50 check-style: name: Code style - needs: [branch-naming-rules] runs-on: ubuntu-latest steps: - uses: awalsh128/cache-apt-pkgs-action@latest @@ -47,7 +35,6 @@ jobs: unit-tests: name: Unit tests - needs: [branch-naming-rules] runs-on: ubuntu-latest steps: - uses: awalsh128/cache-apt-pkgs-action@latest @@ -74,7 +61,7 @@ jobs: needs: [unit-tests] strategy: matrix: - go_version: ['1.18.x', '1.19.x', '1.20.x'] + go_version: ['1.20.x', '1.21.x', '1.22.x'] steps: - uses: awalsh128/cache-apt-pkgs-action@latest with: @@ -93,4 +80,4 @@ jobs: uses: actions/upload-artifact@v1 with: name: binary_${{ matrix.go_version }} - path: ./radioboat \ No newline at end of file + path: ./radioboat diff --git a/cmd/edit.go b/cmd/edit.go index 0352606..4e944e7 100644 --- a/cmd/edit.go +++ b/cmd/edit.go @@ -27,8 +27,6 @@ var lsCmd = &cobra.Command{ You need to have correct environment variables set up. To do that please head to the wiki: https://github.com/slashformotion/radioboat/wiki/Configuration`, Run: func(cmd *cobra.Command, args []string) { - // editor = osutil.GetOptEnv("EDITOR")) - // cm := exec.Command("nvim", urlFilePath, " max { return max diff --git a/internal/utils/stringutils.go b/internal/utils/stringutils.go deleted file mode 100644 index e98f28a..0000000 --- a/internal/utils/stringutils.go +++ /dev/null @@ -1,24 +0,0 @@ -package utils - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import "math/rand" - -// return a random string of length n -func RandomString(n int) string { - var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") - - s := make([]rune, n) - for i := range s { - s[i] = letters[rand.Intn(len(letters))] - } - return string(s) -} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..37ae0a9 --- /dev/null +++ b/shell.nix @@ -0,0 +1,16 @@ +{pkgs ? import {}}: +pkgs.mkShell { + # nativeBuildInputs is usually what you want -- tools you need to run + nativeBuildInputs = with pkgs; [ + gnumake + + # go development + go + gopls + go-tools + delve + + # lib + mpv + ]; +}