Commit: 14afbcf00b6f2e3dd0ec96955903e7020b4cbb81 Parent: c73d7387a8f5fbd762716132c836326f96c27158 Author: Vi Grey Date: 2023-11-21 07:47 UTC Summary: Fix accidental double print of directory lines gopher-server/gopher-server.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/gopher-server/gopher-server.go b/gopher-server/gopher-server.go index 6f91dea..a28b412 100644 --- a/gopher-server/gopher-server.go +++ b/gopher-server/gopher-server.go @@ -123,8 +123,6 @@ func sendGeneratedGophermap(reqPath string, conn net.Conn) { // Add "/" to end of file name to show it's a directory itemType = "1" p = filepath.Join(p) + "/" - conn.Write([]byte(fmt.Sprintf("1%s\t%s\t%s\t%d\r\n", - filepath.Join(p)+"/", filename, HOST, port))) case strings.Contains(mimeType, "image/"): // Path is an image if strings.Contains(mimeType, "image/gif") { @@ -136,7 +134,6 @@ func sendGeneratedGophermap(reqPath string, conn net.Conn) { // Path is audio itemType = "s" } - // so line is txt file line conn.Write([]byte(fmt.Sprintf("%s%s\t%s\t%s\t%d\r\n", itemType, p, filename, HOST, port))) }