问题背景
python项目debug起不来
解决方案: 1.设置launch.json
python{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "load_app",
"type": "debugpy",
"request": "launch",
"program": "项目路径/server/server.py",
"console": "integratedTerminal"
}
]
}
相关信息
有时我们可能会在提交后,意识到有些修改需要进行调整或者添加,这时候就可以使用git commit –amend命令来完成
首先我们第一次提交
jsgit init
git add test.txt
git commit -m "Initial commit"
git push
现在,我们意识到我们在提交前漏掉了一个感叹号。我们可以通过以下命令来修改最新的一次提交:
jsecho "Hello, Git!" > test.txt
git add test.txt
git commit --amend -m "Initial commit!"
linuxnohup ./demo > /dev/null 2>&1 &
作用
通过使用Context,可以做到统一的、全链路的流程控制和数据传递。
golangctx=context.WithValue(ctx,"my_key","my_value") // 设置一个值
ctx,cancel:=context.WithCancel(context.Background()) //设置一个取消信号
ctx,cancel:=context.WithTimeout(context.Background(),1*time.Second) // 设置一个超时取消信号
cancel()
日常中可能存在文件中包含空行的问题,针对该类问题,可以通过grep或者sed等命令进行整理
grep -v '^$' 原始文件 > 结果文件