This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://pkg.go.dev/golang.org/x/exp/slog | |
func main() { | |
options := slog.HandlerOptions{ | |
AddSource: true, | |
ReplaceAttr: func(a slog.Attr) slog.Attr { | |
if a.Key != "source" { | |
return a | |
} | |
fields := strings.Split(a.Value.String(), ":") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Slice struct { | |
Data []int | |
Length int | |
Capacity int | |
} | |
func Insert(record *Slice, position int, value int) { | |
capacity := record.Length + 1 | |
if position > capacity { | |
capacity = position |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"net/http" | |
"os" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/csv" | |
"encoding/json" | |
"io" | |
"log" | |
"net/http" | |
"os" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
type ( | |
MyFirstEvent struct{ AccountID uint64 } | |
MySecondEvent struct{ AccountID uint64 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"strconv" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Package funcy info: github.com/mdwhatcott/funcy@v0.1.0 (a little copy-paste is better than a little dependency) | |
// AUTO-GENERATED: 2022-12-29 03:18:09.371452 -0700 MST m=+0.000761384 | |
package funcy | |
// FILE: funcy.go | |
func Complement[T any](predicate func(t T) bool) func(t T) bool { | |
return func(t T) bool { return !predicate(t) } | |
} | |
func Remove[T any](predicate func(t T) bool, values []T) []T { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Package should info: github.com/mdwhatcott/testing@v0.19.0 (a little copy-paste is better than a little dependency) | |
// AUTO-GENERATED: 2022-12-27 23:56:46.913568 -0700 MST m=+0.004900728 | |
package should | |
import ( | |
"errors" | |
"fmt" | |
"log" | |
"math" | |
"reflect" |
NewerOlder