~fkfd/sophon

57f9e6c27ffbb706b223d12a4648ec0166665223 — Frederick Yin 3 years ago c7bea98
Subsequent diffs are concatenated
1 files changed, 4 insertions(+), 1 deletions(-)

M wiki.go
M wiki.go => wiki.go +4 -1
@@ 146,10 146,13 @@ func receiveDiff(id, diff string) error {
		return err
	}
	// log diff
	err = ioutil.WriteFile("sessions/"+id+"/DIFF", []byte(diff+"\n"), os.ModeAppend)
	diffFile, err := os.OpenFile("sessions/"+id+"/DIFF", os.O_APPEND|os.O_WRONLY|os.O_CREATE, filePerm)
	if err != nil {
		return err
	}
	diffFile.WriteString(diff + "\n")
	diffFile.Close()

	// update stage
	err = ioutil.WriteFile("sessions/"+id+"/STAGE", []byte(stage), 0644)
	if err != nil {