Skip to content

Commit

Permalink
Pull out os.getenv
Browse files Browse the repository at this point in the history
  • Loading branch information
Excaleo committed Jan 9, 2024
1 parent ea3c4aa commit 070897c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion cmd/lambda-extension/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

"github.com/atlassian/gostatsd"
"github.com/atlassian/gostatsd/internal/awslambda/extension"
"github.com/atlassian/gostatsd/internal/awslambda/extension/api"
"github.com/atlassian/gostatsd/internal/util"
"github.com/atlassian/gostatsd/pkg/statsd"
"github.com/atlassian/gostatsd/pkg/transport"
Expand Down Expand Up @@ -125,7 +126,7 @@ func main() {
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
defer cancel()

manager := extension.NewManager(conf.GetString(ParamLambdaFileName), log)
manager := extension.NewManager(os.Getenv(api.EnvLambdaAPIHostname), conf.GetString(ParamLambdaFileName), log)

server, err := CreateServer(conf, log)
if err != nil {
Expand Down
5 changes: 2 additions & 3 deletions internal/awslambda/extension/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"io"
"net/http"
"os"
"runtime/debug"
"strings"
"time"
Expand Down Expand Up @@ -55,11 +54,11 @@ type manager struct {

var _ Manager = (*manager)(nil)

func NewManager(lambdaFileName string, log logrus.FieldLogger) Manager {
func NewManager(lambdaDomain string, lambdaFileName string, log logrus.FieldLogger) Manager {
m := &manager{
log: log,
client: &http.Client{},
domain: os.Getenv(api.EnvLambdaAPIHostname),
domain: lambdaDomain,
name: lambdaFileName,
}

Expand Down

0 comments on commit 070897c

Please sign in to comment.