Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadnaufal committed Oct 24, 2024
1 parent c3fbafb commit 1f8ac98
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
3 changes: 2 additions & 1 deletion ext/scheduler/airflow/bucket/oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import (

"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss"
"github.com/aliyun/alibabacloud-oss-go-sdk-v2/oss/credentials"
"go.opentelemetry.io/otel"

"github.com/goto/optimus/core/tenant"
"github.com/goto/optimus/ext/scheduler/airflow"
"github.com/goto/optimus/ext/scheduler/airflow/bucket/ossblob"
"go.opentelemetry.io/otel"
)

type ossCredentials struct {
Expand Down
16 changes: 7 additions & 9 deletions ext/scheduler/airflow/bucket/ossblob/ossblob.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,14 @@ func (r *ossReader) As(i interface{}) bool {

// Attributes implements driver.Reader.Attributes.
// For now this will return no attributes
func (r *ossReader) Attributes() *driver.ReaderAttributes {
func (*ossReader) Attributes() *driver.ReaderAttributes {
return &driver.ReaderAttributes{}
}

// ossWriter is an implementation of driver.Writer for OSS.
// pipereader & pipewriter is used so that a stream-like write can be done using
// OSS PutObject API.
type ossWriter struct {
ctx context.Context
req oss.PutObjectRequest
pr *io.PipeReader
pw *io.PipeWriter
Expand Down Expand Up @@ -97,7 +96,7 @@ func (b *ossBucket) As(i interface{}) bool {
return true
}

func (b *ossBucket) ErrorCode(err error) gcerrors.ErrorCode {
func (*ossBucket) ErrorCode(err error) gcerrors.ErrorCode {
if ossErr, ok := err.(*oss.ServiceError); ok {
switch ossErr.StatusCode {
case http.StatusNotFound:
Expand All @@ -115,7 +114,7 @@ func (b *ossBucket) ErrorCode(err error) gcerrors.ErrorCode {
return gcerrors.Internal
}

func (b *ossBucket) ErrorAs(err error, target interface{}) bool {
func (*ossBucket) ErrorAs(err error, target interface{}) bool {
switch ossErr := err.(type) {
case *oss.ServiceError:
if p, ok := target.(**oss.ServiceError); ok {
Expand Down Expand Up @@ -211,7 +210,7 @@ func (b *ossBucket) ListPaged(ctx context.Context, opts *driver.ListOptions) (*d
return page, nil
}

func (b *ossBucket) NewRangeReader(ctx context.Context, key string, offset, length int64, opts *driver.ReaderOptions) (driver.Reader, error) {
func (b *ossBucket) NewRangeReader(ctx context.Context, key string, offset, length int64, _ *driver.ReaderOptions) (driver.Reader, error) {
request := oss.GetObjectRequest{
Bucket: &b.bucket,
Key: &key,
Expand Down Expand Up @@ -254,7 +253,7 @@ func (b *ossBucket) NewRangeReader(ctx context.Context, key string, offset, leng
}

// NewTypedWriter implements driver.NewTypedWriter.
func (b *ossBucket) NewTypedWriter(ctx context.Context, key string, contentType string, opts *driver.WriterOptions) (driver.Writer, error) {
func (b *ossBucket) NewTypedWriter(ctx context.Context, key, contentType string, opts *driver.WriterOptions) (driver.Writer, error) {
pr, pw := io.Pipe()
req := oss.PutObjectRequest{
Bucket: &b.bucket,
Expand All @@ -280,7 +279,6 @@ func (b *ossBucket) NewTypedWriter(ctx context.Context, key string, contentType
}

w := &ossWriter{
ctx: ctx,
req: req,
pr: pr,
pw: pw,
Expand Down Expand Up @@ -341,7 +339,7 @@ func (b *ossBucket) Attributes(ctx context.Context, key string) (*driver.Attribu
}

// Close implements driver.Close.
func (b *ossBucket) Close() error {
func (ossBucket) Close() error {
return nil
}

Expand All @@ -359,7 +357,7 @@ func (b *ossBucket) SignedURL(ctx context.Context, key string, opts *driver.Sign
}

// Copy implements driver.Copy
func (b *ossBucket) Copy(ctx context.Context, dstKey, srcKey string, opts *driver.CopyOptions) error {
func (b *ossBucket) Copy(ctx context.Context, dstKey, srcKey string, _ *driver.CopyOptions) error {
copier := oss.NewCopier(b.client)
_, err := copier.Copy(ctx, &oss.CopyObjectRequest{
Bucket: &b.bucket,
Expand Down

0 comments on commit 1f8ac98

Please sign in to comment.