Unverified Commit 65c3ecbb authored by 望哥's avatar 望哥 Committed by GitHub

Merge pull request #4 from wongoo/master

add ci & fix format error
parents 5c3e4e85 f754223a
---
name: Bug Report
about: Report a bug
labels: kind/bug
---
<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!
-->
**What happened**:
**What you expected to happen**:
**How to reproduce it (as minimally and precisely as possible)**:
**Anything else we need to know?**:
---
name: Enhancement Request
about: Suggest an enhancement
labels: kind/feature
---
<!-- Please only use this template for submitting enhancement requests -->
**What would you like to be added**:
**Why is this needed**:
\ No newline at end of file
<!-- Thanks for sending a pull request!
-->
**What this PR does**:
**Which issue(s) this PR fixes**:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->
Fixes #
**Special notes for your reviewer**:
**Does this PR introduce a user-facing change?**:
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
```
\ No newline at end of file
linters-settings:
govet:
check-shadowing: true
golint:
min-confidence: 0
gocyclo:
min-complexity: 10
maligned:
suggest-new: true
dupl:
threshold: 100
goconst:
min-len: 2
min-occurrences: 2
depguard:
list-type: blacklist
packages:
# logging is allowed only by logutils.Log, logrus
# is allowed to use only in logutils package
- github.com/sirupsen/logrus
misspell:
locale: US
lll:
line-length: 140
goimports:
local-prefixes: github.com/golangci/golangci-lint
gocritic:
enabled-tags:
- performance
- style
- experimental
disabled-checks:
- wrapperFunc
linters:
enable-all: true
disable:
- maligned
- prealloc
- gochecknoglobals
run:
skip-dirs:
- test/testdata_etc
- pkg/golinters/goanalysis/(checker|passes)
issues:
exclude-rules:
- text: "weak cryptographic primitive"
linters:
- gosec
# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
golangci-lint-version: 1.15.x # use the fixed version to not introduce new linters unexpectedly
prepare:
- echo "here I can run custom commands, but no preparation needed for this repo"
language: go
go:
- "1.11"
- "1.12"
script:
- go fmt ./... && [[ -z `git status -s` ]]
- GO111MODULE=on && go mod vendor && go test ./... -bench . -race -v
# gost
[![Build Status](https://travis-ci.org/dubbogo/gost.png?branch=master)](https://travis-ci.org/dubbogo/gost)
[![GoCover](http://gocover.io/_badge/github.com/dubbogo/gost)](http://gocover.io/github.com/dubbogo/gost)
[![GoDoc](https://godoc.org/github.com/dubbogo/gost?status.svg)](https://godoc.org/github.com/dubbogo/gost)
A go sdk for [Apache Dubbo-go](github.com/apache/dubbo-go).
## bytes
......
package gxsync
// ref: github.com/sasha-s/go-deadlock
import (
......
......@@ -2,7 +2,6 @@
package gxsync
// ref: github.com/sasha-s/go-deadlock
import "sync"
......
......@@ -11,4 +11,3 @@ func EnableDeadlock(enable bool) {
Opts.DisableLockOrderDetection = false
}
}
package gxtime
import (
"fmt"
"sync"
"testing"
"time"
)
// output:
// timer costs: 100002 ms
// timer costs: 30001 ms
// --- PASS: TestNewWheel (100.00s)
func TestWheel(t *testing.T) {
var (
......@@ -18,23 +17,23 @@ func TestWheel(t *testing.T) {
)
wheel = NewWheel(TimeMillisecondDuration(100), 20)
defer func() {
fmt.Println("timer costs:", cw.Count()/1e6, "ms")
t.Log("timer costs:", cw.Count()/1e6, "ms")
wheel.Stop()
}()
cw.Start()
for {
<-wheel.After(TimeMillisecondDuration(1000))
fmt.Println("loop:", index)
t.Log("loop:", index)
index++
if index >= 150 {
if index >= 30 {
return
}
}
}
// output:
// timer costs: 150001 ms
// timer costs: 45001 ms
// --- PASS: TestNewWheel2 (150.00s)
func TestWheels(t *testing.T) {
var (
......@@ -44,7 +43,7 @@ func TestWheels(t *testing.T) {
)
wheel = NewWheel(TimeMillisecondDuration(100), 20)
defer func() {
fmt.Println("timer costs:", cw.Count()/1e6, "ms") //
t.Log("timer costs:", cw.Count()/1e6, "ms") //
wheel.Stop()
}()
......@@ -53,9 +52,9 @@ func TestWheels(t *testing.T) {
var index int
for {
<-wheel.After(d)
fmt.Println("loop:", index, ", interval:", d)
t.Log("loop:", index, ", interval:", d)
index++
if index >= 100 {
if index >= 30 {
return
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment