Skip to content
sigkilledPublic

About

No description or website provided.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Windisk

Windisk is a tiny library to retrieve disk info such as serial number, product id, vendor id, etc... It uses winapi so no need to install external dependencies.

Usage

windisk.GetDiskInfo() returns DeviceInfo struct which is;

type DeviceInfo struct {
	SerialNumber     string
	IsRemovableMedia bool
	VendorID         string
	ProductID        string
	ProductRevision  string
	BusType          bustype.BusType
}
package main

import (
	"fmt"
	"log"
	"os"
	"os/signal"
	"path/filepath"

	"github.com/sigkilled/windisk"
)

func main() {
	volumeName := filepath.VolumeName(os.Args[0])
	di, err := windisk.GetDiskInfo("\\\\.\\" + volumeName)
	if err != nil {
		log.Fatalln(err)
	}
	fmt.Printf("%+v\n", di)
	c := make(chan os.Signal)
	signal.Notify(c, os.Interrupt)
	<-c
}

About

No description or website provided.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages