
Gongular – A new web framework for Go - CSDude
https://github.com/mustafaakin/gongular
======
zalmoxes
I'm sorry, but does anyone even glance at the source of these frameworks
before they're upvoted?

~~~
cyri
I've withdrawn my upvote after I saw this in the code:

    
    
      type Injector struct {
        values          map[reflect.Type]interface{}
        customProviders map[reflect.Type]CustomProvideFunction
      }

~~~
komali2
I don't understand, what's wrong with that? I've never used Go so I'm asking
out of ignorance.

~~~
CSDude
It is not type safe and relies on runtime reflection based checks to make it
work correctly, it can crash easily. However, I believe I made all the checks
correctly and it should work as intended, but of course it is only 600 LOC,
there can arise some issues.

------
nemothekid
This feels very similar to Martini ([https://github.com/go-
martini/martini](https://github.com/go-martini/martini)).

Martini had a similar sort of design (and IMO a cleaner source code), but the
author decided that reflection and non-idoimatic design was too much of a cost
for the HTTP framework in Go. I think 2 years ago when Martini was released
people were more open to reflection, but now I'm interested/doubtful if
something like this can be accepted.

Funnily enough, I think Gin-Gonic was inspired by Martini, but Gin-Gonic
eschewed reflection in favor of performance/idiomatic design. The fact that
this project considers Gin Gonic an inspiration is funny.

------
nonsince
This thread is very negative, and I personally dislike runtime reflection so I
wouldn't use this framework in its current design, but don't let the
commentors get you down. I assume that you want to just show off something
interesting you made, whereas they are looking for something high-enough
quality to use in their next project - and a brand-new framework is never
going to be that. It's just a mismatch in aims. Keep up the good work, I can
appreciate that writing the kind of dependency injection framework often seen
in large systems in such a small amount of code is an admirable feat.

~~~
CSDude
Thank you, my thoughts precisely. It was just to show another approach.

------
yumaikas
Looking at this, it looks like a very minimal, reflection heavy framework.
While that's not necessarily the wrong set of choices to make, trying to turn
Go into a DSL-type language always feels a little strange. Still, kudos to the
authors for putting up something nifty in under 1kLoc (excluding tests).

~~~
the_duke
Reflection is also notoriously slow in Go.

------
yumaikas
Godoc link for those who want to look closer at it:
[https://godoc.org/github.com/mustafaakin/gongular](https://godoc.org/github.com/mustafaakin/gongular)

------
neom
Related: [https://github.com/go-martini/martini](https://github.com/go-
martini/martini) (NOTE: The martini framework is no longer maintained.)

~~~
_ttg
also related - [https://codegangsta.io/blog/2014/05/19/my-thoughts-on-
martin...](https://codegangsta.io/blog/2014/05/19/my-thoughts-on-martini/)

Martini also relied heavily on DI and reflection for convenience and the
author basically conceded that this was not idiomatic.

~~~
camus2
> Martini also relied heavily on DI and reflection for convenience and the
> author basically conceded that this was not idiomatic.

More like he was bullied into conceding that.

------
jrs95
>features Angular-like (or Spring like) dependency injection

 _closes tab_

------
camus2
> haha...that name is hideous

> please.. make it stop..

> closes tab

Look at this sorry thread, the usual open source project bashing going on in
the Go community, pathetic, but business as usual in the Go community. The Go
community is truly irredeemable and one of the most mean spirited and hateful
programming community out there.

~~~
jrs95
Because calling an entire programming language's community irredeemable, mean
spirited, and hateful is reasonable.

There's a reason for the negative comments, and it's that the paradigm of this
framework runs against what would be considered idiomatic Go. Spring/Angular
style DI is one of the things people use Go to avoid. This is like someone
making a library to do goto statements in Java (not as bad of course, just
pointing out the conflicting paradigms).

------
choward
How is this even remotely related to Angular?

~~~
d0lph
"It is like Gin Gonic, but it features Angular-like (or Spring like)
dependency injection and better input handling."

------
_ttg
haha...that name is hideous

~~~
hitekker
Better than Testacular:

[https://testing.googleblog.com/2012/11/testacular-
spectacula...](https://testing.googleblog.com/2012/11/testacular-spectacular-
test-runner-for.html)

[https://github.com/karma-runner/karma/issues/376](https://github.com/karma-
runner/karma/issues/376)

~~~
joeblau
Holy crap I can't. stop. laughing.

~~~
komali2
People in that thread are arguing about exclusion, sexism, etc, but a simple
enough reason to change the name is "I can't say I'm using this library in
front of the investors and keep a straight face."

------
UseYrIllusion11
in b4 stdlib is better than this framework.

~~~
jrs95
stdlib _is_ better than this framework.

