Skip to content

Commit

Permalink
moe betta
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-pmillz committed Sep 5, 2024
1 parent 55f3590 commit b315a3e
Show file tree
Hide file tree
Showing 4 changed files with 331 additions and 205 deletions.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,32 @@ package main
import (
"fmt"
"github.com/mr-pmillz/eoldate"
"log"
)

func main() {
client := eoldate.NewClient(eoldate.EOLBaseURL)
releaseVersions, err := client.GetProduct("php")
client := eoldate.NewClient()
products, err := client.GetProduct("php")
if err != nil {
panic(err)
log.Fatalf("Error fetching product data: %v", err)
}
fmt.Println(releaseVersions)

versionToCheck := 7.4

for _, product := range products {
supported, err := product.IsVersionSupported(versionToCheck)
if err != nil {
continue
}

if supported {
fmt.Printf("PHP %.1f is still supported\n", versionToCheck)
} else {
fmt.Printf("PHP %.1f is no longer supported\n", versionToCheck)
}
return // Exit after finding the matching cycle
}

fmt.Printf("PHP %.1f was not found in any product cycle\n", versionToCheck)
}
```
Loading

0 comments on commit b315a3e

Please sign in to comment.