From 3cf660b0c45c47c40979d66c65e6d5fe20dc4e69 Mon Sep 17 00:00:00 2001 From: namhq1989 Date: Thu, 15 Dec 2022 14:18:01 +0700 Subject: [PATCH] change config.env to config.servername --- config.go | 8 ++++---- sentry_echo.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config.go b/config.go index 60c2861..14d0953 100644 --- a/config.go +++ b/config.go @@ -3,8 +3,8 @@ package sentry import "errors" type Config struct { - Dsn string - Env string + Dsn string + ServerName string } func (c Config) validate() error { @@ -12,8 +12,8 @@ func (c Config) validate() error { return errors.New("sentry DNS is required") } - if c.Env == "" { - return errors.New("sentry ENV is required") + if c.ServerName == "" { + return errors.New("sentry SERVER_NAME is required") } return nil diff --git a/sentry_echo.go b/sentry_echo.go index deda830..ba51ef1 100644 --- a/sentry_echo.go +++ b/sentry_echo.go @@ -15,8 +15,8 @@ func WithEcho(e *echo.Echo, cfg Config) error { } if err := sentry.Init(sentry.ClientOptions{ - Dsn: cfg.Dsn, - Environment: cfg.Env, + Dsn: cfg.Dsn, + ServerName: cfg.ServerName, }); err != nil { fmt.Printf("[sentry] initialization failed: %s \n", err.Error()) return err