More than magic, it is a global convention. I guess it could be interpreted
as: when you access a directory, the web server will index its content and
will show you a list of links, if you want to override this behavior, you
could create your own index.
See
https://github.com/golang/go/blob/b68624
On Mon, May 6, 2019 at 6:56 AM Neven Miculinić
wrote:
> Is there some project going into this direction?
Not sure if relevant: https://godoc.org/modernc.org/ql
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and
Hi,
I want a go method to run on multiple cores.The go method is returning an
object. Can we achieve this using goroutine ?
How can I achieve this ?
Thanks
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and sto
On Mon, May 6, 2019 at 1:11 PM Nitish Saboo wrote:
>
> Hi,
>
> I want a go method to run on multiple cores.The go method is returning an
> object. Can we achieve this using goroutine ?
> How can I achieve this ?
In the first approximation, to run a a function/method f() in a
goroutine on N cores
Hi,
I have this data or document in mongodb.
{
"nfInstanceId": "3fa85f64-5717-4562-b3fc-2c963f66af37",
"nfType": [
"AMF"
],
"nfStatus": [
"string"
],
"sNssais": [{
"sst": 1,
"sd": "sd1"
}
],
"nsiList": [
"string"
],
"ipv4Addresses": [
"198.51.100.100"
],
"allowedNssais": [{
"s
Thanks Jan.
type Y struct {
M string
N string
}
func initalize() Y{
// I have a func that return an object ob type Y.
}
var obj1 Y = go initalize()
var obj2 Y = go initalize()
Let me know how to call a go routine in this case, because when I am doing
it in this way I am getting compilation
On Mon, May 6, 2019 at 1:39 PM Nitish Saboo wrote:
> type Y struct {
>
> M string
> N string
>
> }
>
> func initalize() Y{
> // I have a func that return an object ob type Y.
> }
> var obj1 Y = go initalize()
No need to write Y above, the type will be inferred. However, see
https://golang.org/
Hello,
I'm working on a project where there is a very (machine generated) large
slice literal in the source tree: around 6MB. The slice is declared in a
separate file, and it contains instances of an interface.
Each time I use go-guru (go-guru-referrers, for example) in emacs, it takes
a while
Hello,
Is:
type Y struct {
M string
N string
}
func initalize() Y{
// I have a func that return an object ob type Y.
}
var obj1 Y
go func() {
obj1 = initalize()
}()
var obj2 Y
go func() {
obj2 = initalize()
}()
What you are looking for?
Le lun. 6 mai 2019 à 13:59, Jan Mercl <0xj...
As a workaround, you may try to move the large slice into a separate package.
--
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
this issue involves much more than Go code For example , we for whom
English is not our native language use 'Google translate' to translate our
golang-nuts questions into English and the golang-nuts responses back to
our native language. The second translation often produces produces
very-stra
Hi. I remain mystified. I tried your suggestion, but it didn't work.
This is .../learn/main.go
func main() {
http.HandleFunc("/", handleRoot)
http.Handle("/css/", http.FileServer(http.Dir("webpages/css")))
http.Handle("/js/", http.FileServer(http.Dir("webpages/js")))
fmt.Println(
Hi. Thanks for your explanation. It makes sense.
However, the "magic" I asked about was based on your first suggestion:
simply use
http.Handle("/", http.FileServer(http.Dir("webpages")))
As I said, it works if the file to be shown is index.html. My question: how
do I modify that in order to use
Oops, I left a few lines at the top of main.go out of the post: here's the
whole thing:
// main.go
package main
import (
"fmt"
"net/http"
)
func handleRoot(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "webpages/main.html")
}
func main() {
http.HandleFunc("/", hand
You can write your own handler that serve static files and use main.html as
index, but, the main.html name is mandatory? It breaks the convention
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving em
On Mon, May 6, 2019 at 6:11 PM ThisEndUp wrote:
That listing is terrible. Colors aside, some parts of text has
contrast like 10%. Please post source code/snippets at play.golang.org
or include in in the email as plain text only, i.e.black on white.
It's the most readable option. Thanks.
--
You
I saw a design document floating about sometime last year and there seemed
to be a lot of thought going into implementing them? What is the current
status and where can I read more? Thanks.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To uns
If func f (n int) []int { is some fcn that requires CPU time
T (large) to calculate its return value
And I write :
func main() {
var s [ ] int;
s1 := f(1) ; s1 := f(2)
...
}
I get results after CPU time 2 T
?? To obtain results in < 2T time, can I write s1 := go f(1)
On Sun, May 5, 2019, 06:33 Immueggpain S wrote:
> Ah, my bad! What I meant was that binary.Read will pad when writing to the
> struct, unlike memcpy.
>
Oh, yes you're right of course.
If you want to serialize a C struct using Go, you're going to have to
mention every field on the Go side.
You
On Mon, May 6, 2019 at 9:47 AM Richard Tenney wrote:
>
> Hi. I remain mystified. I tried your suggestion, but it didn't work.
>
> This is .../learn/main.go
> func main() {
>
> http.HandleFunc("/", handleRoot)
> http.Handle("/css/", http.FileServer(http.Dir("webpages/css")))
> http.Hand
Hello,
I am trying to adopt my cgo package with go modules.
The cgo project I mentioned above is built using simple Makefile so that I
obtain external shared library(.so on Unixes and .dll on Windows) to link
external applications(from other modules) with.
When I try to use this module from the
You're right! They're awful.
Here are the files I sent -- this time in black-and-white, fixed width
.../learn/main.go
// main.go
package main
import (
"fmt"
"net/http"
)
func handleRoot(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "webpages/main.html")
On Mon, May 6, 2019 at 12:37 PM wrote:
>
> Hello,
> I am trying to adopt my cgo package with go modules.
> The cgo project I mentioned above is built using simple Makefile so that I
> obtain external shared library(.so on Unixes and .dll on Windows) to link
> external applications(from other mod
On Mon, May 6, 2019 at 9:22 AM 'kalekold' via golang-nuts
wrote:
>
> I saw a design document floating about sometime last year and there seemed to
> be a lot of thought going into implementing them? What is the current status
> and where can I read more? Thanks.
There is continuing thought. Th
On Sun, May 5, 2019 at 11:13 AM wrote:
>
> Hi, Is there a way to renew a context that has already reached a deadline?
No, sorry.
Ian
--
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
I'm learning Go web server programming and have copied the following
example:
func Image(w http.ResponseWriter, r *http.Request) {
f, _ := os.Open("images/my.png")
. . .
It works fine when I'm starting the Go web server with `go run main.go &`.
I.e., the file "images/my.png" is relat
Thanks for confirming.
On Monday, May 6, 2019 at 6:16:49 PM UTC-4, Ian Lance Taylor wrote:
>
> On Sun, May 5, 2019 at 11:13 AM >
> wrote:
> >
> > Hi, Is there a way to renew a context that has already reached a
> deadline?
>
> No, sorry.
>
> Ian
>
--
You received this message because you
Hello gophers,
We have just released Go versions 1.12.5 and 1.11.10, minor point releases.
This release includes fixes to the compiler, the linker, the go command,
the runtime, and the os package.
View the release notes for more information:
https://golang.org/doc/devel/release.html#go1.12.m
But golang-nuts is still working...
--
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.
For more options, visit https://grou
Hi Michel,
Yes, this is what I was looking for.Thankyou..:)
Can we also find the processor on which this go routine is running?
Thanks
On Mon, 6 May 2019, 17:43 Michel Levieux, wrote:
> Hello,
>
> Is:
>
> type Y struct {
>
> M string
> N string
>
> }
>
> func initalize() Y{
> // I have a fun
30 matches
Mail list logo