Skip to content

Commit

Permalink
Arrange code.
Browse files Browse the repository at this point in the history
  • Loading branch information
q-uint committed Mar 15, 2024
1 parent f417b10 commit abd57e3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.16'
- run: go install github.com/jdeflander/goarrange@v1.0.0
working-directory: ${{ runner.temp }}
- run: test -z "$(goarrange run -r -d)"
Expand All @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4
- uses: golangci/golangci-lint-action@v4
with:
version: v1.56.2
version: 'v1.56.2'
args: -E misspell,godot,whitespace

test:
Expand All @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.16'
- run: go test -v ./...

tidy:
Expand All @@ -35,6 +35,6 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.16'
- run: go mod tidy
- run: git diff --quiet go.mod go.sum
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/elimity-com/scim

go 1.21
go 1.16

require (
github.com/di-wu/xsd-datetime v1.0.0
Expand Down
32 changes: 16 additions & 16 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,6 @@ type Server struct {
log Logger
}

type ServerArgs struct {
ServiceProviderConfig *ServiceProviderConfig
ResourceTypes []ResourceType
}

type ServerOption func(*Server)

// WithLogger sets the logger for the server.
func WithLogger(logger Logger) ServerOption {
return func(s *Server) {
if logger != nil {
s.log = logger
}
}
}

func NewServer(args *ServerArgs, opts ...ServerOption) (Server, error) {
if args == nil {
return Server{}, fmt.Errorf("arguments not provided")
Expand Down Expand Up @@ -247,3 +231,19 @@ func (s Server) parseRequestParams(r *http.Request, refSchema schema.Schema, ref
StartIndex: startIndex,
}, nil
}

type ServerArgs struct {
ServiceProviderConfig *ServiceProviderConfig
ResourceTypes []ResourceType
}

type ServerOption func(*Server)

// WithLogger sets the logger for the server.
func WithLogger(logger Logger) ServerOption {
return func(s *Server) {
if logger != nil {
s.log = logger
}
}
}

0 comments on commit abd57e3

Please sign in to comment.