[go-nuts] Testing using mock functionality

2019-07-21 Thread wylderkevin
Hello, I'm new to go (and new to unit testing) and have a question about how to test my code. I have a package that uses a library, with a kinda big interface , let's call it A. I don't use all the functions in A, but I want to mock the

[go-nuts] Re: Serialization of File Writes

2019-07-21 Thread dev null
@Ian : Yes , I meant "there is no need to protect" . Thanks for correcting and the reply. @robert : Understood. I was interested more in Go-OS interaction and if there is a need to serialize in the default case Thanks Mo On Sunday, 21 July 2019 22:11:13 UTC+8, dev null wrote: > > Hi folks, >

Re: [go-nuts] Need help to learn go lang

2019-07-21 Thread David Riley
This may be a controversial opinion on this list (maybe it's not, I don't know), but I've never thought Go is a particularly good first language. It's an *excellent* language, but I've always said the same thing about it as I did about C/C++ and Java: there's just a touch too much arcana for

[go-nuts] Re: Need help to learn go lang

2019-07-21 Thread Jason E. Aten
This is my outline of beginner hints: https://github.com/glycerine/thinkgo -- 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

[go-nuts] Re: Go for Data Science

2019-07-21 Thread Jason E. Aten
At the risk of mentioning my own work, there are various other extension languages are useful for doing data sciencey things with Go: https://github.com/gijit/gi is an interactive repl for Go that is JIT compiled using LuaJIT (like GoMacro, there is no state reload on each line, and it runs

[go-nuts] Re: Do Any Editors Support Customisable Code collapsing?

2019-07-21 Thread kez . olesen
Writing my own syntax-aware custom folding plugin looks like a bit more work than I have time for right now, but I'm glad the feature exists. I think I'm working out what would need to be supported in Go, and what would need to be supported in editors to do what I'm imagining. For instance,

Re: [go-nuts] Serialization of File Writes

2019-07-21 Thread robert engels
If the code is performance sensitive, then you want to use a Buffer, and you‘ll need to serialize access. Otherwise each log line write will be a sys call - but depending on your use case that may be acceptable. > On Jul 21, 2019, at 1:17 PM, Ian Lance Taylor wrote: > > On Sun, Jul 21, 2019

[go-nuts] Re: Prevent a package from being updated using go modules

2019-07-21 Thread Pantelis Sampaziotis
Thank you Bryan. On Tuesday, 16 July 2019 18:56:30 UTC+3, Bryan Mills wrote: > > This sort of use-case is pretty much exactly what the exclude directive > is for. > (See https://tip.golang.org/cmd/go/#hdr-The_go_mod_file.) > > In your go.mod file, add a directive like: > > exclude

[go-nuts] gitfs - a complete solution for static files in Go code

2019-07-21 Thread Eyal
Hi Gophers! Please take a look at gitfs . Package gitfs is a complete solution for static files in Go code. When Go code uses non-Go files, they are not packaged into the binary. The common approach to the problem, as implemented by go-bindata

Re: [go-nuts] Serialization of File Writes

2019-07-21 Thread Ian Lance Taylor
On Sun, Jul 21, 2019 at 7:11 AM dev null wrote: > > Hi folks, > I have a program that has a function that appends data to the file - like a > log appender appending to a file. > I open the file in append only mode > > logFileWriter, err := os.OpenFile(file, os.O_CREATE|os.O_WRONLY|os.O_APPEND,

[go-nuts] Re: Go for Data Science

2019-07-21 Thread Jason E. Aten
Hello Leo, There is a quite capable Go REPL available; it is called GoMacro. It is actually fairly mature. Massimiliano Ghilardi has done a great job with it. There is even a Jupyter kernel for it. https://github.com/cosmos72/gomacro https://github.com/gopherdata/gophernotes However, using Go

Re: [go-nuts] Re: About the Google logo on the new Go website

2019-07-21 Thread alialtun14
It may be a solution to open an issue on this topic. https://github.com/bridgefoundry/bridgefoundry.github.io/issues/new On Friday, 19 July 2019 07:31:43 UTC+2, Space A. wrote: > > Another funny thing and I'm glad that you mentioned, is that "Woman Who > Go" and other known "non-google"

[go-nuts] Serialization of File Writes

2019-07-21 Thread dev null
Hi folks, I have a program that has a function that appends data to the file - like a log appender appending to a file. I open the file in append only mode logFileWriter, err := os.OpenFile(file, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0755) and then there is a function to write to the file,