Serve a mp3 file with golang through websocket [closed]

Solution for Serve a mp3 file with golang through websocket [closed]
is Given Below:

I want to serve a file from an websocket connection with golang.
can i send the file like this:

{type:"file_manage",information:"file.mp3"} ?

Just read file, and send by websocket.

package main

import (
    "fmt"
    "net/http"
    "os"

    "golang.org/x/net/websocket"
)

func EchoServer(ws *websocket.Conn) {
    file, _ := os.ReadFile("a.txt")
    n, err := ws.Write(file)
    if err != nil {
        fmt.Println(err)
    }
    fmt.Println(n, "bytes written")
}

func main() {
    http.Handle("/ws", websocket.Handler(EchoServer))
    err := http.ListenAndServe(":12345", nil)
    if err != nil {
        panic("ListenAndServe: " + err.Error())
    }
}