Welcome to Jonic Developer Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

Recent questions tagged go

0 votes
1.4k views
1 answer
    I'm using the hash function murmur2 which returns me an uint64. I want then to store it in PostgreSQL, which only support BIGINT (signed 64 bits). As I ... one do that in a way that pleases the compiler? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
2.2k views
1 answer
    I post a request to a server and get a reply in JSON format. I'm able to unmarshal it to a struct. Then I need to create a new JSON file with the same ... int `json:"age" json:"-"` } Thanks in advance. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.7k views
1 answer
    I got something running with the Goji framework: package main import ( "fmt" "net/http" "github.com/zenazn/goji" "github.com/zenazn/goji/web" ) func ... page? I'd greatly appreciate any and all help! See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.5k views
1 answer
    package main import ( "encoding/json" "fmt" ) type PublicKey struct { name string price string } type KeysResponse struct { Collection []PublicKey } func main() { ... ":[],"user_mentions":[],"urls":[]}}] See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.7k views
1 answer
    Note - newbie in Go. I've written a multiplexer that should merge the outputs of an array of channels into one. Happy with constructive criticism. func Mux(channels ... // Close. close(ch) }() return ch } See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.7k views
1 answer
    I am trying to get the value of say "ip" from my following curl output: { "type":"example", "data":{ "name":"abc", "labels":{ "key":"value" } }, " ... need to add to my code to get the value of say "ip". See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.5k views
1 answer
    It seems that the way modules are used since 1.11 has changed , and I am trying to understand how to reference a module / package from another ... that I need to use in mondule1 Kind Regards Martin See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.8k views
1 answer
    I have a slice of integers, which are manipulated concurrently: ints := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} I'm using a buffered ... finished. Question: how do I wait for the buffered channel to drain? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.6k views
1 answer
    Is it possible to get Enum name without creating func (TheEnum) String() string in Golang? const ( MERCURY = 1 VENUS = iota EARTH MARS JUPITER SATURN ... copy-paste and quoting or using editor's macro) See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.3k views
1 answer
    In Go, to access elements of a string, we can write: str := "text" for i, c := range str { // str[i] is of type byte // c is of type rune } When ... []byte(str) for _, s := range str2 { // use s } See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.5k views
1 answer
    I recently asked this question and the answers increased my understanding, but they didn't solve the actual problem I had. So, I will try to ask a ... through a funtcion like str.At(i) for example? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.4k views
1 answer
    Go doc for Package fmt Floating-point and complex constituents says: Floating-point and complex constituents: %b decimalless scientific notation with ... 4503599627370496p-52 What is 4503599627370496p-52? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
2.9k views
1 answer
    I'm using the excellent viper library from here: https://github.com/spf13/viper I'm trying to read in a config file in hcl (although it could be a JSOn ... new to golang, so please go easy on me :) See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.6k views
1 answer
    Yet another beginner's question for golang: I can write: for i := 0; i < 10; i++ {} But if I want i to be of a specific type as int64, ... } Am I missing a point here? Is there any explanation for it? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.7k views
1 answer
    I'm new to golang and I'm trying to write a function that uploads a file with a post request to telegram for a bot I'm writing. I've ... the api method is https://core.telegram.org/bots/api#sendphoto See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.4k views
1 answer
    When I look at the net/http server interface, I don't see an obvious way to get notified and react when the http.Server comes up and starts listening: ... I left to just sleeping "enough" to fake it? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.4k views
1 answer
    How can I initialize KILO variable with const type? const KILO = math.Pow10(3) Because I have an errror const initializer math.Pow10(3) is not a constant See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.7k views
1 answer
    Is it possible to change pointer type and value of variable defined by interface? I can change pointer value with reflection: v.Elem().Set(reflect.ValueOf(&Greeter{" ... ()) // Hello, My name is Ron } See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.4k views
1 answer
    Perhaps this is a silly question, but is there a way to find all functions (in the standard library or GOPATH) that return a specific type? For ... the original question when the type is an interface. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.7k views
1 answer
    I want to define a method on a struct for validating http request. but I have some problems about accessing struct fields. there is my code. ... fields on Validate() method like Validate2() method? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.6k views
1 answer
    I'm pulling in data that is in long hexadecimal string form which I need to convert into decimal notation, truncate 18 decimal places, and then serve up in ... ). What is the best strategy to attack this? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.5k views
1 answer
    Is it possible to execute code at a noon everyday? The program is handling user input the rest of its run time but needs to run a function at noon to ... text. What is the most effective way to do this? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.7k views
1 answer
    The xml file consists of two elements. Those elements have the same structure except for one element name. I tried to set a value to the XMLName property, but ... `xml:"ELEM3"` e4 string `xml:"ELEM4"` } See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.5k views
1 answer
    I am coding with Go 1.2 on Ubuntu 12.04 LTS machine - using LiteIDE (very pleased with it). I downloaded and installed the go termbox package - ... such device or address Any clues would be helpful.... See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.4k views
1 answer
    In my code there are three concurrent routines. I try to give a brief overview of my code, Routine 1 { do something *Send int to Routine 2 Send ... options, in fact there is lots of sending and printing. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.5k views
1 answer
    package main import "fmt" const name = "Yosua" // or var name string = "James" func main() { name := "Jobs" fmt.Println(name) } How to refer to the constant and not the the function level variable? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.4k views
1 answer
    I use type switches in Go, e.g. the following one: switch question.(type) { case interfaces.ComputedQuestion: handleComputedQuestion(question.(interfaces. ... I can pass it to another function? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.3k views
1 answer
    The api call GET https://api.softlayer.com/rest/v3/SoftLayer_Product_Package/257/getConfiguration?objectMask=mask[itemCategory] returns an object, []datatypes. ... 257, "sort": 0 }, See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
Ask a question:
Welcome to Jonic Developer Community for programmer and developer-Open, Learning and Share
...