Skip to content

Commit

Permalink
chore: fix Go comments in exported functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ccoVeille committed Jan 21, 2025
1 parent 08b4cf8 commit 73e5309
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
1 change: 0 additions & 1 deletion examples/using-add-filestore/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

"gofr.dev/pkg/gofr"
"gofr.dev/pkg/gofr/cmd"
"gofr.dev/pkg/gofr/container"
Expand Down
6 changes: 5 additions & 1 deletion pkg/gofr/datasource/cassandra/cassandra.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (c *Client) UseTracer(tracer any) {
}

// Query is the original method without context, preserved for backward compatibility.
// It internally delegates to QueryWithCtx using context.Background() as the default context.
// It internally delegates to [Client.QueryWithCtx] using context.Background() as the default context.
func (c *Client) Query(dest any, stmt string, values ...any) error {
return c.QueryWithCtx(context.Background(), dest, stmt, values...)
}
Expand All @@ -117,6 +117,8 @@ func (c *Client) NewBatch(name string, batchType int) error {
return c.NewBatchWithCtx(context.Background(), name, batchType)
}

// QueryWithCtx executes a CQL query in the Cassandra database and returns the result.
//
//nolint:exhaustive // We just want to take care of slice and struct in this case.
func (c *Client) QueryWithCtx(ctx context.Context, dest any, stmt string, values ...any) error {
span := c.addTrace(ctx, "query", stmt)
Expand Down Expand Up @@ -175,6 +177,8 @@ func (c *Client) ExecWithCtx(ctx context.Context, stmt string, values ...any) er
return c.cassandra.session.query(stmt, values...).exec()
}

// ExecCASWithCtx executes a CQL query in the Cassandra database and returns the true if the query is applied.
//
//nolint:exhaustive // We just want to take care of slice and struct in this case.
func (c *Client) ExecCASWithCtx(ctx context.Context, dest any, stmt string, values ...any) (bool, error) {
var (
Expand Down
2 changes: 2 additions & 0 deletions pkg/gofr/datasource/dgraph/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ type Txn interface {
}

// DgraphClient is an interface that defines the methods for interacting with Dgraph.
//
//nolint:revive // dgraph.DgraphClient is repetitive. A better name could have been chosen, but it's too late as it's already exported.
type DgraphClient interface {
// NewTxn creates a new transaction (read-write) for interacting with the Dgraph database.
NewTxn() Txn
Expand Down
3 changes: 3 additions & 0 deletions pkg/gofr/datasource/file/s3/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import (
"github.com/aws/aws-sdk-go-v2/service/s3"
)

// S3File represents a file in an S3 bucket.
//
//nolint:revive // s3.S3File is repetitive. A better name could have been chosen, but it's too late as it's already exported.
type S3File struct {
conn s3Client
name string
Expand Down
2 changes: 1 addition & 1 deletion pkg/gofr/datasource/mongo/mongo.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ i.e. by default observability features gets initialized when used with GoFr.
// client.UseLogger(loggerInstance)
// client.UseMetrics(metricsInstance)
// client.Connect().

//
//nolint:gocritic // Configs do not need to be passed by reference
func New(c Config) *Client {
return &Client{config: &c}
Expand Down
2 changes: 1 addition & 1 deletion pkg/gofr/datasource/scylladb/scylladb.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type Config struct {
Password string
}

// Scylladb represents the connection and operations context for interacting with a ScyllaDB cluster,
// ScyllaDB represents the connection and operations context for interacting with a ScyllaDB cluster,
// including configuration, active session, query handling, and initialized batches.
type ScyllaDB struct {
clusterConfig clusterConfig
Expand Down

0 comments on commit 73e5309

Please sign in to comment.