bug: fix the missing log.Lmsgprefix in go1.13 (#275)

Fixes #274
---------

Co-authored-by: Andy Pan <panjf2000@gmail.com>
This commit is contained in:
Zhanghuixian Luo 2023-05-11 10:05:22 +08:00 committed by GitHub
parent b32591f8bd
commit bca5b3a7d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -59,7 +59,7 @@ jobs:
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
with: with:
go-version: '^1.13' go-version: ${{ matrix.go }}
- name: Print Go environment - name: Print Go environment
id: go-env id: go-env

View File

@ -82,7 +82,9 @@ var (
return 1 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. // Init an instance pool when importing ants.
defaultAntsPool, _ = NewPool(DefaultAntsPoolSize) defaultAntsPool, _ = NewPool(DefaultAntsPoolSize)