Skip to content

Commit

Permalink
bug: fix the missing log.Lmsgprefix in go1.13 (#275)
Browse files Browse the repository at this point in the history
Fixes #274
---------

Co-authored-by: Andy Pan <[email protected]>
  • Loading branch information
piaodazhu and panjf2000 authored May 11, 2023
1 parent b32591f commit bca5b3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '^1.13'
go-version: ${{ matrix.go }}

- name: Print Go environment
id: go-env
Expand Down
4 changes: 3 additions & 1 deletion ants.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ var (
return 1
}()

defaultLogger = Logger(log.New(os.Stderr, "[ants]: ", log.LstdFlags|log.Lmsgprefix|log.Lmicroseconds))
// log.Lmsgprefix is not available in go1.13, just make an identical value for it.
logLmsgprefix = 64
defaultLogger = Logger(log.New(os.Stderr, "[ants]: ", log.LstdFlags|logLmsgprefix|log.Lmicroseconds))

// Init an instance pool when importing ants.
defaultAntsPool, _ = NewPool(DefaultAntsPoolSize)
Expand Down

0 comments on commit bca5b3a

Please sign in to comment.