File: pb_win.go

package info (click to toggle)
golang-pb 0.0~git20131219-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 88 kB
  • ctags: 40
  • sloc: makefile: 7
file content (21 lines) | stat: -rw-r--r-- 337 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// +build windows

package pb

import (
	"syscall"

	"github.com/AllenDang/w32"
)

func bold(str string) string {
	return str
}

func terminalWidth() (int, error) {
	screenBufInfo := w32.GetConsoleScreenBufferInfo(w32.HANDLE(syscall.Stdout))
	if screenBufInfo == nil {
		return 79, nil
	}
	return int(screenBufInfo.DwSize.X) - 1, nil
}