Lang Go Dep Manage

glide To upgrade dependencies, please make the necessary modifications in glide.yaml and run glide update.

Lang Java Spring Cloud

spring-cloud-greenwich-release To get started with Maven with a BOM (dependency management only): <dependencyManagement> <dependencies> <dependency> <groupId></groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>Greenwich.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId></groupId> <artifactId>spring-cloud-starter-config</artifactId> </dependency> </dependencies>

Lang Java Spring Boot V2

Spring Boot Actuator <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> Actuator comes with most endpoints disabled. Thus, the only two available by default are /health and /info. management.endpoints.web.exposure.include=* by default, all Actuator endpoints are now placed under the /actuator path mvn dependency:tree [INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:2.1.4.RELEASE:compile [INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:2.1.4.RELEASE:compile [INFO] | | +- org.springframework:spring-aop:jar:5.1.6.RELEASE:compile [INFO] | | \- org.aspectj:aspectjweaver:jar:1.9.2:compile [INFO] | +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.1.4.RELEASE:compile [INFO] | | +- com.zaxxer:HikariCP:jar:3.2.0:compile [INFO] | | \- org.


go doc proxy 从 Github 的代码库 clone go get -u mv $GOPATH/src/ $GOPATH/src/ go get -u mv $GOPATH/src/ $GOPATH/src/ 设置 GOPROXY 环境变量配置代理 例如:GOPROXY=

Effective Coding


Go Module

Modules A module is a collection of related Go packages that are versioned together as a single unit. Modules record precise dependency requirements and create reproducible builds. go.mod A module is defined by a tree of Go source files with a go.mod file in the tree’s root directory. Module source code may be located outside of GOPATH. There are four directives: module, require, replace, exclude.


Method’s receiver go don’t user special name like( this or self ) for the receiver func (p Point) MoveBy(factor float){ p.X += factor //-> this.X += factor } Pointer receiver project-layout Internal app/pkg Directory Clarification Using /internal/pkg is about consistency if you use the /pkg pattern. The public shared code goes in ‘/pkg’ and the private shared code goes in /internal/pkg vendor package go help gopath find .

Effective Coding Java


java notes

访问可见性 修饰符 类 包 子类 所有人 public 是 是 是 是 protected 是 是 是 否 没有修饰符 是 是 否 否 private 是 否 否 否 方法签名 方法签名包括 方法名 参数类型 参数顺序 不包括 返回类型 可见性 抛出例外 过载和覆盖 过载: 方法名称相同但签名不同 覆盖: 签名相同,而且返回类型也必须相同 可见性不能减少,可以增加可见性 例外必须相同或者是父类例外的子类 visibility and Atomicity in the absence of synchronization, there are a number of reasons a thread might not immediately ‐ or ever ‐ see the results of an operation in another thread.