tmplfile

package
v0.0.0-...-b91b1e7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2019 License: BSD-2-Clause Imports: 5 Imported by: 0

README

Content to File

Most efficient structure to write a file from some content. No difference between a string and *bytes.Buffer.

src>go test -bench=. ./tofile

Results

go version go1.12 windows/amd64

BenchmarkStringToFile-4             3000            411431 ns/op
BenchmarkBufferToFile-4             3000            423128 ns/op
PASS

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BufferToFile

func BufferToFile(fname string, content *bytes.Buffer) (n int)

func ReadCloserToFileLoop

func ReadCloserToFileLoop(fname string, content io.ReadCloser) (n int)

func ReadCloserToFileOneRead

func ReadCloserToFileOneRead(fname string, content io.ReadCloser) (n int)

func StringToFile

func StringToFile(fname string, content string) (n int)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL