Re: [go-nuts] Will Go be discontinued?

2022-07-26 Thread Ehioje Henry Erabor
This should be a big joke right?

On Tue, Jul 26, 2022 at 6:53 AM Amnon  wrote:

>
> On Monday, 25 July 2022 at 19:48:24 UTC+1 Carlos Jimenez wrote:
>
>> I think it will be discontinued soon
>> The average lifespan of a discontinued Google product is *4 years and 1
>> month*. so should be a matter of months maybe 2.0 will be the last one
>> before shutdown
>>
>
> The average lifespan may be 4 years 1 month. But there is a massive
> standard deviation. Some google products (such as Search) seem to have a
> very much longer lifespan.
> The mean lifespan of a product is massively skewed by the many
> experimental products which fail fast.
>
> This thread was started in 2013.  has been dormant for 9 years. But Go has
> been anything but
> Will Go be discontinued in a matter of months? As Neils Bohr once said,
> "Predictions are difficult, especially concerning the future".
> And never more so than it today's turbulent world. But if I was a betting
> man, I would not put money on Go being discontinued any times soon,
> (though perhaps I should, as a hedge against my career being disrupted).
>
> Anyway let's check back in a few months time and see if we are still
> here...
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/937d6c13-590b-44aa-84ee-898a60143044n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAJBnG9sTL3y_1GReTu%3DZVJDx86y4j4p%2BnNHE-mkrNFQgfs9W7Q%40mail.gmail.com.


Re: [go-nuts] Go is easy to lean. But other languages are hard to forget

2020-10-05 Thread Ehioje Henry Erabor
I believe all these are statements of facts based on practical observations
that one finds out that to learn GO one needs to unlearn and then learn
again. For GO, that is indeed the way to GO.

On Mon, Oct 5, 2020 at 12:21 AM Tyler Compton  wrote:

> I wonder if mailing lists for all languages get posts like this :)
> Working in Go is great, but every language has sharp corners. Language
> design is a tricky balancing act of trade-offs, and I don't think Go or any
> other language is above that.
>
> On Sun, Oct 4, 2020 at 1:25 PM Amnon  wrote:
>
>> Go is a beautifully simple language. It is easy to learn.
>> Most programmers can learn to write working production code within a day.
>>
>> But learning Go is the easy thing. It is much much harder to liberate
>> yourself
>> from the conceptual baggage that you have inherited from languages in
>> your past.
>> Every programmer carries scars from the sharp corners of previous
>> languages,
>> and these scars continue to infect the code they write today.
>> It takes many months of immersion in idiomatic Go for these scars to have
>> a chance to heal. Sometimes years. And some programmers never manage
>> to escape the traumas and convoluted rituals of the past. And they are
>> doomed to continue
>> writing their former language in Go syntax, for the rest of their careers.
>>
>> So learning Go is easy. But exorcising the ghosts of former languages
>> can be very very hard.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to golang-nuts+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/golang-nuts/efbfba1d-5d1e-47ed-8a16-c73c98ba1575n%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CAA%3DXfu3_FqC-dts%3Dq7RYFhxo7vMnfMoCvNJmhA968%3DWWA0oeew%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAJBnG9u-pyg-_rnmmfBNuX%3D_gyfE2aZc0ivmhUjY4zmViyMFpg%40mail.gmail.com.


Re: [go-nuts] How do I initialize extemplate (a template engine in golang) so that I can use with Echo minimalist framework

2020-01-10 Thread Ehioje Henry Erabor
Thanks Chris Burkert and Uzondu.

xt := &Template{} was indeed nil and was not initialized.

I created a function that when called enabled me to initialize the
extemplate before returning an instance of the used struct and its field
(The field value of the struct is what is actually initialized).

func NewTemplate(path string) *Template {

  t := new(Template)
  t.templates = extemplate.New()
 
}

On Wed, Jan 8, 2020 at 5:23 PM Chris Burkert 
wrote:

> xt := &Template{} leaves the templates field nil.
>
> Ehioje Henry Erabor  schrieb am Mi. 8. Jan. 2020 um
> 15:59:
>
>> I am having issues using extemplate library in my echo framework project.
>> Library :https://github.com/dannyvankooten/extemplate
>>
>> My Code is below:
>>
>> Enter code here...package main
>>
>> import (
>> "fmt"
>> "io"
>> "net/http"
>>
>> "github.com/dannyvankooten/extemplate"
>> "github.com/labstack/echo/v4"
>> )
>>
>> // Template ...
>> type Template struct {
>> templates *extemplate.Extemplate
>> }
>>
>> // Render ...
>> func (t *Template) Render(w io.Writer, name string, data interface{}, c
>> echo.Context) error {
>> err := t.templates.ExecuteTemplate(w, name, data)
>> if err != nil {
>> fmt.Println("error", err)
>> return err
>> }
>>
>> return nil
>> }
>>
>> // Page ...
>> type Page struct {
>> Name string
>> Content string
>> }
>>
>> // Hello ...
>> func Hello(c echo.Context) error {
>> return c.Render(http.StatusOK, "hello.html", "Guys")
>> }
>>
>> // About ...
>> func About(c echo.Context) error {
>>
>> data := Page{
>> Name: "About", Content: `Lorem ipsum dolor sit amet, consectetur
>> adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
>> aliqua.
>> Nisi scelerisque eu ultrices vitae auctor eu augue ut lectus. Quam
>> pellentesque nec nam aliquam sem et tortor consequat.
>> Pharetra vel turpis nunc eget lorem dolor. Vitae turpis massa sed
>> elementum tempus egestas. Turpis egestas pretium aenean pharetra magna ac
>> placerat.
>> Neque ornare aenean euismod elementum nisi quis eleifend quam. In
>> fermentum et sollicitudin ac orci. Ut porttitor leo a diam sollicitudin
>> tempor id eu nisl.
>> Sed viverra tellus in hac habitasse platea dictumst vestibulum rhoncus.
>> Lorem ipsum dolor sit amet. A diam sollicitudin tempor id eu. Sit amet
>> facilisis magna etiam.
>> Praesent tristique magna sit amet purus gravida.`,
>> }
>> return c.Render(http.StatusOK, "about.html", data)
>> }
>>
>> func main() {
>>
>> xt := &Template{}
>> err := xt.templates.ParseDir("templates/", []string{".html"})
>> if err != nil {
>> fmt.Println("ErrorExt: ", err)
>> }
>>
>> e := echo.New()
>> e.Renderer = xt
>> e.GET("/hello", Hello)
>> e.GET("/about", About)
>>
>> e.Logger.Fatal(e.Start(":4000"))
>>
>> }
>>
>>
>> My folder structure where the template resides is below:
>>
>> --main--
>> --templates--
>>--about.html--
>>--home.html--
>> --go.mod--
>> --go.sum--
>>
>> I am using go modules for the project.
>> Why do I keep on getting these errors below:
>>
>> panic: runtime error: invalid memory address or nil pointer dereference
>>> [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x776c85]
>>> goroutine 1 [running]:
>>> github.com/dannyvankooten/extemplate.(*Extemplate).ParseDir(0x0,
>>> 0x8cb153, 0xa, 0xcebf20, 0x1, 0x1, 0x32, 0x963ae0)
>>> /home/henry/work/pkg/mod/
>>> github.com/dannyvankooten/extemplate@v0.0.0-20180818082729-efbdf6eacd7e/template.go:110
>>> +0x125
>>> main.main()
>>> /home/henry/goproject/extemplate/main.go:56 +0xa7
>>> exit status 2
>>
>>
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to golang-nuts+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/golang-nuts/0b664dbf-4ca4-41e5-aa55-b514101b81c6%40googlegroups.com
>> <https://groups.google.com/d/msgid/golang-nuts/0b664dbf-4ca4-41e5-aa55-b514101b81c6%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAJBnG9sORPG%2BSAMNf%3D0VC-THHz_BUycgrghckPX3GxxaLuVZ_A%40mail.gmail.com.


[go-nuts] How do I initialize extemplate (a template engine in golang) so that I can use with Echo minimalist framework

2020-01-08 Thread Ehioje Henry Erabor
I am having issues using extemplate library in my echo framework project. 
Library :https://github.com/dannyvankooten/extemplate

My Code is below:

Enter code here...package main

import (
"fmt"
"io"
"net/http"

"github.com/dannyvankooten/extemplate"
"github.com/labstack/echo/v4"
)

// Template ...
type Template struct {
templates *extemplate.Extemplate
}

// Render ...
func (t *Template) Render(w io.Writer, name string, data interface{}, c 
echo.Context) error {
err := t.templates.ExecuteTemplate(w, name, data)
if err != nil {
fmt.Println("error", err)
return err
}

return nil
}

// Page ...
type Page struct {
Name string
Content string
}

// Hello ...
func Hello(c echo.Context) error {
return c.Render(http.StatusOK, "hello.html", "Guys")
}

// About ...
func About(c echo.Context) error {

data := Page{
Name: "About", Content: `Lorem ipsum dolor sit amet, consectetur adipiscing 
elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
Nisi scelerisque eu ultrices vitae auctor eu augue ut lectus. Quam 
pellentesque nec nam aliquam sem et tortor consequat. 
Pharetra vel turpis nunc eget lorem dolor. Vitae turpis massa sed elementum 
tempus egestas. Turpis egestas pretium aenean pharetra magna ac placerat. 
Neque ornare aenean euismod elementum nisi quis eleifend quam. In fermentum 
et sollicitudin ac orci. Ut porttitor leo a diam sollicitudin tempor id eu 
nisl. 
Sed viverra tellus in hac habitasse platea dictumst vestibulum rhoncus. 
Lorem ipsum dolor sit amet. A diam sollicitudin tempor id eu. Sit amet 
facilisis magna etiam. 
Praesent tristique magna sit amet purus gravida.`,
}
return c.Render(http.StatusOK, "about.html", data)
}

func main() {

xt := &Template{}
err := xt.templates.ParseDir("templates/", []string{".html"})
if err != nil {
fmt.Println("ErrorExt: ", err)
}

e := echo.New()
e.Renderer = xt
e.GET("/hello", Hello)
e.GET("/about", About)

e.Logger.Fatal(e.Start(":4000"))

}


My folder structure where the template resides is below:

--main--
--templates--
   --about.html--
   --home.html--
--go.mod--
--go.sum--

I am using go modules for the project.
Why do I keep on getting these errors below:

panic: runtime error: invalid memory address or nil pointer dereference
> [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x776c85]
> goroutine 1 [running]:
> github.com/dannyvankooten/extemplate.(*Extemplate).ParseDir(0x0, 0x8cb153, 
> 0xa, 0xcebf20, 0x1, 0x1, 0x32, 0x963ae0)
> /home/henry/work/pkg/mod/github.com/dannyvankooten/extemplate@v0.0.0-20180818082729-efbdf6eacd7e/template.go:110
>  
> +0x125
> main.main()
> /home/henry/goproject/extemplate/main.go:56 +0xa7
> exit status 2





-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/0b664dbf-4ca4-41e5-aa55-b514101b81c6%40googlegroups.com.