初识GO框架Bud

前奏

框架Bud

安装命令:

curl -sf https://raw.githubusercontent.com/livebud/bud/main/install.sh | sh

验证命令:

bud -h

命令提示:

  Usage:
    bud [flags] [command]

  Flags:
    -C, --chdir  change the working directory
    -h, --help   show this help message
    -L, --log    filter logs with this pattern

  Commands:
    build    build your app into a single binary
    create   create a new app
    new      scaffold code for your app
    run      run the dev server
    tool     extra tools
    version  show the current version

创建项目:
bud create bud-demo

  create: Unable to infer a module name. Try again using the module <path> name.

For example,
	bud create --module=github.com/my/app bud-demo

bud create --module=github.com/my/app bud-demo
虽然异常提示,但文件夹已生成

npm ERR! code ETARGET
npm ERR! notarget No matching version found for livebud@0.2.3.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'bud-demo'
npm ERR! notarget

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/yanlili/.npm/_logs/2022-08-29T06_51_21_148Z-debug.log
| exit status 1

cd bud-demo
bud-demo ls

有些文章说是:go.mod node_modules/ package-lock.json package.json待验证

go.mod       go.sum       package.json

bud run
自动创建bud文件夹,并可以通过 http://127.0.0.1:3000访问默认页面
Listening on http://127.0.0.1:3000

目录结构
bud-demo
├─ bud
│ ├─ app
│ ├─ cache
│ │ └─ PvyE3sgPvhs
│ └─ internal
│ └─ app
│ ├─ main.go
│ └─ web
│ └─ web.go
├─ go.mod
├─ go.sum
└─ package.json

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值