Skip to content

Commit

Permalink
Add GitHub action for code quality checks (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
fatedier authored Jun 6, 2024
1 parent 791a33d commit eba69aa
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/go-code-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Go Code Check

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'

- name: Build
run: make

- name: Vet
run: go vet ./...
2 changes: 1 addition & 1 deletion cmd/frpc/default_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var runner model.Runner = defaultRunner{}

type defaultRunner struct{}

func (r defaultRunner) New(commonCfg *v1.ClientCommonConfig, pxyCfg []v1.ProxyConfigurer, vCfg []v1.VisitorConfigurer) (err error) {
func (r defaultRunner) Init(commonCfg *v1.ClientCommonConfig, pxyCfg []v1.ProxyConfigurer, vCfg []v1.VisitorConfigurer) (err error) {
log.Infof("init default runner")
return
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/frpc/nssh_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type NativeSSHRun struct {
cancelFunc context.CancelFunc
}

func (nr *NativeSSHRun) New(commonCfg *v1.ClientCommonConfig, pxyCfg []v1.ProxyConfigurer, vCfg []v1.VisitorConfigurer) error {
func (nr *NativeSSHRun) Init(commonCfg *v1.ClientCommonConfig, pxyCfg []v1.ProxyConfigurer, vCfg []v1.VisitorConfigurer) error {
log.Infof("init native ssh runner")

nr.ctx, nr.cancelFunc = context.WithCancel(context.Background())
Expand Down
2 changes: 1 addition & 1 deletion pkg/model/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

type Runner interface {
New(commonCfg *v1.ClientCommonConfig, pxyCfg []v1.ProxyConfigurer, vCfg []v1.VisitorConfigurer) error
Init(commonCfg *v1.ClientCommonConfig, pxyCfg []v1.ProxyConfigurer, vCfg []v1.VisitorConfigurer) error
Run() error
Close() error
}

0 comments on commit eba69aa

Please sign in to comment.