About 11,800,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 …

  2. How to do a https request with bad certificate? - Stack Overflow

    this is not a "bad certificate" it's a certificate with a different CN. InsecureSkipVerify is not a legitimate use here. You must set ServerName in the tls.Config to match what you are trying to …

  3. Is there a way to iterate over a range of integers?

    Go's range can iterate over maps and slices, but I was wondering if there is a way to iterate over a range of numbers, something like this: for i := range [1..10] { fmt.Println(i) } Or is ther...

  4. How can I read from standard input in the console?

    I would like to read standard input from the command line, but my attempts have ended with the program exiting before I'm prompted for input. I'm looking for the equivalent of …

  5. 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 …

  6. How to generate a random string of a fixed length in Go?

    I want a random string of characters only (uppercase or lowercase), no numbers, in Go. What is the fastest and simplest way to do this?

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

    I think not having optional parameters is a good decision. I've seen optional parameters abused pretty severely in C++ -- 40+ arguments. It's very error-prone to count through the arguments …

  8. How to delete an element from a Slice in Golang

    Yes this is idiomatic way in Golang, and even in C/Assembly removing one random element from sorted array is expensive, you need shift (copy) all right elements one position to the left. Yes …

  9. go - Convert time.Time to string - Stack Overflow

    I'm trying to add some values from my database to a []string in Go. Some of these are timestamps. I get the error: cannot use U.Created_date (type time.Time) as type string in array …

  10. go - How to do one-liner if else statement? - Stack Overflow

    Ternary ? operator alternatives | golang if else one line You can’t write a short one-line conditional in Go language ; there is no ternary conditional operator.