by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • May 25 02:17

    notzippy on develop

    Changes to Revel for go.mod sup… Enhanced logging Fixed paths for test cases and 2 more (compare)

  • May 25 02:17
    notzippy closed #1491
  • May 25 00:15
    notzippy synchronize #1491
  • May 24 18:50
    notzippy synchronize #1491
  • May 24 17:06
    notzippy synchronize #1491
  • May 24 16:07
    notzippy synchronize #1491
  • May 24 15:43
    notzippy synchronize #1491
  • May 24 15:40
    notzippy synchronize #1491
  • May 24 15:24
    notzippy synchronize #1491
  • May 23 16:43
    notzippy synchronize #1491
  • May 19 22:10
    notzippy opened #1491
  • May 18 08:51
    dudochkin-victor commented #1121
  • May 13 20:48
    glaslos opened #1490
  • May 12 17:35
    dkm199 closed #1489
  • May 12 17:35
    dkm199 commented #1489
  • May 09 00:37
    dkm199 edited #1489
  • May 09 00:32
    dkm199 edited #1489
  • May 09 00:32
    dkm199 edited #1489
  • May 09 00:31
    dkm199 opened #1489
  • May 04 19:17
    notzippy transferred #1474
Devendra Modium
@dkm199
only public repos?
Stephen Russell
@daflad
it always clones to src/path/to/repo
no
it works on private too
but you have to use ssh and have the correct certs inlace to clone
Devendra Modium
@dkm199
okay
one more qsn.. go documentation says.. there needs to be go.mod file inside repo to tell what module path is.. for a new revel app, does one need to create go.mod manually Or if app is placed in correct dir structure src/github.com/account/repoName ..its not needed?
Stephen Russell
@daflad
I've never used one, go mod support is in dev I believe but this is a question for someone else
Steve
@notzippy
@dkm199 Not ready for go.mod support - existing should work like
mkdir mygopath
export GOPATH=$PWD/mygopath
cd mygopath
go get github.com/revel/cmd/revel
./bin/revel new -a myapp
Devendra Modium
@dkm199
@notzippy on mac high sierra 10.13.6. I see with latest go.1.14 , running revel is broken. Even revel version is unable to find the version correctly.. though I followed steps mentioned here..https://revel.github.io/tutorial/gettingstarted.html . revel version
Revel executing: displays the Revel Framework and Go version
WARN 16:49:43 version.go:71: Unable to extract version information from Revel error,err=nil LOG15_ERROR="Normalized odd number of arguments by adding nil"
WARN 16:49:44 version.go:71: Unable to extract version information from Revel Modules error="open /Users/devendra/gocode/pkg/mod/github.cgithub.com/revel/modules/version.go: no such file or directory"
Revel Framework : Unknown (0.21.0 remote master branch)
Revel Cmd : 0.21.1 (0.21.1 remote master branch)
Revel Modules : Unknown (0.21.0 remote master branch)
.. Then I tried with various go versions.. turns out its broken after go.1.13(same version goland introduced mod support?) .. thanks for help and pointers earlier @daflad . I can reliably produce above behavior in my mac os high sierra 10.13.6
Steve
@notzippy
Thanks for testing, go 1.12 supports modules as well but it does seem to be friendlier to gopath, one thing I did notice, if you have a go.mod file in any parent folder of your defined gopath, the gopath is ignored
Devendra Modium
@dkm199
ok.. i dont have any go.mod. just running basic revel commands revel version, revel run github.com/examples/booking etc..which are broken.. not sure what other changes in go1.13+ that are causing revel to break. for now i ll try to use go1.12 ..will create a issue in github
Steve
@notzippy
This works for me with go1.4
$ export GOPATH=$PWD/gopath/
$ cd gopath/
/gopath$ go get github.com/revel/cmd/revel
/gopath$ cd src
/gopath/src$ ../bin/revel new -a myapp
Revel executing: create a skeleton Revel application
Your application has been created in:
   /home/notzippy/temp/gopath/src/myapp

You can run it with:
   revel run -a  myapp
/gopath/src$ ../bin/revel run -a myapp
Revel executing: run a Revel application
WARN  17:28:06    run.go:150: No http.addr specified in the app.conf listening on localhost interface only. This will not allow external access to your application 
INFO  17:28:07    app     run.go:26: Running revel server                      
INFO  17:28:07    app revel_hooks.go:32: Go to /@tests to run the tests.           
Revel engine is listening on.. localhost:34639
Devendra Modium
@dkm199
is it high sierra? what does revel version show? anyhow created issue with details here revel/revel#1489
Steve
@notzippy
It is Linux
Ubuntu, don't have a mac to test
Victor Dudochkin
@dudochkin-victor
@notzippy @dkm199 the problem in "/Users/devendra/development/go/pkg/mod/github.cgithub.com/revel/modules/version.go: no such file or directory"
that mean "go mod" is enabled. look to >> "github.cgithub.com"
i think that @dkm199 is not switched to develop version of revel to use "go mod"
env|grep GO11 will help
go/pkg/mod mean it in "go mod" mode
unset GO111MODULE to disable "go mod"
Devendra Modium
@dkm199
@dudochkin-victor thanks for the reply. I didnt have GO111MODULE set, but I had GOMOD env pointing to go.mod file in my home dir(I didnt know go scans for go.mod in home directory, even though GOPATH is not homedir). After I removed that ..go1.14 + revel version worked as expected. however running examples, i ran into some other issue golang/go#24674, but i think thats not related to revel(fresh install may fix that). Thanks for the pointer. I will update the revel issue i created
Steve
@notzippy
Geeting closer on go-mod, updateing and testing example projects is good for finding edge cases
matrixbot
@matrixbot
Paul \o/
Steve
@notzippy
All examples working, getting together final PRs for cmd, modules, revel and examples
(Removed persona example because the browser functionality was removed)
Victor Dudochkin
@dudochkin-victor
\o/
matrixbot
@matrixbot
Paul excellent
alexander-dc81
@alexander-dc81

I know it can be a very stupid question, but is it possible to add (dinamically) a folder of template to a template? Something like this:

{{append . "moreTemplate" "/external/html/*"}}

<div>
{{range .moreTemplate}}
{{template "template_*.html" .}}
{{end}}
</div>

Steve
@notzippy
You cant do that in normally, but you can do this using the i18ntemplate function https://github.com/revel/revel/blob/master/template_functions.go#L170
It can take the first arguement as the template name which can be a calculation
Daniel Ostrow
@dostrow
I have a quick question about the fasthttp module, it works perfectly for me when using revel run but when trying the same config using the binary created with revel package it does not work, is there a clear thing that I have missed?
Steve
@notzippy
Are you talking about revel run vs revel build?
Daniel Ostrow
@dostrow
revel run vs revel package
Steve
@notzippy
There was a bug about the message files not being copied over
Daniel Ostrow
@dostrow
works with the former, does not work with the latter when the resulting tarball is untarred and the binary run with the same config
let me check the issues
Daniel Ostrow
@dostrow
nothing jumps out at me as relevant, the error I get is "Server Engine fasthttp Not found" despite having module.fasthttp and server.engine defined, it works with revel run but not with revel package, could you point me at the issue you were thinking of?
happens when I take the tarball from revel package and copy it to another machine, untar it and try to run it
alexander-dc81
@alexander-dc81

You cant do that in normally, but you can do this using the i18ntemplate function https://github.com/revel/revel/blob/master/template_functions.go#L170

Steve thanks a lot! But I do not figured out to make it works (always ending up on the "template not found" error). I ended on writing my own function, I copy it here if can be useful for someone else:

revel.TemplateFuncs["external_html"] = func(a interface{}) template.HTML {
        htmlGenerated := ""

        path, err := os.Getwd()

        if err != nil {
            log.Fatal(err)
        }

        path = path + "/app/views/external/html/" + fmt.Sprint(a) + "/"

        files, err := ioutil.ReadDir(path)

        if err != nil {
            log.Fatal(err)
        }

        for _, f := range files {
            if !f.IsDir() {
                data, err := ioutil.ReadFile(path + f.Name())

                if err != nil {
                    log.Fatal(err)
                }

                fmt.Println(string(data))
                htmlGenerated = htmlGenerated + string(data)
            }
        }

        return template.HTML(htmlGenerated)
    }
}
matrixbot
@matrixbot
Paul alexander-dc81, this is maybe the worst place to store code
Paul gist.github.com is a quite good
alexander-dc81
@alexander-dc81
Paul, my fault. Sorry. I will share after a serious radical refactor :)
Steve
@notzippy
Weekend #3 examples are working, refactored source code parser to allow for code to be generated after the initial scan of go files. This is a hybrid approach which allows for the use of generated files like the ones in the routes package.
Steve
@notzippy
Week 4
Updated develop branch on repos below (for go-mod) support
https://travis-ci.org/github/revel/revel
https://travis-ci.org/github/revel/cmd
https://travis-ci.org/github/revel/modules
Continuing working with examples project, updating travis to ensure examples work both in windows and linux
matrixbot
@matrixbot
Paul great work!
Victor Dudochkin
@dudochkin-victor
\o/
Steve
@notzippy
All examples ran using the develop branch https://travis-ci.org/github/revel/examples
I updated the booking app on develop branch to use go.mod, all others are built using gopath, on windows, linux, and mac