[go-nuts] [JOB] Senior Developer openings at TreeTop Commons (Portland, OR, or remote for non-local within North America)

2019-04-18 Thread Aimee Levens
Hey everyone,

I'm once again hiring Senior Developers as TreeTop Commons continues to 
grow! We've got three openings that were just posted: Sr API Developer, Sr 
Identity & Access Management Developer, as well as a Senior Front End 
Developer. It's a cool small-ish (company has ~28 employees) organization 
with a diverse team, zero brogrammer vibe, and really focused on making the 
world a better place. Here are the basics on TTC and the tech stack + link 
to the job postings... 

*What's TreeTop?*
TreeTop Commons builds cloud-based software with a mission to inspire 
community engagement and a team who believes in the power of people 
partnering towards a common goal. NobleHour  
provides online community software that helps track and measure 
service-learning, community service and volunteering initiatives at 
schools, non-profits, businesses and more. Collaboratory 
 empowers higher education institutions 
to document and understand the full scope of their community engagement and 
public service activities to improve practice. A Certified B Corp 
, TreeTop holds ourselves to high standards of 
social and environmental performance, transparency and accountability.


*Engineering Team + Tech Stack:*

As developers, we work collaboratively across all teams and roles to 
determine the right tools for the job at hand. Working on multiple products 
and projects at a time, we partner with our product and customer success 
teams to ensure customer needs are met and that we make things more 
awesome, faster. Our RESTful API is built in Go atop a Postgres graph 
database to deliver data to multiple web and mobile clients. TreeTop’s 
infrastructure runs entirely in the AWS cloud, taking a CI/CD approach with 
automated testing supplementing manual testing to ensure quality while 
delivering quickly.

*NOTE: While most of our team is in Portland, we are open to hiring remote 
developers within North America (note: you must be eligible to work in the 
US without H1B sponsorship) for whom relocation is not an option.*


*All three job postings with the specifics and online application are up at 
http://www.treetopcommons.com/careers 
 * - PLEASE follow the instructions 
under 'How to Apply' if you decide to throw your hat in the ring, makes 
everything go by much faster :) Got questions about the role/team/company? 
Please email me at alev...@treetopllc.com. Thanks!


Aimee Levens
Recruiting Consultant 
www.aimeelevens.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.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Persistent memory support for Go

2019-04-18 Thread 'Jerrin Shaji George' via golang-nuts
Hi,

Sorry I missed this email as I am not subscribed to email updates in this group.

This project currently only supports being built on Linux 64 bit. It is being 
developed on a machine with Intel Optane DC Persistent Memory
(https://www.intel.com/content/www/us/en/architecture-and-technology/optane-dc-persistent-memory.html)

If persistent memory is not available, it can also be emulated using DRAM. 
Please see instructions at https://pmem.io/2016/02/22/pm-emulation.html.

Thanks,
Jerrin

PS: please reply-all when replying to this message

On Saturday, April 6, 2019 at 6:24:33 AM UTC-7, r...@golang.org wrote:
Out of curiosity what HW/OS is this being developed on? I need new HW and might 
as well get the same since it will make playing around with this smoother.

On Wednesday, April 3, 2019 at 6:35:13 PM UTC-4, Jerrin Shaji George wrote:
Hi,

I am part of a small team at VMware working on projects related to persistent
memory (others in CC). We have recently been working on adding persistent memory
support to the Go programming language, and I wanted to spread the word about
couple of these projects.

1) Go-pmem-transaction
The go-pmem-transaction project introduces a new programming model for
developing applications in Go for persistent memory. It consists of two packages
- pmem and transaction.

The pmem package provides methods to initialize persistent memory and an
interface to set and retrieve objects in persistent memory. The transaction
package provides undo and redo transaction logging APIs to support
crash-consistent updates to persistent memory data.

Project page - 
https://github.com/vmware/go-pmem-transaction

2) Go-pmem
The Go-pmem project adds native persistent memory support to Go.
Some of the features of the persistent memory support added to Go are:
* Support for persistent memory allocations
* Garbage collector now collects objects from persistent heap 
and volatile
heap
* Runtime automatically swizzles pointers if the memory mapping 
address
changes on an application restart
* The persistent memory heap is dynamically sized and supports 
automatic
heap growth depending on memory demand

Project page - 
https://github.com/jerrinsg/go-pmem

The project pages contains links to further documentation. We welcome the
community to try out these projects and send any feedback our way!

Also see the blog post at 
https://blogs.vmware.com/opensource/2019/04/03/persistent-memory-with-go/

Thanks,
Jerrin

-- 
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://groups.google.com/d/optout.


Re: [go-nuts] Pointer based API and constants literals, how to best handle it?

2019-04-18 Thread whitehexagon via golang-nuts
Sure, I'm still learning Go, so it's probably more idiotic than idiomatic, 
but help yourself:

https://github.com/WhiteHexagon/go2aws

Peter

On Thursday, 18 April 2019 18:03:05 UTC+2, Jim Ancona wrote:
>
> Is your Cognito provider open source? I might have a use for that/
>
> Jim
>
>

-- 
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://groups.google.com/d/optout.


[go-nuts] Memory Freeing for C.String

2019-04-18 Thread Ashutosh Baghel
Hello Folks,

Having some confusion for freeing memory allocated by C.String(). 
Filter_CSo my program is something like below.

A. Should we just call C.Free after line 6 for Filter_C directly or defer 
is just fine.
B. Currently we are expecting  the user of fetchdata() to free the  
Context_C, any alternates ?

test_go.go
=

1  func fetchdata(x int, Filter String) (int32,String) {
2  var Context_C *C.char

3  Filter_C = C.String(Filter)
4  defer C.free(unsafe.Pointer(Filter_C))
5 
6  Context_C = C.Getdata(Filter_C)<<= Context_C 
receives string from a malloc buffer
7
8  return 1,C.GoString(Context_C)
9  
10 }


Thanks

-- 
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://groups.google.com/d/optout.


Re: [go-nuts] Re: methods on C types

2019-04-18 Thread Ian Lance Taylor
On Thu, Apr 18, 2019 at 9:17 AM Jan Mercl <0xj...@gmail.com> wrote:
>
> On Thu, Apr 18, 2019 at 6:07 PM Jamil Djadala  wrote:
> >
> > On Thu, 18 Apr 2019 07:44:53 -0700 (PDT)
> > peterGo  wrote:
> >
> > > Cgo translates C types into equivalent unexported Go types.
> > > https://golang.org/cmd/cgo/
> >
> >
> > But then, definition of new methods on non-local types is forbidden.
> > Why it is enabled for cgo types ?
>
> Unexported type cannot be non-local. "C" is not an import path, it
> denotes a pseudo package with special treatment.

That said, I have to agree that defining methods on types defined by
cgo is never necessary and can only cause confusion.  And cgo could
report an error when it sees it.  So please consider opening an issue
to change cmd/cgo to issue an error for an attempt to define a method
on a type defined in the C pseudo-package.  Thanks.

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 it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: methods on C types

2019-04-18 Thread Jan Mercl
On Thu, Apr 18, 2019 at 6:07 PM Jamil Djadala  wrote:
>
> On Thu, 18 Apr 2019 07:44:53 -0700 (PDT)
> peterGo  wrote:
>
> > Cgo translates C types into equivalent unexported Go types.
> > https://golang.org/cmd/cgo/
>
>
> But then, definition of new methods on non-local types is forbidden.
> Why it is enabled for cgo types ?

Unexported type cannot be non-local. "C" is not an import path, it
denotes a pseudo package with special treatment.

-- 
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://groups.google.com/d/optout.


[go-nuts] Closure Scope Bugs, one small trick/tip

2019-04-18 Thread Louki Sumirniy
I just ran into an issue with a closure inside a function that I originally 
created elsewhere with the same names as where I transplanted the closure 
definition, and it took me quite some time to root out all the references 
to the outer scope.

Scope bleed and shadowing with closures is something that should be 
emphasised as an issue when dealing with closures, especially when it 
involves context variables.

I found a way to exploit the scoping rules to rapidly highlight all the 
incorrectly unchanged references to outer scope context by creating an 
inner scope declaration of a variable of a different type with the name of 
this overlapping outer scope, in this case an int. Then instantly all the 
references inside the closure referring to this outer name have been 
changed to be int type and become type/member errors. 

Unfortunately I didn't figure it out until I had just finally nabbed the 
last one, but hopefully I will remember it for future and that maybe it 
helps someone else who uses closures a lot in Go.

The code is inside a configuration menu system I am writing and it uses 
closures to attach handlers to objects. 

I have learned two important scoping rules that goes beyond just closures 
in the process;

1. It is possible to declare a name inside a block same as outside the 
block with no limitations (thus using the outer name to zap incorrect 
lingering references inside a closure).
2. For variables are not multiply declared - inside a closure a reference 
to variables declared using := in a for statement are a single variable and 
usually means the closure has only the last value in the iteration in its 
references to these values. You have to declare a new variable inside the 
for statement to ensure it pins to the specific instance of the loop and 
the state at that time.

I also observed a while ago and it can be annoying sometimes (and sometimes 
actually there is no better way to express) than an if/else if/else 
construction, one has to be aware in that case that the if{}else{}else{} is 
a contiguous scope block and all names declared either in the optional if 
statement or inside the blocks can be seen by the others. I think this 
visibility is progressive, ie you can't see the variable declared in the 
next else if{} block, only the ones beforehand.

-- 
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://groups.google.com/d/optout.


Re: [go-nuts] Re: methods on C types

2019-04-18 Thread Jamil Djadala
On Thu, 18 Apr 2019 07:44:53 -0700 (PDT)
peterGo  wrote:

> Cgo translates C types into equivalent unexported Go types.
> https://golang.org/cmd/cgo/


But then, definition of new methods on non-local types is forbidden.
Why it is enabled for cgo types ? 

-- 
Jamil Djadala

-- 
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://groups.google.com/d/optout.


Re: [go-nuts] Pointer based API and constants literals, how to best handle it?

2019-04-18 Thread Jim Ancona
Is your Cognito provider open source? I might have a use for that/

Jim

On Wed, Apr 17, 2019 at 3:55 PM whitehexagon via golang-nuts <
golang-nuts@googlegroups.com> wrote:

> Thanks Jim, and for the sympathy :)  I'm almost tempted to use the REST
> API and bypass the SDK...  I already implemented a missing Cognito Provider
> using the web API, and it seemed friendlier than this.  It would be one
> less dependency too, since I'm deploying to AWS Lambda and I'm already at
> 14MB for my first Go based Lambda.
>
> Peter
>
>
> On Wednesday, 17 April 2019 21:29:31 UTC+2, Jim Ancona wrote:
>>
>> Having used the AWS SDK, I feel your pain. They do have built-in helper
>> methods, e.g. https://docs.aws.amazon.com/sdk-for-go/api/aws/#String, so
>> at least you don't have to define your own.
>>
>> Jim
>>
>> --
> 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://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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: 紧急!!中国一线互联网公司招聘云容器GO研发技术Lead

2019-04-18 Thread David Skinner
Thank you for the invite. I would be pleased to be of assistance. While I 
do not wish to relocate to Chine, I would very much like to visit. I am 
located in Arkansas USA and have some limited experience with Mandarin.

On Wednesday, April 17, 2019 at 7:34:22 AM UTC-5, chandler song wrote:
>
>
> 中国一线互联网公司招聘云容器GO研发技术Lead,希望可以带领团队负责新的一代产品的研发,GO作为主要的技术语言,业务连年增长,薪资很有竞争力,有兴趣的朋友可以加我微信:1861392,详细沟通,谢谢!
>

-- 
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://groups.google.com/d/optout.


[go-nuts] [ANN] New package to convert loops into versions with concurrency

2019-04-18 Thread Robert Johnstone
Hello Everyone,

I'd like feedback on a new package designed so that it is easy to convert 
loops into version with limited concurrency.  The concurrency is limited in 
the sense that the number of tasks running in parallel is limited, but 
otherwise you should be able to convert any loop into a concurrent version.

https://gitlab.com/stone.code/parallel
https://godoc.org/gitlab.com/stone.code/parallel

-- 
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://groups.google.com/d/optout.


Re: [go-nuts] how to get file's current offset

2019-04-18 Thread andrey mirtchovski
> offset, err := f.Seek(0, io.SeekCurrent)

my code has been written so long ago i didn't even notice os.SEEK_CUR
is deprecated :)

-- 
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://groups.google.com/d/optout.


Re: [go-nuts] how to get file's current offset

2019-04-18 Thread Valentin Vidic
On Thu, Apr 18, 2019 at 10:34:24PM +0800, sa517...@mail.ustc.edu.cn wrote:
> I want to know file's current read offset after open a file, but I can not 
> found related API.
>   
> f, err := os.Open("/tmp/")
>   if err != nil{
>   panic(err)
>   }
> 
> ... // some read operation
>  
> // how can I get f's current read offset?? 

offset, err := f.Seek(0, io.SeekCurrent)

-- 
Valentin

-- 
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://groups.google.com/d/optout.


Re: [go-nuts] how to get file's current offset

2019-04-18 Thread andrey mirtchovski
offset, err := f.Seek(0, os.SEEK_CUR)

On Thu, Apr 18, 2019 at 8:50 AM  wrote:
>
> I want to know file's current read offset after open a file, but I can not 
> found related API.
>
>
>
>
>
> f, err := os.Open("/tmp/")
> if err != nil{
> panic(err)
> }
>
> ... // some read operation
>
> // how can I get f's current read offset??
>
> --
> 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://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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] how to get file's current offset

2019-04-18 Thread sa517067
I want to know file's current read offset after open a file, but I can not 
found related API.









f, err := os.Open("/tmp/")
if err != nil{
panic(err)
}

... // some read operation
 
// how can I get f's current read offset?? 

-- 
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://groups.google.com/d/optout.


[go-nuts] Re: methods on C types

2019-04-18 Thread peterGo
Cgo translates C types into equivalent unexported Go types.
https://golang.org/cmd/cgo/

Peter

On Thursday, April 18, 2019 at 2:25:11 AM UTC-4, dja...@gmail.com wrote:
>
> Hi,
> where is documented that methods can be created on C types ?
>
> This works with go1.12.4, linux:
> https://play.golang.org/p/gXpHCFOgDDg
>
> package main
>
> import (
> "C"
> "fmt"
> )
>
> func (i *C.int) Inc() {
> *i++
> }
>
> func main() {
> var i C.int
> i.Inc()
> fmt.Println(i)
> }
>
>
> Thanks
>

-- 
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://groups.google.com/d/optout.


[go-nuts] methods on C types

2019-04-18 Thread djadala
Hi,
where is documented that methods can be created on C types ?

This works with go1.12.4, linux:
https://play.golang.org/p/gXpHCFOgDDg

package main

import (
"C"
"fmt"
)

func (i *C.int) Inc() {
*i++
}

func main() {
var i C.int
i.Inc()
fmt.Println(i)
}


Thanks

-- 
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://groups.google.com/d/optout.