简体   繁体   中英

Gorilla/Mux Reverse mapping URL

I'm new in development. Now trying to learn gorilla/mux router. The question is about reversed urls. In gorilla/mux I know we name them with.Name() method and access with.Url(). Could someone explain real use case of reserved URL's(Reverse mapping URL)? But a few hours of googling didn't help me to find any info about that why we even need them? Will be really thankfull if you could show some practical examples.

Use cases if someone needs.

• Constructing redirects to send to a client - eg programmatically, so you don't have to fix the URLs in your code elsewhere

• Building examples & tests

• Generating docs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM