Tamás Gulácsi | 26 Jun 09:18 2016
Picon
Gravatar

Where is .gosymtab in go binaries with cgo?

I want to find out the source package's given the binary.

github.com/FiloSottile/gorebuild (and github.com/rjeczalik/which) works fine with binaries built with the "go" tool.
But fails if cgo (and thus I think gcc) is included in the build procedure.

A minimal example is attached to https://github.com/FiloSottile/gorebuild/issues/3

Can anybody help me?

Thanks,
Tamás Gulácsi

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
e.kovetskiy | 25 Jun 16:00 2016
Picon

Tool for vendoring using git submodules

Hi, check this out

https://github.com/kovetskiy/manul

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
mhhcbon | 26 Jun 00:00 2016
Picon

[ANN] go-msi: generate msi package with ease

Hi,

I have released a project to easily generate MSI package on top of wix.

I made it primarily to enhance usability of my Go packages, but it can be used for non go projects too.

It can handle multiple directories, multiple files, environments variable, and shortcuts.

https://github.com/mh-cbon/go-msi

As a first result,
https://github.com/mh-cbon/go-msi/releases/tag/0.0.17

I include two specifics recipes for unix users, like me in fact,

- Using Appveyor : https://github.com/mh-cbon/go-msi/blob/master/appveyor-recipe.md
- Using a vagrant box : https://github.com/mh-cbon/go-msi/blob/master/unice-recipe.md

I hope you ll find interest into that to share your bin with non go developers.

Looking forward for deb and rpm packaging!

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Kyle Stanly | 25 Jun 23:23 2016
Picon

Gosched: What does it mean by "It does not suspend the current goroutine, so execution resumes automatically."

What I mean is, if I wish to yield to allow another Goroutine to run, why would it "execution resume automatically"? I would expect it to immediately give up it's time-slice, put itself at the end of the processor's 'p' run-queue, and thats it. Does it only yield the processor immediately after it loses it's timeslice? If so, it's kind of... I dunno, useless in that regard. What if we have other Goroutines waiting on the same processor? Are they moved to another 'p'? 

So, lets say you have 4 Processors, denoted 'p', and 1000 Goroutines, 'g', running on an OS thread, 'm'...

      'm'
       |
      'p' - - - - - -
       |            |
     'g_r'        'g_1'
                    |
                   'g_2'
                    ...
                    |
                   'g_N'


Now, 'g_r' denotes a running Goroutine. Multiply the above by 4 (1 for each processor). If we want to have 'g_1' to 'g_N' to run, maybe because we have nothing else to do inside of a tight loop, will the call to Gosched allow just that? 

If Gosched will not do that, will something like usleep(0) do what I want? What I am asking, once again, is that all Goroutines held by 'p' are not held from being run, and that 'g_r' is just put behind 'g_N' in the runqueue (or maybe not explicitly at the end, doesn't matter where, it just isn't running)

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
mhhcbon | 25 Jun 23:19 2016
Picon

small defect in os.exec.LookPath

Hi,

i notice a case where LookPath is not really looking for PATH.

I have a bin with some files along it, i need to get its path at runtime to find the other files.

I use a func like this, minus the fmt prints


func getBinPath() (string, error) {
 
var err error
  wd
:= ""
   
if filepath.Base(os.Args[0]) == "main" { // go run ...
        wd
, err = os.Getwd()
   
} else {
      bin
, err := exec.LookPath(os.Args[0])
     
if err == nil {
          wd
= filepath.Dir(bin)
     
}
   
}
  fmt
.Printf("%q\n", wd)
  fmt
.Printf("%q\n", os.Args)
   
return wd, err
}

When i run the command from a lambda dir, things are good,

C:\>go-msi generate-templates -h
"C:\\Program Files\\go-msi"
["go-msi" "generate-templates" "-h"]

Now the case where LookPath behaves unexpectedly occurs when i run the same from command, from a directory where a `go-msi.exe` file exists

C:\vagrant>go-msi generate-templates -h
"."
["go-msi" "generate-templates" "-h"]

It is unexpected in the sense that PATH does not contains '.' (C:\vagrant\ in that case).

Looks like LookPath is looking for '.' by itself.

C:\>echo %PATH%
C
:\Windows\system32;
C
:\Windows;
C
:\Windows\System32\Wbem;
C
:\Windows\System32\WindowsPowerShell\v1.0\;
C
:\Program Files (x86)\MakeMsi\;
C
:\Program Files (x86)\WiX Toolset v3.10\bin;
C
:\Windows\system32;
C
:\Windows;
C
:\Windows\System32\Wbem;
C
:\Windows\System32\WindowsPowerShell\v1.0\;
C
:\Program Files (x86)\MakeMsi\;
C
:\ProgramFiles (x86)\WiX Toolset v3.10\bin;
C
:\wix310;
C
:\Program Files\go-msi\


I guess if LookPath would search '.', after PATH, i would not have noticed this behavior.

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Michael Soulier | 25 Jun 22:06 2016
Picon

cgo not building on darwin

Experimenting with a little cgo, I did this

package main

/*
#include <stdlib.h>
#include <sys/select.h>
static void _FD_SET(int sysfd, void *set) {
    FD_SET(sysfd, (fd_set*)set);
}
*/
import (
    "C"
    "unsafe"
    "syscall"

...etc

Unfortunately, I'm getting this on my Mac when I try to build.

msoulier <at> merlin:~/work/go$ go install github.com/msoulier/mlogd
# github.com/msoulier/mlogd
could not determine kind of name for C._FD_SET

If I seperate the import it gets worse

package main

/*
#include <stdlib.h>
#include <sys/select.h>
static void _FD_SET(int sysfd, void *set) {
    FD_SET(sysfd, (fd_set*)set);
}
*/
import "C"

import (
    "unsafe"
    "syscall"
    "strings"

msoulier <at> merlin:~/work/go$ go install github.com/msoulier/mlogd
# github.com/msoulier/mlogd
could not determine kind of name for C._FD_SET

clang errors for preamble:
src/github.com/msoulier/mlogd/mlogd.go:6:21: error: expected identifier or '('
static void _FD_SET(int sysfd, void *set) {
                    ^
src/github.com/msoulier/mlogd/mlogd.go:6:21: error: expected ')'
src/github.com/msoulier/mlogd/mlogd.go:6:20: note: to match this '('
static void _FD_SET(int sysfd, void *set) {
                   ^
2 errors generated.

I think I'm following the rules of cgo. 

What am I doing wrong?

Mike

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Markus Zimmermann | 25 Jun 21:50 2016
Picon

[ANN] go-mutesting v1.0 - Mutation testing for Go source code

Hi gophers!

I would like to announce v1.0 of go-mutesting https://github.com/zimmski/go-mutesting

The following has changed since the last release:
- Added a build-in exec command so only the go-mutation binary is needed for mutation testing in the most common use-case.
- Added a mutator for "case" clauses.
- Included noop-statements to avoid "declared but never used" compile errors.
- Additional guards to avoid compile errors.
- Added the "--match" argument to apply mutation testing only on certain functions.
- Added "test-current-directory.sh" exec command to run tests in the current directory for the mutation.
- Added "test-mutated-package.sh" exec command to run tests in the mutated file's package.
- Completely changed the interface and internal behavior of mutators. It is now a lot easier to write mutators.
- Added more tests.
- Upgraded to Go 1.6 for the development environment.
- Cleaned up the development environment.
- Took a good look at other mutation testing tools and included some of their features for future releases.

As always, I appreciate any suggestions and comments. There is still a lot that could be done (especially reducing bad substitution that lead to compile errors) but I have a lot on my plate right now. If some new-comer or eager gophers wants to contribute, I would be very happy to help out giving guidance. There are some ideas for nice additions in the issue tracker https://github.com/zimmski/go-mutesting/issues which are partly easy to implement.

Cheers,
Markus

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Val | 25 Jun 21:34 2016
Picon

Unused var written in closure

Hello
It seems that this code doesn't compile :

func main() {
   
var err error
    err
= f()
}

prog.go:8: err declared and not used
but this one does :

func main() {
   
var err error
    g
:= func() {
        err
= f()
   
}
    g
()
}

Is the function binding regarded as a "use"?  Or does escape analysis decide to not check too deep about never-read variables?

Whether expected or not, I supposed this compiler behavior won't change, because of the Go1 compatibility promise.

Cheers
 Val

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Mohammad Nasirifar | 25 Jun 14:47 2016
Picon
Gravatar

Re: Urlwatch

Btw I would like to work on it

On Sat, Jun 25, 2016 at 5:16 PM, Mohammad Nasirifar <far.nasiri.m-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Btw I would like to work on it!

On Sat, Jun 25, 2016 at 5:11 PM, Henrik Johansson <dahankzter-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

Cache headers, etags etc and dynamic scheduling of re-fetch sounds useful. Why not start a little library?


On Sat, Jun 25, 2016, 13:51 Johann Höchtl <johann.hoechtl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:


Am Donnerstag, 23. Juni 2016 17:04:54 UTC+2 schrieb Shawn Milochik:
What do you need it to do, specifically? Doing an http.Get on a page and storing and comparing the bytes or a hash is something you could write in under a minute. Why not just do that?

Get notified when a change happens. Your approach would certainly work but it's super-naive. Perform a Head Lookup and check the Timestamp when the resurce was changed, ETags, etc. all come to my mind to checl before downloading the whle resource. Or being able to specify a nesting level  upto which embeded resources will be fetched recursively to check for change etc.

So I think somebody else spent more time to think about that. There are services in other languages of course but I was hoping for some sort of getable service in Golang / 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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.


--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Oleg Puchinin | 25 Jun 13:25 2016
Picon

(unknown)

Hello !
How to make (and load) GUI form in Go ?

Oleg.

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Tim Hawkins | 25 Jun 06:54 2016
Picon
Gravatar

Re: How to be safe in Go?

That is a lofty goal, and not always achievable,  many libraries are not self contained and often wrap other non-go libraries or device integration libraries that don't support that model. What people do inside a library should not be a language feature, otherwise the language is becoming overly opiniated.

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Gmane