About 16,000,000 results
Open links in new tab
  1. go - What is the meaning of '*' and '&'? - Stack Overflow

    Golang does not allow pointer-arithmetic (arrays do not decay to pointers) and insecure casting. All downcasts will be checked using the runtime-type of the variable and either panic or return false as …

  2. How do you write multiline strings in Go? - Stack Overflow

    Does Go have anything similar to Python's multiline strings: """line 1 line 2 line 3""" If not, what is the preferred way of writing strings spanning multiple lines?

  3. Is there a method to generate a UUID with Go language?

    There is an official implementation by Google: Generating a version 4 UUID works like this:

  4. What is the best way to test for an empty string in Go?

    That said, golang treats a string as a slice of runes and I'm not sure if one refers to a slice as empty or zero length. I would imagine that consistency is better. I was once an ASM clock cycle counter but …

  5. Convert string to integer type in Go? - Stack Overflow

    Nov 25, 2010 · I'm trying to convert a string returned from flag.Arg(n) to an int. What is the idiomatic way to do this in Go?

  6. Format a Go string without printing? - Stack Overflow

    Is there a simple way to format a string in Go without printing the string? I can do: bar := "bar" fmt.Printf("foo: %s", bar) But I want the formatted string returned rather than printed so I can

  7. How to search for an element in a golang slice - Stack Overflow

    Jul 29, 2016 · How to search for an element in a golang slice Asked 9 years, 4 months ago Modified 4 months ago Viewed 369k times

  8. go - Is it possible to capture a Ctrl+C signal (SIGINT) and run a ...

    I want to capture the Ctrl+C (SIGINT) signal sent from the console and print out some partial run totals.

  9. What is the idiomatic Go equivalent of C's ternary operator?

    Nov 14, 2013 · 9 As others have noted, golang does not have a ternary operator or any equivalent. This is a deliberate decision thought to improve readability.

  10. overloading - Optional Parameters in Go? - Stack Overflow

    Can Go have optional parameters? Or can I just define two different functions with the same name and a different number of arguments?