當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


GO NewWriter用法及代碼示例

GO語言"mime/quotedprintable"包中"NewWriter"函數的用法及代碼示例。

用法:

func NewWriter(w io.Writer) *Writer

NewWriter 返回一個寫入 w 的新 Writer。

例子:

package main

import (
	"mime/quotedprintable"
	"os"
)

func main() {
	w := quotedprintable.NewWriter(os.Stdout)
	w.Write([]byte("These symbols will be escaped: = \t"))
	w.Close()

}

輸出:

These symbols will be escaped: =3D =09

相關用法


注:本文由純淨天空篩選整理自golang.google.cn大神的英文原創作品 NewWriter。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。