Questions tagged [golang-migrate]

golang-migrate is a database migration tool written in Go. Questions tagged golang-migrate should be directly related to database migrations in Go.

See https://github.com/golang-migrate/migrate

Database migrations written in Go. Use as CLI or import as library.

  • Migrate reads migrations from sources and applies them in correct order to a database.
  • Drivers are "dumb", migrate glues everything together and makes sure the logic is bulletproof. (Keeps the drivers lightweight, too.)
  • Database drivers don't assume things or try to correct user input. When in doubt, fail.
107 questions
0
votes
2 answers

golang-migrate unknown driver postgresql using terminal command

When I try to migrate down my base using terminal command (migrate -path scripts -database "postgresql://postgres:postgres@localhost:5439/basename?sslmode=disable" -verbose down) I got an error: error: database driver: unknown driver postgresql…
batrSens
  • 15
  • 5
0
votes
1 answer

Can I update go mod dependence package without adding a new tag for the dependence package

I have two code repository A and B in Go, A depends on B using gomod management. For example, the latest tag version of B is v1.0.1 and the same version in A's go.mod, and then some new commits are merged into B, but without upgrade tag. Can I get…
0
votes
1 answer

Use a interator propeties in a cunston type

I was writing Go code where I created a type using base map [string] int and I need to create a method that returns a map, reversing key and value. I started writing the code, but I can't iterate the type I created. So far I've made the following…
vfbraton
  • 83
  • 1
  • 6
0
votes
1 answer

How to convert a charAtIndex of string to ASCII equivalent int value

I have a set of strings (ASCII), that I want to assign to a string array (of cap 128). The position of the string in the array is decided by the ASCII value of the first char of the string. Like.. strArr := [128]string{} strA := "A string" strB :=…
amarjeetAnand
  • 455
  • 5
  • 12
0
votes
1 answer

Why "undefined: StackGuardMultiplierDefault" error?

describe When I clone GoAdminGroup/go-admin projectin github and run the project by the steps of README.MD file , I get this error TEST-MBP:example TEST$ GO111MODULE=on go run main.go go: downloading github.com/mattn/go-sqlite3 v1.11.0 go:…
jasondayee
  • 549
  • 4
  • 11
0
votes
1 answer

Golang struct unmarshal xss

I have a struct which has XSS injected in it. In order to remove it, I json.Marshal it, then run json.HTMLEscape. Then I json.Unmarshal it into a new struct. The problem is the new struct has XSS injected still. I simply can't figure how to remove…
meWantToLearn
  • 1,691
  • 2
  • 25
  • 45
0
votes
1 answer

How can get ip Address form socket io in Golang

I use this code but cant get ip address . How can i get user ip/port address ? I can get socket id with Id(). Below code work well but i cant find how can use more option and function for so variable. package main import ( "log" "net/http" …
Moh_beh
  • 251
  • 1
  • 3
  • 14
0
votes
1 answer

go get golang-migrate inside of docker error

I am trying to set up a small first time app in go using Docker. I want to use the cli tools for go-lang migrate. However I receive the following error: package github.com/golang-migrate/migrate/v4/internal/cli: cannot find package…
user3531263er
  • 423
  • 1
  • 4
  • 20
0
votes
1 answer

Beego skipping some migrations

When running beego migration, it shows that all migrations are executed, but it skips some migrations. Please find the scenario. I have created a migration and executed it today. I am merging another branch which has a migration created…
priyesh
  • 45
  • 6
0
votes
1 answer

Converting Slice pointer to Slice in go

I have methods which returns the data in slice pointer, now i have to convert it into slice array. how to convert slice pointer to slice array. peerRoundState, err := s.nodeview.PeerRoundStates() fmt.Println("This return value is slice pointer",…
Nagaraj M
  • 387
  • 1
  • 5
  • 16
0
votes
1 answer

different package versions from same github source using golang dep

I'm attempting to convert a project from govendor to dep. However, I'm finding one limitation in dep to make this impossible. In govendor, in the vendor.json file, I can have different packages from the same source have different revision hashes. …
jwells131313
  • 2,364
  • 1
  • 16
  • 26
0
votes
1 answer

Array of json string to array of struct in golang?

I have the following json string array data := []string{ `{"STATUS":"UP"}`, `{"STATUS":"UP"}`, } and the following struct corresponding to it type Status struct { STATUS string `json:"STATUS"` } How do I unmarshal data into an array of…
karthick
  • 49
  • 1
  • 8
-1
votes
1 answer

Hyperledger Fabric: CreateChannel Issue version-2

fabric fabric-samples/test-network createChannel failed [1]: https://i.stack.imgur.com/tJLk3.png
-1
votes
1 answer

Getting too many arguments in call to spdy.NewRoundTripperWithProxy error when i try to run my terratest go code for validating EKS cluster on AWS

Getting too many arguments in call to spdy.NewRoundTripperWithProxy error when i try to run my terratest go code which deploys, validates and un-deploys k8s pod to/from AWS EKS My scripts were perfectly working fine 3 months back but looks like some…
-1
votes
1 answer

array of struct object not getting return in response

My model having following data: package main type Subject struct { name string `json:name` section int `json:section` } var subjects = map[string][]Subject{ "1001": []Subject{ { name: "Phy", …
Pramod
  • 21
  • 6