Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
vgonkivs committed Nov 11, 2024
1 parent 414fa5c commit 3829eeb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions nodebuilder/core/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var (
coreRPCFlag = "core.rpc.port"
coreGRPCFlag = "core.grpc.port"
coreTLSPathFlag = "core.grpc.tls.path"
coreXTokenPathFlag = "core.grpc.xtoken.path"
coreXTokenPathFlag = "core.grpc.xtoken.path" //nolint:gosec
)

// Flags gives a set of hardcoded Core flags.
Expand Down Expand Up @@ -43,7 +43,6 @@ func Flags() *flag.FlagSet {
"It should not include file names ('cert.pem' and 'key.pem'). "+
"If left empty, the client will be configured for an insecure (non-TLS) connection",
)

flags.String(
coreXTokenPathFlag,
"",
Expand Down
3 changes: 2 additions & 1 deletion nodebuilder/core/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const (
// It constructs the full paths to the certificate and key files by joining the provided directory path
// with their respective file names.
// If either file is missing, it returns an os.ErrNotExist error.
// If the files exist, it loads the X.509 key pair from the specified files and sets up a tls.Config with a minimum version of TLS 1.2.
// If the files exist, it loads the X.509 key pair from the specified files and sets up a tls.Config
// with a minimum version of TLS 1.2.
// Parameters:
// * tlsPath: The directory path where the TLS certificate ("cert.pem") and key ("key.pem") files are located.
// Returns:
Expand Down
2 changes: 0 additions & 2 deletions nodebuilder/state/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func coreAccessor(
*modfraud.ServiceBreaker[*state.CoreAccessor, *header.ExtendedHeader],
error,
) {

tls, err := core.TLS(corecfg.TLSPath)
if err != nil && !errors.Is(err, os.ErrNotExist) {
return nil, nil, nil, err
Expand All @@ -52,6 +51,5 @@ func coreAccessor(
FraudType: byzantine.BadEncoding,
FraudServ: fraudServ,
}

return ca, ca, sBreaker, err
}
3 changes: 2 additions & 1 deletion state/core_access.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,8 @@ func (ca *CoreAccessor) startGRPCClient(ctx context.Context) error {
req, reply interface{},
cc *grpc.ClientConn,
invoker grpc.UnaryInvoker,
opts ...grpc.CallOption) error {
opts ...grpc.CallOption,
) error {
ctx = metadata.AppendToOutgoingContext(ctx, "x-token", ca.xtoken)
return invoker(ctx, method, req, reply, cc, opts...)
}
Expand Down

0 comments on commit 3829eeb

Please sign in to comment.