Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/songmu/replaceablewriter
https://github.com/songmu/replaceablewriter
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/songmu/replaceablewriter
- Owner: Songmu
- License: mit
- Created: 2019-09-22T16:19:29.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-22T16:19:49.000Z (about 5 years ago)
- Last Synced: 2024-10-11T21:09:29.829Z (27 days ago)
- Language: Go
- Homepage:
- Size: 1.95 KB
- Stars: 13
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
replaceablewriter
=======[![Build Status](https://travis-ci.org/Songmu/replaceablewriter.svg?branch=master)][travis]
[![Coverage Status](https://coveralls.io/repos/Songmu/replaceablewriter/badge.svg?branch=master)][coveralls]
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)][license]
[![GoDoc](https://godoc.org/github.com/Songmu/replaceablewriter?status.svg)][godoc][travis]: https://travis-ci.org/Songmu/replaceablewriter
[coveralls]: https://coveralls.io/r/Songmu/replaceablewriter?branch=master
[license]: https://github.com/Songmu/replaceablewriter/blob/master/LICENSE
[godoc]: https://godoc.org/github.com/Songmu/replaceablewriterreplaceablewriter replace internal io.Writer
## Synopsis
```go
f, _ := os.Open("...")
w := replaceablewriter.New(f)
defer w.Close()
w.Write(...)// replace
f2, _ := os.Open("...")
w.Replace(f2)
w.Write(...)
```## Description
replaceablewriter is a library that keeps io.Wrter inside, provides io.WriteCloser interface,
and allows us to replace internal io.Writer safely.It is useful for log rotation, etc.
## Installation
```console
% go get github.com/Songmu/replaceablewriter
```## Author
[Songmu](https://github.com/Songmu)