[go-nuts] Re: Record audio on Windows

2016-09-25 Thread Dominik Link
II solved it by using ffmpeg now: inputDeviceName := "Microphone (Realtek High Definition Audio)" outputFile := strconv.Itoa(rand.Int()) +".mp3"//time.Now().String() + ".mp3" cmd := exec.Command("C:/Dev/ffmpeg/bin/ffmpeg.exe", "-f","dshow", "-i","audio=" + inputDeviceName, outputFile) //cmd := e

[go-nuts] Re: Bug in go? Package net

2016-09-25 Thread Volker Dobler
Am Montag, 26. September 2016 04:53:01 UTC+2 schrieb Jon Strauss: > > This error: > > panic: runtime error: invalid memory address or nil pointer dereference > > [signal 0xb code=0x1 addr=0x20 pc=0x401487] > > > goroutine 1 [running]: > > panic(0x50bfa0, 0xc82000a0c0) > > /usr/lib/go-1.6/src/runt

[go-nuts] Re: Bug in go? Package net

2016-09-25 Thread djadala
don't ignore errors On Monday, September 26, 2016 at 5:53:01 AM UTC+3, Jon Strauss wrote: > > This error: > > panic: runtime error: invalid memory address or nil pointer dereference > > [signal 0xb code=0x1 addr=0x20 pc=0x401487] > > > goroutine 1 [running]: > > panic(0x50bfa0, 0xc82000a0c0) > > /

[go-nuts] Bug in go? Package net

2016-09-25 Thread Jon Strauss
This error: panic: runtime error: invalid memory address or nil pointer dereference [signal 0xb code=0x1 addr=0x20 pc=0x401487] goroutine 1 [running]: panic(0x50bfa0, 0xc82000a0c0) /usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6 main.main() /root/Whois3/rest-whois-threaded/main.go:65 +0x67

Re: [go-nuts] Re: [ANN] ws-cli - WebSocket Command Line Client

2016-09-25 Thread mhhcbon
hi, thanks for answers, indeed, at least for the prompt() rl library is useful. About syscall, i kind of experienced the mess of not closing rl... : ) Despite all, I feel like its hopeless, to make a race free program, close the resources properly before quitting. In a way or another the progra

Re: [go-nuts] Escape special shell characters when using os.Getenv

2016-09-25 Thread Matt Harden
This also works: https://play.golang.org/p/JOJ7WLIUY3 On Sun, Sep 25, 2016 at 3:53 PM Matt Harden wrote: > There is no escaping mechanism built in to os.Expand. > > One workaround would be to define an environment variable containing a > dollar sign: https://play.golang.org/p/InJx2_EWB2 > Anothe

Re: [go-nuts] Escape special shell characters when using os.Getenv

2016-09-25 Thread Matt Harden
There is no escaping mechanism built in to os.Expand. One workaround would be to define an environment variable containing a dollar sign: https://play.golang.org/p/InJx2_EWB2 Another is to substitute an unused character or string and replace it after expansion: https://play.golang.org/p/j8Oa3dgdoH

[go-nuts] Rational number to floating point

2016-09-25 Thread Mark Longtin
Thanks for the responses. It turns out that in the IOS version the "float" function is implemented and works as expected- it's just not documented in the help file. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group

Re: [go-nuts] fmt Package

2016-09-25 Thread andrey mirtchovski
> Soo, this(fmt.Sprintf) is Necessary AND we can dont use this > function??? can you share a piece of the code so we can better understand what you're trying to do? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from thi

Re: [go-nuts] fmt Package

2016-09-25 Thread hadiesmaili85
Soo, this(fmt.Sprintf) is Necessary AND we can dont use this function??? On Sunday, September 25, 2016 at 10:19:47 AM UTC-7, Brian Hatfield wrote: > > These weird function names have a long history > . You might find the > format s

Re: [go-nuts] Support of diffie-hellman-group-exchange-sha1

2016-09-25 Thread Matt Harden
Opened https://github.com/golang/go/issues/17230. On Sun, Sep 18, 2016 at 8:09 AM Wojciech S. Czarnecki wrote: > Dnia 2016-09-18, o godz. 01:20:12 > Matt Harden napisał(a): > > > Why use that when ecdh is apparently more secure? https://weakdh.org/ > > E.g. to get a not too old device (its soft

[go-nuts] Re: Adding a title in godoc

2016-09-25 Thread Volker Dobler
Expected. See https://golang.org/src/go/doc/comment.go?#L374 V. Am Freitag, 23. September 2016 23:46:12 UTC+2 schrieb DM: > > It seems the list was creating the problem. If I add a line after the text > Pre-requisites it works as expected. > > // Package hello-world provides a helloworld example

Re: [go-nuts] Golang package documentation: missing methods? Are they missing on purpose?

2016-09-25 Thread Caleb Spare
That's just how interfaces are rendered in Godoc. (Compare, for example, io.Reader.) Concrete types (e.g., reflect.Value) have their method docs listed explicitly. Perhaps it looks strange because reflect.Type is an extremely large interface. Most interfaces in the stdlib have about 1-3 methods.

[go-nuts] io.MultiWriter has an extra check to bytes written

2016-09-25 Thread stinkingmadgod
I was fiddling around and tried implementing my own MultiWriter and after a while I was satisfied that it was an exact replica of io.MultiWriter until I actually looked: https://golang.org/src/io/multi.go line 55, if n != len(p) Why is the check even there? As I understand, the contract of the

[go-nuts] Golang package documentation: missing methods? Are they missing on purpose?

2016-09-25 Thread jyelon
I was looking at the documentation for package "reflect": https://golang.org/pkg/reflect/ At the top of the page is an index showing everything in the package. This includes information about reflect.Type: type Type func ArrayOf(count int, elem Type)

Re: [go-nuts] fmt Package

2016-09-25 Thread Brian Hatfield
These weird function names have a long history . You might find the format specifiers to be a little weird, so take a look at the fmt package docs for some examples. If you check the Godoc for the specific functions, you'l

[go-nuts] fmt Package

2016-09-25 Thread hadiesmaili85
what is difference between in *fmt.Printf* function and *fmt.Sprintf* ??? -- 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.c

Re: [go-nuts] type-embeded consts and variables request

2016-09-25 Thread Jan Mercl
On Sun, Sep 25, 2016 at 6:07 PM Ally Dale wrote: > Exactly, I desired my extension code can be like this: type Duration time.Duration const Duration.Day = Duration(time.Duration.Hour*24) const Duration.Week = Duration(Duration.Day*7) I'm perhaps missing something, but you can simply define your

[go-nuts] type-embeded consts and variables request

2016-09-25 Thread Ally Dale
Hi all, I want to know why Golang do not have type-embeded consts or variables (Just like static values and method build-in classes in object oriented languages like C++) This feature helps us define type-shared valuse, and do not increase size of instanced objects. Unfortunately Golang do not h

Re: [go-nuts] bufio: Scanner.Split starts panic when Scan is already called

2016-09-25 Thread Rob Pike
This code is not using the API correctly, and the implementation notices this and complains, as it should. Whether it worked in 1.2.1 is unknown to me, but the Split functions are meant to be called only from the Scan method, and are exported for the sole purpose of initializing the Scanner. Your

Re: [go-nuts] Re: [ANN] ws-cli - WebSocket Command Line Client

2016-09-25 Thread mhhcbon
Hi, yes definitely. I was assuming the program wanted to receive one response for each input. That got me curious again, let s see ! Meanwhile, here is server code to update a bit and run into that case, https://github.com/gorilla/websocket/blob/master/examples/echo/server.go Le dimanche 25 s

[go-nuts] bufio: Scanner.Split starts panic when Scan is already called

2016-09-25 Thread bupjae
(Note: This is complain rather than real bug report. So I wrote here instead of github issue tracker) Related code: https://play.golang.org/p/7l0pUOrX_t Background: This code is intended to submit to online judge site (i.e. provides programming questions and judge system to check whether the s

Re: [go-nuts] Re: [ANN] ws-cli - WebSocket Command Line Client

2016-09-25 Thread KwangYul Seo
Hi, Thanks for the feedback! Please check the comments below. On Sun, Sep 25, 2016 at 7:25 PM, mhhcbon wrote: > Hi, > > The code below looks like to make the job, based on the second version i > posted, but with RL library. > > BTW, just wondering, > > why don t you use standard bufio+os.Stdin

Re: [go-nuts] Re: [ANN] ws-cli - WebSocket Command Line Client

2016-09-25 Thread KwangYul Seo
Hi, It seems you assume that the server sends a single response for each message received. But don't forget that WebSocket is fully duplex and the server can send multiple messages at any time while you wait for input. Regards, Kwang Yul Seo On Sun, Sep 25, 2016 at 10:02 PM, mhhcbon wrote: >

Re: [go-nuts] Re: [ANN] ws-cli - WebSocket Command Line Client

2016-09-25 Thread mhhcbon
fixes a few edge cases i ran into, see the main for loop, rather than requesting for input on each iteration, asks for it only when needed, package main import ( "flag" "fmt" // "bufio" // "os" "net/http" "io" "time" "github.com/chzyer/readline" ws "github.com/gor

Re: [go-nuts] Re: [ANN] ws-cli - WebSocket Command Line Client

2016-09-25 Thread mhhcbon
Hi, The code below looks like to make the job, based on the second version i posted, but with RL library. BTW, just wondering, why don t you use standard bufio+os.Stdin ? Why a syscall.Kill rather than os.Exit ? syscall.Kill(syscall.Getpid(), syscall.SIGINT) the code, package main import

[go-nuts] Re: Sharing similar Interfaces across packages

2016-09-25 Thread question . developer
But unfortunately that would mean changing the public interface of Two.Item. Which is not desired (but that wasn't specified explicitly in the example given). On Sunday, September 25, 2016 at 3:22:57 AM UTC-7, question@gmail.com wrote: > > The interface for One.Item is expecting a One.Ite

[go-nuts] Re: Sharing similar Interfaces across packages

2016-09-25 Thread question . developer
The interface for One.Item is expecting a One.Item as an argument to its Less() method. By embedding it in Two.Item, that shouldn't change that correct? So the resulting public interface for Two.Item *after embedding* One.Item is technically. type Item interface { Less(One.Item) bool Le

[go-nuts] Re: Sharing similar Interfaces across packages

2016-09-25 Thread Tamás Gulácsi
An interface is not a class, but the contract of minimal provided methods: as Two has more methods, anything implements a two.Item will also implement one.Item. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and