Skip to content

Commit

Permalink
fix(lib): Fix lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
yuaanlin committed Sep 15, 2023
1 parent 760945b commit 2d0e446
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions internal/nodejs/nextjs/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ func constructNextFunction(zeaburOutputDir, firstFuncPage string) error {
var deps []string
err = filepath.Walk(".next", func(path string, info os.FileInfo, err error) error {
if strings.HasSuffix(path, ".nft.json") {
type nftJson struct {
type nftJSON struct {
Files []string `json:"files"`
}
b, err := os.ReadFile(path)
if err != nil {
return fmt.Errorf("read nft.json: %w", err)
}
var nft nftJson
var nft nftJSON
err = json.Unmarshal(b, &nft)
if err != nil {
return fmt.Errorf("unmarshal nft.json: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion internal/nodejs/nextjs/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Package nextjs is used to transform build output of Next.js app to the serverless build output format of Zeabur
package nextjs

import (
_ "embed"
"encoding/json"
"fmt"
"os"
Expand Down
4 changes: 2 additions & 2 deletions internal/nodejs/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ func GetStaticOutputDir(ctx *nodePlanContext) string {
return dir.Unwrap()
}

func GetServerless(ctx *nodePlanContext) bool {
func getServerless(ctx *nodePlanContext) bool {
expEnv := os.Getenv("EXPERIMENTAL_SERVERLESS")
if expEnv != "true" && expEnv != "1" {
return false
Expand Down Expand Up @@ -632,7 +632,7 @@ func GetMeta(opt GetMetaOptions) types.PlanMeta {
}
meta["startCmd"] = startCmd

serverless := GetServerless(ctx)
serverless := getServerless(ctx)
if serverless {
meta["serverless"] = strconv.FormatBool(serverless)
}
Expand Down
1 change: 1 addition & 0 deletions pkg/types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type ZeaburOutputConfigRoute struct {
Dest string `json:"dest"`
}

// ZeaburOutputConfig is the output config of Zeabur
type ZeaburOutputConfig struct {
// Routes is a list of routes to override the default route
Routes []ZeaburOutputConfigRoute `json:"routes"`
Expand Down

0 comments on commit 2d0e446

Please sign in to comment.