1 // Copyright 2016 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
8 "internal/syscall/windows"
12 func getModuleFileName(handle syscall
.Handle
) (string, error
) {
16 buf
= make([]uint16, n
)
17 r
, err
:= windows
.GetModuleFileName(handle
, &buf
[0], n
)
24 // r == n means n not big enough
27 return syscall
.UTF16ToString(buf
), nil
30 func executable() (string, error
) {
31 return getModuleFileName(0)