Hiroshi Sakurai | 4 Aug 14:58 2015
Picon

Golang like channel and select for Java

Hi,

I've made a Java library which provides Golang-like channel and select.

It may be of interest to you if you have to use Java for work.
Any feedback is welcome.

--
Hiroshi

--
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.
jon.forums | 4 Aug 18:00 2015
Picon

bug in windows syscall amd64 due to missing r2?

While spelunking how Syscall handles negative return values for uintptr, I saw the following inconsistency (no r2 return value on windows amd64?) in the "TEXT runtime·asmstdcall(SB),NOSPLIT,$0" assembly:

  // file: runtime/sys_windows_386.go
  ...
  // Return result.
  MOVL    fn+0(FP), BX
  MOVL    AX, libcall_r1(BX)
  MOVL    DX, libcall_r2(BX)


  // file: runtime/sys_windows_amd64.go
  ...
  // Return result.
  POPQ    CX
  MOVQ    AX, libcall_r1(CX)


The corresponding assembly for darwin, linux, and freebsd in syscall/asm_*.s all appear to return r2 from DX for both 386 and amd64 similar to the following linux assembly:

  // file: syscall/asm_linux_386.s
  ...
  ok:
      MOVL    AX, r1+16(FP)
      MOVL    DX, r2+20(FP)
      MOVL    $0, err+24(FP)
      CALL    runtime·exitsyscall(SB)
      RET


  // file: syscall/asm_linux_amd64.s
  ...
  ok:
      MOVQ    AX, r1+32(FP)
      MOVQ    DX, r2+40(FP)
      MOVQ    $0, err+48(FP)
      CALL    runtime·exitsyscall(SB)
      RET

Is this a bug for syscall on windows amd64, or do I not yet grok the go assembly? If a bug, what is the real-world impact?

--
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.
caknopal | 4 Aug 08:10 2015
Picon

go-oci8 ORA-12545: Connect failed because target host or object does not exist

I'm trying to use go-oci8 on my project. I use OSX. I already prepare the oracle instantclient and everything, and I can finally use it using sqlplus.


This is my tnsnames.ora

210=(DESCRIPTION= (ADDRESS_LIST= (ADDRESS= (PROTOCOL=TCP) (HOST=192.168.0.210) (PORT=1521) ) ) (CONNECT_DATA= (SID=ORCL) (SERVER=DEDICATED) (SERVICE_NAME=orcl.my.local) ) )


This is the env.

export ORACLE_HOME=/Applications/oracle/instantclient_11_2 export PKG_CONFIG_PATH=$ORACLE_HOME/pkg export GO_OCI8_CONNECT_STRING="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.210)(PORT=1521)))(CONNECT_DATA=(SID=ORCL)(SERVER=DEDICATED)(SERVICE_NAME=orcl.my.local)))" export ORACLE_SID="ORCL" export DYLD_LIBRARY_PATH=$ORACLE_HOME:$DYLD_LIBRARY_PATH export PATH=$PATH:$ORACLE_HOME

It's working if I use sqlplus, sqlplus scott/tiger <at> 210.


---




The problem is I cannot connect to the oracle server using go-oci8 example.

I have put oci8.pc file inside $PKG_CONFIG_PATH and below is the content of the file.

orainc=/Applications/oracle/instantclient_11_2/sdk/include oralib=/Applications/oracle/instantclient_11_2 Name: oci8 Description: Oracle Instant Client Version: 12.1 Cflags: -I${orainc} Libs: -L${oralib} -lclntsh


Everytime I run it, this error always showing up.


ORA-12545: Connect failed because target host or object does not exist


Could you help me solving this problem? Or am I missing something. Thank you in advance.

--
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.
Amol Umbarkar | 4 Aug 13:22 2015
Picon

Crypto Package - Dynamic Imports

Hello Everyone,

I am on a workflow system and trying to implement the dynamic logic similar to the hash function in Crypto library. I could figure out how the functions are being handled but unable to make sense of package import. 

The crypto seems to work in following way.  
crypto.RegisterHash(crypto.SHA3_224, New224)
  • The registered functions are added to hash map in crypto.go
  • Hashes are generated using one of the registered functions in map
func New224() hash.Hash { return &state{rate: 144, outputLen: 28, dsbyte: 0x06} }

 While i understand this bit, i can't figure out how package imports are working. 

Crypto.go has no reference to the package sha3. How does runtime know structure of 'state' or any package level dependancies that function has? 

when you pass function as parameter, does it carry package dependancies with itself?


Hope my ask is not very vague :)

Thanks,
Amol 


--
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.
Nick Craig-Wood | 4 Aug 13:13 2015

Long paths (> 256 chars) in Windows

One of my users (of my rclone program) has hit the 256 characters path
name limit in Windows.

I see that this might be possible to work-around by using the `\\?\`
prefix - see
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
for more details.

There are a lot of caveats in that document though!

I was wondering whether anyone has any experience of doing this, or some
code I could look at?

-- 
Nick Craig-Wood <nick@...> -- http://www.craig-wood.com/nick

--

-- 
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@...
For more options, visit https://groups.google.com/d/optout.

Picon

Golang + IntelliJ IDEA + Linux Mint

Hello everybody!!! Could somebody help me? I never before use Linux systems, and I have a problem. My IDEA don't see GOPATH. Tell me please what I must to do for fix it? Thank you!!!

--
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.
Taru Karttunen | 4 Aug 09:51 2015
Picon

Stability of new API and std library (especially go/*)

Hello

I know this is probably too late.

Could it be possible that some new additions to the stdlib
could be marked unstable like parts of the testing package
and thus not covered by the Go 1 compatibility guidelines?

I am worried that some of the bits in go/* and especially
go/types are found to be non-optional in the future.
Fixing them will be painful if they are subject 
to the compatibility guidelines.

- Taru Karttunen

--

-- 
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@...
For more options, visit https://groups.google.com/d/optout.

myalexer | 4 Aug 00:54 2015
Picon

automatic recompile if code's changed

Hey
Do you prefer for auto recompile for my web app?
I used gorilla mux for routing and i test https://github.com/codegangsta/gin but it can't work
no errors 
no messages
no accidental
no changes

why?
gin have a problem with gorilla mux?!

--
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.
Stéphane phenetas | 3 Aug 23:25 2015
Picon

Wait group construction

Hello, I would like to use a wait group to parallelize some operations. But it is not working, the result is not what I expected with my logic, so probably something is wrong in my construction.

Here is my code :

var wait sync.WaitGroup // Prepare multi thread          for rows.Next() {         var MacAddress string         var deviceName string         rows.Scan(&MacAddress, &deviceName)                  wait.Add(1) // Add one thread              go func() {             defer wait.Done()                          fmt.Printf(deviceName + " with MAC " + MacAddress + " is ")             fmt.Printf(checkHostStatus(discoverIPMacAddresses(MacAddress)))             fmt.Printf("/n")      }()         wait.Wait()
 

The for loop loops how many times there is something in "rows" (from a SQL database). I want to parallelize every iteration of the "for" loop.

So I create my wait group outside the loop, and I wait after the loop.
And inside the loop, I add 1 to the wait list and at the end I wait.

There is obviously a problem with the way I add 1 to the wait list "wait.add(1)" looks wrong. And the results appears to be in wrong order, well things are displayed but not at all in the correct order :/

Any obvious mistake ?
Thank you

--
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.
joshlf | 3 Aug 21:32 2015
Picon

encoding/binary.Read should document its use of io.EOF vs io.ErrUnexpectedEOF

Hi all,

I'm using encoding/binary's Read function, and I'd like the function that I'm writing to return io.EOF if EOF is encountered before any bytes are read, and io.ErrUnexpectedEOF otherwise. Under the hood, Read calls out to io.ReadFull, which exhibits this behavior (and the behaviors is documented). However, since Read does not document this behavior, I'm uncomfortable relying on it. How would people feel about adding that to Read's documentation so that it's guaranteed to be preserved?

Thanks!
Cheers,
Josh

--
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.
joshlf | 3 Aug 21:52 2015
Picon

encoding/binary.Read should document use of io.EOF vs io.ErrUnexpectedEOF

Hi all,

I'm writing a function which uses encoding/binary's Read function. I'd like the function to return io.EOF if an EOF is encountered before any bytes are read, and io.ErrUnexpectedEOF if an EOF is encountered at any later point. Currently I'm doing this manually, but I've noticed that this is actually the behavior of Read, though it's undocumented (Read uses io.ReadFull under the hood, and io.ReadFull has this behavior, which is documented). How would people feel about adding this to Read's documentation so that the behavior will be preserved in the future, and thus I (and others) can rely on it?

Thanks!
Cheers,
Josh

--
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