File tree Expand file tree Collapse file tree 6 files changed +59
-8
lines changed
Expand file tree Collapse file tree 6 files changed +59
-8
lines changed Original file line number Diff line number Diff line change 1616jobs :
1717 check-back-compat :
1818 name : build
19- runs-on : ubuntu-latest
19+ strategy :
20+ matrix :
21+ os : [ubuntu-latest, macos-latest]
22+ runs-on : ${{ matrix.os }}
2023 steps :
2124 - uses : actions/checkout@v4
2225 - name : Set up Go
Original file line number Diff line number Diff line change 1313jobs :
1414 check-back-compat :
1515 name : build
16- runs-on : ubuntu-latest
16+ strategy :
17+ matrix :
18+ os : [ubuntu-latest, macos-latest]
19+ runs-on : ${{ matrix.os }}
1720 steps :
1821 - uses : actions/checkout@v4
1922 with :
Original file line number Diff line number Diff line change 1818jobs :
1919 build :
2020 name : build
21- runs-on : ubuntu-latest
21+ strategy :
22+ matrix :
23+ os : [ubuntu-latest, macos-latest]
24+ runs-on : ${{ matrix.os }}
2225 steps :
2326 - uses : actions/checkout@v4
2427 - name : Set up Go
2932 run : go build -v ./...
3033 - name : go test
3134 run : go test -v ./...
32- - name : golangci-lint
33- uses : golangci/golangci-lint-action@v6
34- with :
35- version : v1.58
3635 - name : run omm
3736 run : |
3837 go build .
Original file line number Diff line number Diff line change 1+ name : lint
2+
3+ on :
4+ push :
5+ branches : [ "main" ]
6+ pull_request :
7+ paths :
8+ - " go.*"
9+ - " **/*.go"
10+ - " .github/workflows/*.yml"
11+
12+ permissions :
13+ contents : read
14+
15+ env :
16+ GO_VERSION : ' 1.22.5'
17+
18+ jobs :
19+ lint :
20+ name : lint
21+ runs-on : ubuntu-latest
22+ steps :
23+ - uses : actions/checkout@v4
24+ - name : Set up Go
25+ uses : actions/setup-go@v5
26+ with :
27+ go-version : ${{ env.GO_VERSION }}
28+ - name : golangci-lint
29+ uses : golangci/golangci-lint-action@v6
30+ with :
31+ version : v1.58
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ func GetDynamicStyle(str string) lipgloss.Style {
144144 h .Write ([]byte (str ))
145145 hash := h .Sum32 ()
146146
147- color := colors [int ( hash ) % len (colors )]
147+ color := colors [hash % uint32 ( len (colors ) )]
148148 return lipgloss .NewStyle ().
149149 Foreground (lipgloss .Color (color ))
150150}
Original file line number Diff line number Diff line change 1+ package types
2+
3+ import (
4+ "testing"
5+
6+ "github.com/stretchr/testify/assert"
7+ )
8+
9+ func TestGetDynamicStyle (t * testing.T ) {
10+ input := "abcdefghi"
11+ gota := GetDynamicStyle (input )
12+ gotb := GetDynamicStyle (input )
13+ // assert same style returned for the same string
14+ assert .Equal (t , gota .GetBackground (), gotb .GetBackground ())
15+ }
You can’t perform that action at this time.
0 commit comments