惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
WordPress大学
WordPress大学
The Cloudflare Blog
云风的 BLOG
云风的 BLOG
博客园 - Franky
D
Docker
小众软件
小众软件
阮一峰的网络日志
阮一峰的网络日志
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
U
Unit 42
M
MIT News - Artificial intelligence
B
Blog
GbyAI
GbyAI
C
Check Point Blog
P
Proofpoint News Feed
博客园 - 司徒正美
Hugging Face - Blog
Hugging Face - Blog
雷峰网
雷峰网
IT之家
IT之家
Google DeepMind News
Google DeepMind News
V
V2EX
Stack Overflow Blog
Stack Overflow Blog

编程笔记

智元灵犀X2机器人二开02:端侧环境与第一个 AIMDK 程序 智元灵犀X2机器人二开01:认识灵犀 X2 与二开全景,端侧、云端与灵心平台 腾讯WorkBuddy海外版来啦,注册畅玩gpt-6-Astra,deepseek-4.1-flash限时免费 Tencent's WorkBuddy AI: Sign Up to Enjoy GPT-6-Astra and now DeepSeek-4.1-Flash is Free AI|大模型智力测试,鹈鹕SVG生成 Grok账号如何获取SSO cookie及如何在vscode中使用grok api 转载|一图看懂大模型性价比 谷歌云收入暴增82%、公募科技持仓突破60%:AI不会减速的七个铁证 AI|AI面试题,AI来解答 译|为什么 TypeScript 7.0 用 Go 重写 解决Fish Shell中使用vfox报错,Lacks hook support 股票配债缴款操作指南 Deepseek大模型越狱/破甲提示词 用DeepSeek-V4-Pro大模型写长篇小说,网文 全网寻找的同花顺板块同列网页版来了!盯盘效率提升 5 倍的黑科技 等一个黄金坑:中海物业跌到什么价位,到手股息率能有6%? Claude Code(1)在 WSL Ubuntu 上安装和配置指南 (译)AI 裁员潮:亚马逊、微软等科技巨头将 2025 年裁员归因于人工智能 AI|L2和L3级自动驾驶有什么区别 AI|Gemini CLI 实用技巧与窍门 AI|Gemini CLI Tips & Tricks 限制 Microsoft Edge 浏览器的内存占用 (Repost)4.3 Million Browsers Infected,Inside ShadyPanda's 7-Year Malware Campaign (译)430万浏览器被感染,揭秘 ShadyPanda 持续 7 年的恶意软件活动 github Fine-grained personal access token 使用 必应搜索屏蔽垃圾网站 译|Linux 启动过程:从按下电源到内核 独立开发:AI图生图获得第一位付费用户,现在支持在线支付了 译|面试官引诱我安装恶意软件(我是如何在一次“工作面试”中差点被黑的) 译|在 Go 中防止 CSRF 的现代方法,CrossOriginProtection
Serverless|在阿里云FC上部署Go,构建环境中GO版本的切换
本文作者: yigmmk · 2025-09-11 · via 编程笔记

FC的运行环境custom.debian10和fc构建流水线中默认的go版本为1.18,已经大幅落后,这里介绍下如何修改构建环境中的go版本

脚本

1
2
3
4
5
6
7

rm -rf /usr/local/go

wget https://golang.google.cn/dl/go1.23.12.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.23.12.linux-amd64.tar.gz

export PATH=/usr/local/go/bin:$PATH

只需在 pre-deploy 步骤中执行这段脚本即可

配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
















edition: 1.0.0
name: web-framework-app



access: 'undefined'

vars:
region: 'cn-hangzhou'
service:
name: 'demo-api'
description: 'Serverless Devs Web Framework Service'

services:
framework:



component: fc
actions:
pre-deploy:
- run: |
rm -rf /usr/local/go
wget https://golang.google.cn/dl/go1.23.12.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.23.12.linux-amd64.tar.gz
export PATH=/usr/local/go/bin:$PATH
go version
go mod tidy
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o main main.go
path: ./code
props:
region: ${vars.region}
service: ${vars.service}
function:
name: 'demo-function'
description: 'Serverless Devs Web Framework Function'
codeUri: ./code
runtime: custom.debian10
memorySize: 1024
timeout: 30
instanceConcurrency: 100
caPort: 8080
customRuntimeConfig:
command:
- '/code/main'
triggers:
- name: httpTrigger
type: http
config:
authType: anonymous
methods:
- GET
- POST
- PUT
- DELETE
- HEAD
- OPTIONS
customDomains:
- domainName: auto
protocol: HTTP
routeConfigs:
- path: /*

参考