Skip to content

os,os/signal: documentation issue with Notify(), syscall.SIGTERM, and CTRL_CLOSE_EVENT/CTRL_LOGOFF_EVENT/CTRL_SHUTDOWN_EVENT #69847

@ucirello

Description

@ucirello

Go version

go1.23

Output of go env in your module/workspace:

Not applicable

What did you do?

I am trying to understand how Go handles signals on Windows.

What did you see happen?

When I read https://pkg.go.dev/os/signal?GOOS=windows#hdr-Windows, I see:

Additionally, if Notify is called, and Windows sends CTRL_CLOSE_EVENT, CTRL_LOGOFF_EVENT or CTRL_SHUTDOWN_EVENT to the process, Notify will return syscall.SIGTERM

However, in https://pkg.go.dev/syscall?GOOS=windows there is no syscall.SIGTERM.

What did you expect to see?

Probably, the documentation meant me to use https://pkg.go.dev/golang.org/x/sys/windows.

I would expect the os/signal to indicate that I should look for the package described above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgecompiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions