Hey team, I’m a JavaScript developer who has successfully written several plugins using the JS SDK. However, I’m currently trying to port them over to Golang since there aren’t enough examples and docs for JS for things like incremental tables.
That being said, I’m getting stuck on minor things since I’ve never developed in Go before. My latest issue is with timestamps. I have a column created and its value is 2023-02-24T18:51:07. In JavaScript, for the column, I just specify:
createColumn({
name: 'created',
type: new Timestamp(TimeUnit.SECOND),
resolver: pathResolver('created'),
}),
I gave capital case a shot but no dice. FWIW, all the other columns I have are lowercase in the pathResolver because they’re lowercase in the JSON and they all work. I’m wondering if it’s because the timestamp doesn’t have a time zone on it. JavaScript is often more forgiving when it comes to that.
Might try a custom resolver to append a Z at the end to see if that allows it to be synced correctly.
Maybe you could share some code that should help debug the issue.
This is the relevant code for Go’s path resolver: resolvers.go. You can see it works on the struct fields.
Can you share the type of the struct with its fields? If you think the issue is time zone related, you could try using a string type and see if that solves it.
The conversion from the value received in the response happens here: timestamp.go. You can see some examples of supported values here: timestamp_test.go.
I’ve confirmed it’s because of the format of the timestamp string. Appending “Z” to the end does allow it to parse correctly. I’ve asked the maintainers of the API I’m consuming via my plugin to format the timestamp with the appropriate time zone.