Skip to content

Commit

Permalink
Removing logging
Browse files Browse the repository at this point in the history
  • Loading branch information
COMTOP1 committed Nov 19, 2024
1 parent 1bad0d5 commit 882e7ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 2 additions & 3 deletions link/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package link
import (
"encoding/json"
"fmt"
"log"
"os"
"strings"

Expand Down Expand Up @@ -43,17 +44,15 @@ type (
func New() (*Link, error) {
err := godotenv.Load()
if err != nil {
fmt.Printf("error loading .env file: %+v\n", err)
log.Printf("error loading .env file: %+v, continuing", err)
}

link := os.Getenv("LINK_JSON")
if len(link) == 0 {
return nil, fmt.Errorf("LINK_JSON environment variable cannot be found")
}

fmt.Println(link)
link = strings.ReplaceAll(link, "~", "\"")
fmt.Println(link)

var data *Link
err = json.Unmarshal([]byte(link), &data)
Expand Down
8 changes: 3 additions & 5 deletions team/team.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package team
import (
"encoding/json"
"fmt"
"log"
"os"
"strings"

Expand All @@ -19,18 +20,15 @@ type (
func New() (*[]Member, error) {
err := godotenv.Load()
if err != nil {
fmt.Printf("error loading .env file: %+v\n", err)
log.Printf("error loading .env file: %+v, continuing", err)
}

team := os.Getenv("TEAM_JSON")
if len(team) == 0 {
fmt.Println("TEAM_JSON environment variable not set")
//return nil, fmt.Errorf("TEAM_JSON environment variable cannot be found")
return nil, fmt.Errorf("TEAM_JSON environment variable cannot be found")
}

fmt.Println(team)
team = strings.ReplaceAll(team, "~", "\"")
fmt.Println(team)

var data *[]Member
err = json.Unmarshal([]byte(team), &data)
Expand Down

0 comments on commit 882e7ce

Please sign in to comment.