You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: diskmg.go
    path of file: ./repos/arozos/src/mod/disk/diskmg
    
    the code of the file until where you have to start completion: package diskmg

import (
	"encoding/json"
	"errors"
	"log"
	"net/http"
	"os/exec"
	"path/filepath"
	"regexp"
	"runtime"
	"strings"
	"time"

	db "imuslab.com/arozos/mod/database"
	fs "imuslab.com/arozos/mod/filesystem"
	"imuslab.com/arozos/mod/utils"
)

type Lsblk struct {
	Blockdevices []struct {
		Name       string      `json:"name"`
		MajMin     string      `json:"maj:min"`
		Rm         bool        `json:"rm"`
		Size       int64       `json:"size"`
		Ro         bool        `json:"ro"`
		Type       string      `json:"type"`
		Mountpoint interface{} `json:"mountpoint"`
		Children   []struct {
			Name       string `json:"name"`
			MajMin     string `json:"maj:min"`
			Rm         bool   `json:"rm"`
			Size       int64  `json:"size"`
			Ro         bool   `json:"ro"`
			Type       string `json:"type"`
			Mountpoint string `json:"mountpoint"`
		} `json:"children"`
	} `json:"blockdevices"`
}

type LsblkF struct {
	Blockdevices []struct {
		Name       string      `json:"name"`
		Fstype     interface{} `json:"fstype"`
		Label      interface{} `json:"label"`
		UUID       interface{} `json:"uuid"`
		Fsavail    interface{} `json:"fsavail"`
		Fsuse      interface{} `json:"fsuse%"`
		Mountpoint interface{} `json:"mountpoint"`
		Children   []struct {
			Name       string      `json:"name"`
			Fstype     string      `json:"fstype"`
			Label      interface{} `json:"label"`
			UUID       string      `json:"uuid"`
			Fsavail    string      `json:"fsavail"`
			Fsuse      string      `json:"fsuse%"`
    
func HandleView(w http.ResponseWriter, r *http.Request) {
	partition, _ := utils.GetPara(r, "partition")
	detailMode := (partition != "")
	if runtime.GOOS == "windows" {
		//Windows. Use DiskmgWin binary
		if utils.FileExists("./system/disk/diskmg/DiskmgWin.exe") {
			out := ""
			if detailMode {
				cmd := exec.Command("./system/disk/diskmg/DiskmgWin.exe", "-d")
				o, err := cmd.CombinedOutput()
				if err != nil {
					utils.SendErrorResponse(w, "Permission Denied")
					return
				}
				out = string(o)
			} else {
				cmd := exec.Command("./system/disk/diskmg/DiskmgWin.exe")
				o, err := cmd.CombinedOutput()
				if err != nil {
					utils.SendErrorResponse(w, "Permission Denied")
					return
				}
				out = string(o)
			}

			out = strings.TrimSpace(out)
			lines := strings.Split(out, ";")

			results := [][]string{}
			for _, line := range lines {
				data := strings.Split(line, ",")
				if len(data) > 0 && data[0] != "" {
					results = append(results, data)
				}

			}

			js, _ := json.Marshal(results)
			utils.SendJSONResponse(w, string(js))

		} else {
			log.Println("system/disk/diskmg/DiskmgWin.exe NOT FOUND. Unable to load Window's disk information")
			utils.SendErrorResponse(w, "DiskmgWin.exe not found")
			return
		}

	} else {
		//Linux. Use lsblk and df to check volume info
		partition := new(Lsblk)
		format := new(LsblkF)
		df := ""

		//Get partition information
		cmd := exec.Command("lsblk", "-b", "--json")
		o, err := cmd.CombinedOutput()
		if err != nil {
			utils.SendErrorResponse(w, err.Error())
			return
		}
		err = json.Unmarshal(o, &partition)
		if err != nil {
			utils.SendErrorResponse(w, err.Error())
			return
		}

		//Get format info
		cmd = exec.Command("lsblk", "-f", "-b", "--json")
		o, err = cmd.CombinedOutput()
		if err != nil {
			utils.SendErrorResponse(w, err.Error())
			return
		}
		err = json.Unmarshal(o, &format)
		if err != nil {
			utils.SendErrorResponse(w, err.Error())
			return
		}

		//Get df info
		cmd = exec.Command("df")
		o, err = cmd.CombinedOutput()
		if err != nil {
			utils.SendErrorResponse(w, err.Error())
			return
		}

		df = string(o)

		//Filter the df information
		for strings.Contains(df, "  ") {
			df = strings.ReplaceAll(df, "  ", " ")
		}

		dflines := strings.Split(df, "\n")
		parsedDf := [][]string{}
		for _, line := range dflines {
			linedata := strings.Split(line, " ")
			parsedDf = append(parsedDf, linedata)
		}

		//Throw away the table header
		parsedDf = parsedDf[1:]

		js, _ := json.Marshal([]interface{}{
			partition,
			format,
			parsedDf,
		})

		utils.SendJSONResponse(w, string(js))
	}
}