fmt log io/ioutil net/http type: Page func: Page.save
@ -0,0 +1,17 @@
package main
import (
"fmt"
"log"
"io/ioutil"
"net/http"
)
type Page struct {
Title string
Body []byte
}
func (p *Page) save() error {
return ioutil.WriteFile(p.Title + ".txt", p.Body, 0600)