-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add GitHub Actions workflow for Go CI and remove unused byteuti…
…l package
- Loading branch information
Showing
7 changed files
with
56 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Go | ||
on: [push] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: stable | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
version: v1.60 | ||
|
||
- name: Run golangci-lint | ||
run: golangci-lint run | ||
|
||
- name: Test | ||
#run: echo go test -v . | ||
run: echo go test ./... -count=1 -v |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,32 @@ | ||
package utilkit_test | ||
|
||
import ( | ||
"strings" | ||
"testing" | ||
"time" | ||
|
||
"github.com/airdb/toolbox/utilkit" | ||
) | ||
|
||
func TestGetNowLong(t *testing.T) { | ||
utilkit.GetNowLong() | ||
ts := utilkit.GetNowLong() | ||
if ts == "" { | ||
t.Errorf("Expected a valid timestamp, got %s", ts) | ||
} | ||
} | ||
|
||
func TestGetYearMonthDay(t *testing.T) { | ||
utilkit.GetYearMonthDay() | ||
today := utilkit.GetYearMonthDay() | ||
if !strings.Contains(today, "-") { | ||
t.Errorf("Expected a valid date string, got %s", today) | ||
} | ||
|
||
} | ||
|
||
func TestGetTimeRFC(t *testing.T) { | ||
now := time.Now().Unix() | ||
utilkit.GetTimeRFC(now) | ||
rfcTime := utilkit.GetTimeRFC(now) | ||
if _, err := time.Parse(time.RFC3339, rfcTime); err != nil { | ||
t.Errorf("Expected valid RFC3339 time format, got %s", rfcTime) | ||
} | ||
} |