Skip to content

Commit

Permalink
Fix go lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
askolesov committed May 19, 2022
1 parent 4c8dbb4 commit ad12f3e
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 10 deletions.
5 changes: 3 additions & 2 deletions cmd/serve.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package cmd

import (
"net/http"
"strings"

"github.com/cheqd/did-resolver/services"
"github.com/cheqd/did-resolver/types"
"github.com/cheqd/did-resolver/utils"
Expand All @@ -9,8 +12,6 @@ import (
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"net/http"
"strings"
)

func getServeCmd() *cobra.Command {
Expand Down
3 changes: 1 addition & 2 deletions services/diddoc_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import (
"google.golang.org/protobuf/runtime/protoiface"
)

type DIDDocService struct {
}
type DIDDocService struct{}

const (
verificationMethod = "verificationMethod"
Expand Down
1 change: 0 additions & 1 deletion services/ledger_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,4 @@ func TestQueryDIDDoc(t *testing.T) {
require.EqualValues(t, subtest.expectedError, err)
})
}

}
2 changes: 0 additions & 2 deletions services/request_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func (rs RequestService) ProcessDIDRequest(didUrl string, resolutionOptions type
}

func (rs RequestService) prepareResolutionResult(did string, resolutionOptions types.ResolutionOption) (string, error) {

didResolution, err := rs.Resolve(did, resolutionOptions)
if err != nil {
return "", err
Expand Down Expand Up @@ -101,7 +100,6 @@ func (rs RequestService) prepareDereferencingResult(did string, dereferencingOpt

// https://w3c-ccg.github.io/did-resolution/#resolving
func (rs RequestService) Resolve(did string, resolutionOptions types.ResolutionOption) (types.DidResolution, error) {

didResolutionMetadata := types.NewResolutionMetadata(did, resolutionOptions.Accept, "")

if didMethod, _, _, _ := cheqdUtils.TrySplitDID(did); didMethod != rs.didMethod {
Expand Down
2 changes: 1 addition & 1 deletion services/request_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func (ls MockLedgerService) QueryDIDDoc(string) (cheqd.Did, cheqd.Metadata, bool
}
return ls.Did, ls.Metadata, isFound, nil
}

func (ls MockLedgerService) GetNamespaces() []string {
return []string{"testnet", "mainnet"}
}
Expand Down Expand Up @@ -117,5 +118,4 @@ func TestResolve(t *testing.T) {
require.Empty(t, err)
})
}

}
3 changes: 2 additions & 1 deletion types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package types

import (
"encoding/json"
"gopkg.in/yaml.v3"
"time"

"gopkg.in/yaml.v3"
)

type Config struct {
Expand Down
3 changes: 2 additions & 1 deletion utils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package utils

import (
"fmt"
"strings"

"github.com/cheqd/did-resolver/types"
"github.com/spf13/viper"
"strings"
)

func LoadConfig() (types.Config, error) {
Expand Down

0 comments on commit ad12f3e

Please sign in to comment.