Main project #1

Merged
raul merged 33 commits from testing into main 2024-06-14 07:49:34 +02:00
1 changed files with 2 additions and 2 deletions
Showing only changes of commit 4336c0068b - Show all commits

View File

@ -4,7 +4,6 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"log"
"net/http" "net/http"
) )
@ -30,7 +29,8 @@ func returnWeather(c *gin.Context) {
aemetRequest := root{} aemetRequest := root{}
err = json.Unmarshal(textBytes, &aemetRequest) err = json.Unmarshal(textBytes, &aemetRequest)
if err != nil { if err != nil {
log.Fatalf("Error occurred unmarshalling data: %v\n", err) e := fmt.Sprintf("Error occurred unmarshalling data: %v\n", err)
c.String(http.StatusInternalServerError, e)
} }
c.IndentedJSON(http.StatusOK, aemetRequest) c.IndentedJSON(http.StatusOK, aemetRequest)