Categorygithub.com/afeiship/go-reader
repositorypackage
1.0.3
Repository: https://github.com/afeiship/go-reader.git
Documentation: pkg.go.dev

# README

go-reader

File reader for go.

installation

go get -u github.com/afeiship/go-reader

usage

package main

import (
	"fmt"
	"io"
	"github.com/afeiship/go-reader"
)

func main() {
    // type: "file", "http", "base64"
    opts := reader.Options{
        Type: "file",
        Source: "file.txt",
    }
    fileReader, _ := reader.NewReader(&opts)
    data, _ := io.ReadAll(fileReader)
    fmt.Println(string(data))
}