Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fixed an issue where CI failed to run through #129

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Lint/Test
strategy:
matrix:
go-version: [1.17.x]
go-version: [1.22.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -41,7 +41,7 @@ jobs:
run: |
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.31.0
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2
make lint

- name: Run Unit tests
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: 'https://github.com/golangci/golangci-lint'
rev: v1.46.2
rev: v1.54.2
hooks:
- id: golangci-lint
entry: golangci-lint run
12 changes: 10 additions & 2 deletions cmd/apiserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"time"

emailVerifier "github.com/AfterShip/email-verifier"
"github.com/julienschmidt/httprouter"
Expand Down Expand Up @@ -36,6 +36,14 @@ func main() {
router := httprouter.New()

router.GET("/v1/:email/verification", GetEmailVerification)
srv := &http.Server{
Addr: ":8080",
Handler: router,
ReadTimeout: 5 * time.Second,
WriteTimeout: 10 * time.Second,
}

log.Fatal(http.ListenAndServe(":8080", router))
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
panic(err)
}
}
4 changes: 2 additions & 2 deletions gravatar.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (

// Gravatar is detail about the Gravatar
type Gravatar struct {
HasGravatar bool // whether has gravatar
GravatarUrl string // gravatar url
HasGravatar bool `json:"has_gravatar"` // whether has gravatar
GravatarUrl string `json:"gravatar_url"` // gravatar url
}

// CheckGravatar will return the Gravatar records for the given email.
Expand Down
Loading