Skip to content

Instantly share code, notes, and snippets.

View SemmiDev's full-sized avatar
🎯
Focusing

Sammi Aldhi Yanto SemmiDev

🎯
Focusing
View GitHub Profile
@SemmiDev
SemmiDev / main_test.go
Created July 10, 2023 07:42
url shortener
package main
import (
"bytes"
"net/http"
"net/http/httptest"
"strings"
"testing"
"url-shortener/shortener"
)
@SemmiDev
SemmiDev / shortener_test.go
Created July 10, 2023 07:42
url shortener
package shortener
import (
"sync"
"testing"
)
func TestShorten(t *testing.T) {
var ids []Response
@SemmiDev
SemmiDev / shortener.go
Created July 10, 2023 07:41
url shortener
package shortener
import (
"bytes"
"fmt"
"github.com/bwmarrin/snowflake"
)
const (
base62Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
@SemmiDev
SemmiDev / main.go
Created July 10, 2023 07:40
url shortener
package main
import (
"encoding/json"
"fmt"
"html/template"
"log"
"net/http"
"sync"
package main
import (
"sync"
"testing"
"golang.org/x/exp/slog"
)
func TestMain(m *testing.M) {
package main
import (
"context"
"os"
"sync"
"github.com/google/go-github/v53/github"
"golang.org/x/exp/slog"
"golang.org/x/oauth2"