1
0
mirror of https://github.com/IBM/fp-go.git synced 2026-03-08 13:29:18 +02:00

Compare commits

..

3 Commits

Author SHA1 Message Date
Dr. Carsten Leue
2ce406a410 fix: add context7 badge
Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
2026-03-06 15:03:05 +01:00
Dr. Carsten Leue
3743361b9f fix: context7 at correct location
Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
2026-03-06 14:41:47 +01:00
Dr. Carsten Leue
69d11f0a4b fix: claim context7
Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
2026-03-06 14:39:58 +01:00
3 changed files with 6 additions and 0 deletions

4
context7.json Normal file
View File

@@ -0,0 +1,4 @@
{
"url": "https://context7.com/ibm/fp-go",
"public_key": "pk_7wJdJRn8zGHxvIYu7eh9h"
}

View File

@@ -3,6 +3,7 @@
[![Go Reference](https://pkg.go.dev/badge/github.com/IBM/fp-go/v2.svg)](https://pkg.go.dev/github.com/IBM/fp-go/v2)
[![Coverage Status](https://coveralls.io/repos/github/IBM/fp-go/badge.svg?branch=main&flag=v2)](https://coveralls.io/github/IBM/fp-go?branch=main)
[![Go Report Card](https://goreportcard.com/badge/github.com/IBM/fp-go/v2)](https://goreportcard.com/report/github.com/IBM/fp-go/v2)
[![Context7](https://img.shields.io/badge/context7-docs-blue)](https://context7.com/ibm/fp-go)
**fp-go** is a comprehensive functional programming library for Go, bringing type-safe functional patterns inspired by [fp-ts](https://gcanti.github.io/fp-ts/) to the Go ecosystem. Version 2 leverages [generic type aliases](https://github.com/golang/go/issues/46477) introduced in Go 1.24, providing a more ergonomic and streamlined API.

View File

@@ -128,6 +128,7 @@ var loggerInContextKey loggerInContextType
// logger.Info("Processing request")
// }
func GetLoggerFromContext(ctx context.Context) *slog.Logger {
// using idomatic style to avoid import cycle
value, ok := ctx.Value(loggerInContextKey).(*slog.Logger)
if !ok {
return globalLogger.Load()