Skip to content

Commit

Permalink
fix: goimports (#3)
Browse files Browse the repository at this point in the history
Signed-off-by: ashing <[email protected]>
  • Loading branch information
ronething authored Aug 27, 2023
1 parent 9704fad commit 3e5c236
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
19 changes: 9 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
repos:
- repo: git://github.com/dnephin/pre-commit-golang
rev: v0.4.0
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.5.1
hooks:
- id: go-fmt
- id: go-imports

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.10
hooks:
- id: insert-license
files: \.go$
args:
- --license-filepath
- LICENSE
- --comment-style
- /*| *| */
- id: insert-license
files: \.go$
args:
- --license-filepath
- LICENSE
- --comment-style
- /*| *| */
1 change: 0 additions & 1 deletion core/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"time"

clientv3 "go.etcd.io/etcd/client/v3"

"google.golang.org/grpc"
)

Expand Down
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@
package main

import (
"broadcast/core"
"broadcast/svc"
"context"
"log"
"os"
"os/signal"
"syscall"
"time"

"broadcast/core"
"broadcast/svc"
)

var regionBroad *svc.RegionBroad
Expand Down
3 changes: 2 additions & 1 deletion notify/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
package main

import (
"broadcast/core"
"context"
"fmt"
"log"
"time"

"broadcast/core"
)

// 模拟配置发生变更
Expand Down
11 changes: 11 additions & 0 deletions scripts/goimports-reviser.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -e

go install github.com/incu6us/goimports-reviser/v2@latest

PROJECT_NAME=broadcast

find . -name '*.go' -print0 | while IFS= read -r -d '' file; do
goimports-reviser -file-path "$file" -project-name "$PROJECT_NAME"
done

0 comments on commit 3e5c236

Please sign in to comment.