原创 Golang:延遲調用函數與return的誰先誰後?

Golang:延遲調用函數與return的誰先誰後? package main import "fmt" var a = 10 func main() { fmt.Printf("a = %d\n", test()) }

原创 iftop + flume 實現流量監控

Get Started 安裝flume,直接官網下載壓縮包 安裝iftop,參考:http://www.vpser.net/manage/iftop.html 下載flume-iftop-source:Github Release。

原创 Go播放音樂(Linux)

依賴 首先安裝mpg123:下載地址,下載下來後解壓、configure、make然後make install 安裝portaudio19-dev:apt-get install portaudio19-dev 安裝go依賴: g

原创 Go實現微服務異步消息通信(一)Broker

Go實現微服務異步消息通信先學習一下go-micro源碼首先是基於內存的實現接下來是基於http的實現httpSubscriberhttpPublicationhttpBroker 先學習一下go-micro源碼 先貼出Broker接

原创 Go Tool學習(一)scanner(2)TestSemis方法

Go Tool學習(一)scanner(2)TestSemis方法 測試輸入——全局變量lines: var lines = []string{ // # indicates a semicolon present in the s

原创 Go Tool學習(一)scanner(1)TestScan方法

Go Tool學習(一)scanner(1)TestScan方法先看幾個全局變量開始scan之前進入循環,開始scan 先看幾個全局變量 fset:源碼文件信息集合 special、literal、operator、keyword:

原创 Golang:使用reflect實現Spring的自動裝配

先上最終效果,一段測試代碼: package wind import ( "testing" "reflect" "fmt" ) type Person struct { Name string `@:"Autowired

原创 Golang:if語句聲明變量作用域的問題

看這樣一段代碼 package main import ( "fmt" "errors" "strings" ) func parseName(name string) (parsed string, err error)

原创 Jenkins + Spring Boot

Jenkins 安裝 在Jenkins創建Spring Boot任務

原创 Spring Boot + Rabbitmq + CloudFoundry

Spring Boot + Rabbitmq + CloudFoundryCloudFoundry環境配置添加依賴配置Rabbitmq創建RabbitController用於發送消息創建Receiver用於接收消息測試 CloudFo

原创 jpa + mongodb 最近24小時時間範圍查詢

jpa + mongodb 最近24小時時間範圍查詢EntityRepositoryController Entity @Document("logs") @Data @Builder public class LogEntity i

原创 Spring Boot + Webflux + Redis

Spring Boot + Webflux + Redis添加依賴添加實體編寫controller運行... 添加依賴 <dependency> <groupId>org.springframework.boot</groupId>

原创 Hibernate整合postgresql出錯

Hibernate整合postgresql出錯環境問題解決方案 環境 Spring Boot + JPA + Hibernate + Postgresql 問題 啓動時拋出異常: java.lang.reflect.Invocatio

原创 Junit測試方法共享成員變量的問題

Junit測試方法共享成員變量的問題問題示例 問題 網上也有對這個問題的討論,對非靜態變量修改無法傳遞到其他測試方法中。但是現在我發現使用靜態變量仍然存在一些問題。當變量不是Java常規類型時,比如是個自定義類User時,對變量引用本

原创 Linux網絡編程-多進程、多線程服務器

Linux網絡編程-多進程、多線程服務器源碼多進程服務器多線程服務器客戶端多進程版客戶端(模擬多客戶端併發) 源碼 多進程服務器 server.c #include <time.h> #include <stdio.h> #inclu