good morning!!!!

Skip to content
Commits on Source (10)
......@@ -4,3 +4,6 @@
*.tmp
*.log
*.test
coverage.txt
report.xml
......@@ -10,12 +10,12 @@
stages:
- test
lint:
image: registry.gitlab.com/gitlab-org/gitlab-build-images:golangci-lint-alpine
test:
image: golang:1.21-alpine
stage: test
extends: .go-cache
script:
- go test -race ./...
- CGO_ENABLED=1 go test -race ./...
lint:
image: registry.gitlab.com/gitlab-org/gitlab-build-images:golangci-lint-alpine
......@@ -37,11 +37,12 @@ lint:
coverage:
stage: test
image: golang:1.20-alpine
image: golang:1.21-alpine
coverage: '/\(statements\)(?:\s+)?(\d+(?:\.\d+)?%)/'
extends: .go-cache
script:
- go run gotest.tools/gotestsum@latest --junitfile report.xml --format testname -- -coverprofile=coverage.txt -covermode count ./...
- sed -i '/jrpctest/d' coverage.txt
- go tool cover -func=coverage.txt
- go run github.com/boumenot/gocover-cobertura@master < coverage.txt > coverage.xml
artifacts:
......
......@@ -90,8 +90,17 @@ func (c *Codec) Write(p []byte) (n int, err error) {
func (c *Codec) Flush() (err error) {
c.wrLock.Lock()
defer c.wrLock.Unlock()
c.wr.WriteByte('\n')
return c.wr.Flush()
if c.wr.Buffered() > 0 {
err = c.wr.WriteByte('\n')
if err != nil {
return err
}
err = c.wr.Flush()
if err != nil {
return err
}
}
return nil
}
// Closed returns a channel which is closed when the connection is closed.
......