Skip to content

Commit

Permalink
github actions & readme: remove codecov badge (#533)
Browse files Browse the repository at this point in the history
* remove codecov badge
* upgrade deps
  • Loading branch information
gabriel-vasile committed May 23, 2024
1 parent ff4d3d0 commit 9bd6023
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 31 deletions.
31 changes: 8 additions & 23 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,32 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.1.6
- name: Install Go
uses: actions/setup-go@v5.0.0
with:
go-version: "1.18.x"
- name: Checkout code
uses: actions/checkout@v4.1.2
go-version-file: 'go.mod'
- name: Run linters
uses: golangci/golangci-lint-action@v4.0.0
uses: golangci/golangci-lint-action@v6
with:
version: "v1.45.2"
version: "v1.58"

test:
strategy:
matrix:
platform: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v4.1.6
- name: Install Go
if: success()
uses: actions/setup-go@v5.0.0
with:
go-version: "1.18.x"
- name: Checkout code
uses: actions/checkout@v4.1.2
go-version-file: 'go.mod'
- run: go test -race ./...
- run: go test -fuzz=. -fuzztime=30s
- run: go test -fuzz=Plain -fuzztime=30s ./internal/charset
- run: go test -fuzz=XML -fuzztime=30s ./internal/charset
- run: go test -fuzz=HTML -fuzztime=30s ./internal/charset

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.2
- name: Install Go
if: success()
uses: actions/setup-go@v5.0.0
with:
go-version: "1.18.x"
- name: Generate coverage
run: go test -race -covermode=atomic -coverprofile=coverage.out
- uses: codecov/codecov-action@v4.3.0
with:
files: ./coverage.out
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
<a href="https://goreportcard.com/report/github.com/gabriel-vasile/mimetype">
<img alt="Go report card" src="https://goreportcard.com/badge/github.com/gabriel-vasile/mimetype">
</a>
<a href="https://codecov.io/gh/gabriel-vasile/mimetype">
<img alt="Code coverage" src="https://codecov.io/gh/gabriel-vasile/mimetype/branch/master/graph/badge.svg?token=qcfJF1kkl2"/>
</a>
<a href="LICENSE">
<img alt="License" src="https://img.shields.io/badge/License-MIT-green.svg">
</a>
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/gabriel-vasile/mimetype

go 1.20

require golang.org/x/net v0.24.0
require golang.org/x/net v0.25.0
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
3 changes: 1 addition & 2 deletions mimetype.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package mimetype

import (
"io"
"io/ioutil"
"mime"
"os"
"sync/atomic"
Expand Down Expand Up @@ -50,7 +49,7 @@ func DetectReader(r io.Reader) (*MIME, error) {
// Using atomic because readLimit can be written at the same time in other goroutine.
l := atomic.LoadUint32(&readLimit)
if l == 0 {
in, err = ioutil.ReadAll(r)
in, err = io.ReadAll(r)
if err != nil {
return errMIME, err
}
Expand Down

0 comments on commit 9bd6023

Please sign in to comment.