Melkeydev / go-blueprint

Go-blueprint allows users to spin up a quick Go project using a popular framework
MIT License
2.07k stars 141 forks source link

[Bug] Can't use in Windows 11 #190

Closed 19jmrs closed 2 months ago

19jmrs commented 2 months ago

What is the problem?

Every time I try to use the go-blueprint create, I'm able to choose the libraries I want to include but I always get the message saying that: "Could not install go dependency for the chosen framework exit status 1" .

Not sure if this is only in my machine or because it is windows, any idea?

Operating System

Windows 11

Architecture Version (x86, x64, arm, etc)

x64

Steps to reproduce

  1. In vs code terminal
  2. go-blueprint create
  3. choose what you want
  4. error

Relevant log output

No response

Ujstor commented 2 months ago

Tested on Win10 and it is working as expected. As people pointed out in Discord, it is probably an issue with your Go configuration.

https://stackoverflow.com/questions/55908223/how-to-setup-go-environment-on-windows

   18:26:15  ~   48ms 
➜ go-blueprint version
Go Blueprint CLI version: v0.5.7
   18:26:24  ~   179ms 
➜ go-blueprint create --advanced

 ____  _                       _       _
|  _ \| |                     (_)     | |
| |_) | |_   _  ___ _ __  _ __ _ _ __ | |_
|  _ <| | | | |/ _ \ '_ \| '__| | '_ \| __|
| |_) | | |_| |  __/ |_) | |  | | | | | |_
|____/|_|\__,_|\___| .__/|_|  |_|_| |_|\__|
                   | |
                   |_|

 *** You are in advanced mode ***

 What is the name of your project?

> test-blueprint

 What framework do you want to use in your Go project?

  [ ] Standard-library
The built-in Go standard library HTTP package

  [ ] Chi
A lightweight, idiomatic and composable router for building Go HTTP services

> [x]  Gin
 Features a martini-like API with performance that is up to 40 times faster thanks to httprouter

  [ ] Fiber
An Express inspired web framework built on top of Fasthttp

  [ ] Gorilla/Mux
Package gorilla/mux implements a request router and dispatcher for matching incoming requests to their respective handler

  [ ] HttpRouter
HttpRouter is a lightweight high performance HTTP request router for Go

  [ ] Echo
High performance, extensible, minimalist Go web framework

Press y to confirm choice.

 What database driver do you want to use in your Go project?

  [ ] Mysql
MySQL-Driver for Go's database/sql package

> [x]  Postgres
 Go postgres driver for Go's database/sql package

  [ ] Sqlite
sqlite3 driver conforming to the built-in database/sql interface

  [ ] Mongo
The MongoDB supported driver for Go.

  [ ] Redis
Redis driver for Go.

  [ ] None
Choose this option if you don't wish to install a specific database driver.

Press y to confirm choice.

 Which advanced features do you want?

  [*] HTMX/Templ
Add starter HTMX and Templ files.

> [*]  Go Project Workflow
 Workflow templates for testing, cross-compiling and releasing Go projects

Press y to confirm choice.
            ..
             Next steps:
                         • cd into the newly created project with: `cd test-blueprint`

 • Install the templ cli if you haven't already by running `go install github.com/a-h/templ/cmd/templ@latest`
                                                                                                                                                                                                                                                                                                     • Generate templ function files by running `templ generate`

                                                                                                                                                                                                  Tip: Repeat the equivalent Blueprint with the following non-interactive command:
                                                                                                                                                                                                                                                                                   • go-blueprint create --name test-blueprint --framework gin --driver postgres --advanced true
19jmrs commented 2 months ago

Tried out to check my GOROOT and GOPATH but it does not seem to have any problem... so weird, but I belive it is in my machine... will update if I find a solution.

19jmrs commented 2 months ago

Problem solved: https://www.geeksforgeeks.org/how-to-install-go-on-windows/

Recreated the Environment variables as per the link above and it is now working.