Skip to content

Jasstkn/link-checker

Repository files navigation

A website link checker

Go Report Card codecov

A linkchecker is a simple CLI tool to find all broken links in your website.

Build

  • with Taskfile

    task build
  • with Go CLI

    go build -o linkchecker cmd/linkchecker/main.go

Test

  • with Taskfile

    task test
    # run all tests with integrational included
    task test-all
  • with Go CLI

    go test ./...

Example of usage

./linkchecker -url https://en.wikipedia.org/
parsed url: https://en.wikipedia.org/
97 links scanned, 0 broken links found

./linkchecker -url https://en.wikipedia-broken.org/
Get "https://en.wikipedia-broken.org/": dial tcp: lookup en.wikipedia-broken.org: no such host

./linkchecker -url https://github.com/Jasstkn/link-checker
13 links scanned, 1 broken link found:
https://github.com/Jasstkn/test-repo.git

Server mode

./linkchecker -server
INFO[0000] starting server

Open localhost:3000 and you will see a simple UI:

UI

With docker image

docker run linkchecker:0.1.1 -url=https://github.com/Jasstkn/link-checker
16 links scanned, 1 broken link found:
https://github.com/Jasstkn/test-repo.git

broken link to test

test broken link