Skip to content

Commit

Permalink
Remove redundant new line
Browse files Browse the repository at this point in the history
  • Loading branch information
puzpuzpuz committed Aug 12, 2024
1 parent 10be3d6 commit 0fca5b6
Showing 1 changed file with 25 additions and 26 deletions.
51 changes: 25 additions & 26 deletions sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,32 +208,6 @@ type lineSenderConfig struct {
autoFlushInterval time.Duration
}

func newLineSenderConfig(t senderType) *lineSenderConfig {
switch t {
case tcpSenderType:
return &lineSenderConfig{
senderType: t,
address: defaultTcpAddress,
initBufSize: defaultInitBufferSize,
fileNameLimit: defaultFileNameLimit,
}
default:
return &lineSenderConfig{
senderType: t,
address: defaultHttpAddress,
requestTimeout: defaultRequestTimeout,
retryTimeout: defaultRetryTimeout,
minThroughput: defaultMinThroughput,
autoFlushRows: defaultAutoFlushRows,
autoFlushInterval: defaultAutoFlushInterval,
initBufSize: defaultInitBufferSize,
maxBufSize: defaultMaxBufferSize,
fileNameLimit: defaultFileNameLimit,
}
}

}

// LineSenderOption defines line sender config option.
type LineSenderOption func(*lineSenderConfig)

Expand Down Expand Up @@ -537,6 +511,31 @@ func NewLineSender(ctx context.Context, opts ...LineSenderOption) (LineSender, e
return newLineSender(ctx, conf)
}

func newLineSenderConfig(t senderType) *lineSenderConfig {
switch t {
case tcpSenderType:
return &lineSenderConfig{
senderType: t,
address: defaultTcpAddress,
initBufSize: defaultInitBufferSize,
fileNameLimit: defaultFileNameLimit,
}
default:
return &lineSenderConfig{
senderType: t,
address: defaultHttpAddress,
requestTimeout: defaultRequestTimeout,
retryTimeout: defaultRetryTimeout,
minThroughput: defaultMinThroughput,
autoFlushRows: defaultAutoFlushRows,
autoFlushInterval: defaultAutoFlushInterval,
initBufSize: defaultInitBufferSize,
maxBufSize: defaultMaxBufferSize,
fileNameLimit: defaultFileNameLimit,
}
}
}

func newLineSender(ctx context.Context, conf *lineSenderConfig) (LineSender, error) {
switch conf.senderType {
case tcpSenderType:
Expand Down

0 comments on commit 0fca5b6

Please sign in to comment.