This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WithTx 通过WithTx进行事物操作,helper 方法 | |
func WithTx(ctx context.Context, client *ent.Client, fn func(tx *ent.Tx) error) error { | |
tx, err := client.Tx(ctx) | |
if err != nil { | |
return err | |
} | |
defer func() { | |
if v := recover(); v != nil { | |
tx.Rollback() | |
panic(v) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g=git | |
ga='git add' | |
gaa='git add --all' | |
gapa='git add --patch' | |
gb='git branch' | |
gba='git branch -a' | |
gbd='git branch -d' | |
gbda='git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d' | |
gbl='git blame -b -w' | |
gbnm='git branch --no-merged' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vundle | |
" --------------------------------------------------------------------------- | |
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim/ | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main(){ | |
fmt.Println("躁动 😢") | |
} |