zmb3 / godoc

Deprecated - use https://atom.io/packages/go-plus instead
MIT License
3 stars 1 forks source link

Godoc must not show private fields in structs. #38

Closed vagruchi closed 8 years ago

vagruchi commented 8 years ago

godoc version 1.1.0 Use it to show documentation for github.com/go-gl/glfw/v3.2/glfw.Window. Output is:

type Window struct {
data *_Ctype_struct_GLFWwindow

    fPosHolder             func(w *Window, xpos int, ypos int)
    fSizeHolder            func(w *Window, width int, height int)
    fFramebufferSizeHolder func(w *Window, width int, height int)
    fCloseHolder           func(w *Window)
    fRefreshHolder         func(w *Window)
    fFocusHolder           func(w *Window, focused bool)
    fIconifyHolder         func(w *Window, iconified bool)

    fMouseButtonHolder func(w *Window, button MouseButton, action Action, mod ModifierKey)
    fCursorPosHolder   func(w *Window, xpos float64, ypos float64)
    fCursorEnterHolder func(w *Window, entered bool)
    fScrollHolder      func(w *Window, xoff float64, yoff float64)
    fKeyHolder         func(w *Window, key Key, scancode int, action Action, mods ModifierKey)
    fCharHolder        func(w *Window, char rune)
    fCharModsHolder    func(w *Window, char rune, mods ModifierKey)
    fDropHolder        func(w *Window, names []string)
        } 
Undocumented.

I think there are must be like in std go doc:

type` Window struct {
    // Has unexported fields.
}

func CreateWindow(width, height int, title string, monitor *Monitor, share *Window) (*Window, error)
func GetCurrentContext() *Window
func (w *Window) Destroy()
func (w *Window) Focus() error
func (w *Window) GetAttrib(attrib Hint) int
func (w *Window) GetClipboardString() (string, error)
func (w *Window) GetCursorPos() (x, y float64)
func (w *Window) GetFrameSize() (left, top, right, bottom int)
func (w *Window) GetFramebufferSize() (width, height int)
func (w *Window) GetGLXContext() C.GLXContext
func (w *Window) GetGLXWindow() C.GLXWindow
func (w *Window) GetInputMode(mode InputMode) int
func (w *Window) GetKey(key Key) Action
func (w *Window) GetMonitor() *Monitor
func (w *Window) GetMouseButton(button MouseButton) Action
func (w *Window) GetPos() (x, y int)
func (w *Window) GetSize() (width, height int)
func (w *Window) GetUserPointer() unsafe.Pointer
func (w *Window) GetX11Window() C.Window
func (w *Window) Hide()
func (w *Window) Iconify() error
func (w *Window) MakeContextCurrent()
func (w *Window) Maximize() error
func (w *Window) Restore() error
func (w *Window) SetAspectRatio(numer, denom int)
func (w *Window) SetCharCallback(cbfun CharCallback) (previous CharCallback)
func (w *Window) SetCharModsCallback(cbfun CharModsCallback) (previous CharModsCallback)
func (w *Window) SetClipboardString(str string)
func (w *Window) SetCloseCallback(cbfun CloseCallback) (previous CloseCallback)
func (w *Window) SetCursor(c *Cursor)
func (w *Window) SetCursorEnterCallback(cbfun CursorEnterCallback) (previous CursorEnterCallback)
func (w *Window) SetCursorPos(xpos, ypos float64)
func (w *Window) SetCursorPosCallback(cbfun CursorPosCallback) (previous CursorPosCallback)
func (w *Window) SetDropCallback(cbfun DropCallback) (previous DropCallback)
func (w *Window) SetFocusCallback(cbfun FocusCallback) (previous FocusCallback)
func (w *Window) SetFramebufferSizeCallback(cbfun FramebufferSizeCallback) (previous FramebufferSizeCallback)
func (w *Window) SetIcon(images []image.Image)
func (w *Window) SetIconifyCallback(cbfun IconifyCallback) (previous IconifyCallback)
func (w *Window) SetInputMode(mode InputMode, value int)
func (w *Window) SetKeyCallback(cbfun KeyCallback) (previous KeyCallback)
func (w *Window) SetMonitor(monitor *Monitor, xpos, ypos, width, height, refreshRate int)
func (w *Window) SetMouseButtonCallback(cbfun MouseButtonCallback) (previous MouseButtonCallback)
func (w *Window) SetPos(xpos, ypos int)
func (w *Window) SetPosCallback(cbfun PosCallback) (previous PosCallback)
func (w *Window) SetRefreshCallback(cbfun RefreshCallback) (previous RefreshCallback)
func (w *Window) SetScrollCallback(cbfun ScrollCallback) (previous ScrollCallback)
func (w *Window) SetShouldClose(value bool)
func (w *Window) SetSize(width, height int)
func (w *Window) SetSizeCallback(cbfun SizeCallback) (previous SizeCallback)
func (w *Window) SetSizeLimits(minw, minh, maxw, maxh int)
func (w *Window) SetTitle(title string)
func (w *Window) SetUserPointer(pointer unsafe.Pointer)
func (w *Window) ShouldClose() bool
func (w *Window) Show()
func (w *Window) SwapBuffers()
zmb3 commented 8 years ago

Thanks for the suggestion. I updated the gogetdoc tool to hide unexported fields by default. https://github.com/zmb3/gogetdoc/commit/5addbdbb1f22fdc8f7904c6748c4d997ab1eeb8a

You don't need to update the Atom package to get these changes. Simply run golang:update tools from the command palette to fetch the latest version of gogetdoc.