RuleMembers

Go net/http REST API Cursor rules

This Cursor rule file tells the assistant to build REST APIs in Go using only the standard library, with net/http and the ServeMux router from Go 1.22 or newer. It is for Go developers who want complete, secure API code without third-party frameworks.

What it does

Cursor first describes the API structure, endpoints and data flow in pseudocode, confirms the plan, then writes code. Code must handle errors with custom types where useful, return correct status codes and JSON, validate input, log with the log package, use middleware for logging and auth, and leave no TODOs or placeholders.

How to use it

Describe the endpoints you need; it applies across the project.

Requirements and limits

If Cursor is unsure of a best practice, the rule tells it to say so rather than guess.

More in Rules and the Cursor library.

The full text is in the members library

Book a call and we will give you access to the full Cursor library: every entry in full, search by meaning, copy and download.

Source and license

Source: https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/go-servemux-rest-api-cursorrules-prompt-file.mdc

Author: PatrickJS, Awesome cursorrules. License: CC0-1.0.

Related entries