Skip to content

Instantly share code, notes, and snippets.

View zachmu's full-sized avatar

Zach Musgrave zachmu

View GitHub Profile
package main
import (
"fmt"
"sync/atomic"
"time"
"github.com/sirupsen/logrus"
)
package scratch3
import (
"errors"
"testing"
)
//go:noinline
func doWorkWithPanic(b *testing.B, n int) {
defer func() {
package main
import (
"fmt"
"io"
"iter"
"math/big"
"math/rand"
)
package main
import (
"log"
"sort"
)
// Interface type used for vars
type Sortable[T comparable] interface {
Less(member T) bool
@zachmu
zachmu / not_found_test.go
Last active June 4, 2024 06:30
Go error handling benchmark
// Copyright 2024 Dolthub, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,