blob: ce34bda1c2cfa8ff1396f350d58b6d13f9d5bb4b [file] [log] [blame]
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build ignore
// Show shows the result of running crawldocs.Split on a single input file.
//
// Usage:
//
// go run show.go file.html
//
// It prints lines that can be pasted into the test table in ../split_test.go.
package main
import (
"fmt"
"log"
"os"
"golang.org/x/oscar/internal/crawldocs"
)
func main() {
data, err := os.ReadFile(os.Args[1])
if err != nil {
log.Fatal(err)
}
for s := range crawldocs.Split(data) {
fmt.Printf("{%q, %q, %q},\n", s.Title, s.ID, s.Text[:min(len(s.Text), 40)])
}
}