S
S
sos1mple2017-09-11 20:31:13
go
sos1mple, 2017-09-11 20:31:13

How to make an OOP router in Go lang?

Good evening, I have a question about Go Lang.
But here's the problem: the native, built-in router is painfully unfamiliar to me.
I used to do something like this:
www.example.com/class/method/param1/param2
And in Go I have to write everything through functions. Is there any solution here? Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
longclaps, 2017-09-11
@sos1mple

This has already happened: how to start OOP in a procedural language.
You write a preprocessor, and - voila - there was C - it became C ++.

P
Pavel, 2017-09-14
@milast

1) HTTP has normal parameters: example.com/class/method/?param1=a¶m2=b
I don't see any embarrassment at all in using them.
2) There are no other options for working with URLs in Go, and the existing one is quite self-sufficient.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question